This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'selenium4' into suites
- Loading branch information
Showing
5 changed files
with
50 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
|
||
describe('handling timeout errors', function() { | ||
|
||
it('should call error handler on a timeout', function() { | ||
browser.get('http://dummyUrl', 1).then(function() { | ||
describe('handling timeout errors', () => { | ||
it('should call error handler on a timeout', async () => { | ||
try { | ||
await browser.get('http://dummyUrl', 1); | ||
throw 'did not handle error'; | ||
}, function(err) { | ||
} catch (err) { | ||
expect(err instanceof Error).toBeTruthy(); | ||
}); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,50 @@ | ||
describe('navigation', function() { | ||
beforeEach(function() { | ||
browser.get('index.html#/form'); | ||
const env = require('./../environment.js'); | ||
|
||
describe('navigation', () => { | ||
beforeEach(async () => { | ||
await browser.get('index.html#/form'); | ||
}); | ||
|
||
it('should deal with alerts', function() { | ||
var alertButton = $('#alertbutton'); | ||
alertButton.click(); | ||
var alertDialog = browser.switchTo().alert(); | ||
it('should deal with alerts', async () => { | ||
const alertButton = $('#alertbutton'); | ||
await alertButton.click(); | ||
const alertDialog = await browser.switchTo().alert(); | ||
|
||
expect(alertDialog.getText()).toEqual('Hello'); | ||
expect(await alertDialog.getText()).toEqual('Hello'); | ||
|
||
alertDialog.accept(); | ||
await alertDialog.accept(); | ||
}); | ||
|
||
it('should refresh properly', function() { | ||
var username = element(by.model('username')); | ||
var name = element(by.binding('username')); | ||
username.clear(); | ||
expect(name.getText()).toEqual(''); | ||
|
||
browser.navigate().refresh(); | ||
it('should refresh properly', async () => { | ||
const username = element(by.model('username')); | ||
const name = element(by.binding('username')); | ||
await username.clear(); | ||
expect(await name.getText()).toEqual(''); | ||
|
||
expect(name.getText()).toEqual('Anon'); | ||
}); | ||
await browser.navigate().refresh(); | ||
|
||
// Back and forward do NOT work at the moment because of an issue | ||
// bootstrapping with Angular | ||
/* | ||
it('should navigate back and forward properly', function() { | ||
browser.get('index.html#/repeater'); | ||
expect(browser.getCurrentUrl()). | ||
toEqual(env.baseUrl+'/ng1/index.html#/repeater'); | ||
browser.navigate().back(); | ||
expect(browser.getCurrentUrl()). | ||
toEqual(env.baseUrl+'/ng1/index.html#/form'); | ||
browser.navigate().forward(); | ||
expect(browser.getCurrentUrl()). | ||
toEqual(env.baseUrl+'/ng1/index.html#/repeater'); | ||
expect(await name.getText()).toEqual('Anon'); | ||
}); | ||
*/ | ||
|
||
it('should navigate back and forward properly', async () => { | ||
await browser.get('index.html#/repeater'); | ||
expect(await browser.getCurrentUrl()).toEqual(`${env.baseUrl}/ng1/index.html#/repeater`); | ||
|
||
it('should navigate back and forward properly from link', function() { | ||
element(by.linkText('repeater')).click(); | ||
expect(browser.getCurrentUrl()). | ||
toEqual(browser.baseUrl + 'index.html#/repeater'); | ||
await browser.navigate().back(); | ||
expect(await browser.getCurrentUrl()).toEqual(`${env.baseUrl}/ng1/index.html#/form`); | ||
|
||
browser.navigate().back(); | ||
expect(browser.getCurrentUrl()). | ||
toEqual(browser.baseUrl + 'index.html#/form'); | ||
await browser.navigate().forward(); | ||
expect(await browser.getCurrentUrl()).toEqual(`${env.baseUrl}/ng1/index.html#/repeater`); | ||
}); | ||
|
||
browser.navigate().forward(); | ||
expect(browser.getCurrentUrl()). | ||
toEqual(browser.baseUrl + 'index.html#/repeater'); | ||
it('should navigate back and forward properly from link', async () => { | ||
await element(by.linkText('repeater')).click(); | ||
expect(await browser.getCurrentUrl()).toEqual(`${browser.baseUrl}index.html#/repeater`); | ||
|
||
await browser.navigate().back(); | ||
expect(await browser.getCurrentUrl()).toEqual(`${browser.baseUrl}index.html#/form`); | ||
|
||
await browser.navigate().forward(); | ||
expect(await browser.getCurrentUrl()).toEqual(`${browser.baseUrl}index.html#/repeater`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters