Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 9febd3c

Browse files
authored
Merge branch 'selenium4' into suites
2 parents 047b1ff + 37043ca commit 9febd3c

File tree

5 files changed

+49
-53
lines changed

5 files changed

+49
-53
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ before_script:
4444
- mkdir -p $LOGS_DIR
4545
- ./scripts/travis_setup.sh
4646

47+
4748
script:
4849
- ./scripts/testserver.sh
4950
- ./scripts/test_on_travis.sh

spec/basic/handling_spec.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
2-
describe('handling timeout errors', function() {
3-
4-
it('should call error handler on a timeout', function() {
5-
browser.get('http://dummyUrl', 1).then(function() {
1+
describe('handling timeout errors', () => {
2+
it('should call error handler on a timeout', async () => {
3+
try {
4+
await browser.get('http://dummyUrl', 1);
65
throw 'did not handle error';
7-
}, function(err) {
6+
} catch (err) {
87
expect(err instanceof Error).toBeTruthy();
9-
});
8+
}
109
});
1110
});

spec/basic/navigation_spec.js

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,50 @@
1-
describe('navigation', function() {
2-
beforeEach(function() {
3-
browser.get('index.html#/form');
1+
const env = require('./../environment.js');
2+
3+
describe('navigation', () => {
4+
beforeEach(async () => {
5+
await browser.get('index.html#/form');
46
});
57

6-
it('should deal with alerts', function() {
7-
var alertButton = $('#alertbutton');
8-
alertButton.click();
9-
var alertDialog = browser.switchTo().alert();
8+
it('should deal with alerts', async () => {
9+
const alertButton = $('#alertbutton');
10+
await alertButton.click();
11+
const alertDialog = await browser.switchTo().alert();
1012

11-
expect(alertDialog.getText()).toEqual('Hello');
13+
expect(await alertDialog.getText()).toEqual('Hello');
1214

13-
alertDialog.accept();
15+
await alertDialog.accept();
1416
});
1517

16-
it('should refresh properly', function() {
17-
var username = element(by.model('username'));
18-
var name = element(by.binding('username'));
19-
username.clear();
20-
expect(name.getText()).toEqual('');
21-
22-
browser.navigate().refresh();
18+
it('should refresh properly', async () => {
19+
const username = element(by.model('username'));
20+
const name = element(by.binding('username'));
21+
await username.clear();
22+
expect(await name.getText()).toEqual('');
2323

24-
expect(name.getText()).toEqual('Anon');
25-
});
24+
await browser.navigate().refresh();
2625

27-
// Back and forward do NOT work at the moment because of an issue
28-
// bootstrapping with Angular
29-
/*
30-
it('should navigate back and forward properly', function() {
31-
browser.get('index.html#/repeater');
32-
expect(browser.getCurrentUrl()).
33-
toEqual(env.baseUrl+'/ng1/index.html#/repeater');
34-
35-
browser.navigate().back();
36-
expect(browser.getCurrentUrl()).
37-
toEqual(env.baseUrl+'/ng1/index.html#/form');
38-
39-
browser.navigate().forward();
40-
expect(browser.getCurrentUrl()).
41-
toEqual(env.baseUrl+'/ng1/index.html#/repeater');
26+
expect(await name.getText()).toEqual('Anon');
4227
});
43-
*/
28+
29+
it('should navigate back and forward properly', async () => {
30+
await browser.get('index.html#/repeater');
31+
expect(await browser.getCurrentUrl()).toEqual(`${env.baseUrl}/ng1/index.html#/repeater`);
4432

45-
it('should navigate back and forward properly from link', function() {
46-
element(by.linkText('repeater')).click();
47-
expect(browser.getCurrentUrl()).
48-
toEqual(browser.baseUrl + 'index.html#/repeater');
33+
await browser.navigate().back();
34+
expect(await browser.getCurrentUrl()).toEqual(`${env.baseUrl}/ng1/index.html#/form`);
4935

50-
browser.navigate().back();
51-
expect(browser.getCurrentUrl()).
52-
toEqual(browser.baseUrl + 'index.html#/form');
36+
await browser.navigate().forward();
37+
expect(await browser.getCurrentUrl()).toEqual(`${env.baseUrl}/ng1/index.html#/repeater`);
38+
});
5339

54-
browser.navigate().forward();
55-
expect(browser.getCurrentUrl()).
56-
toEqual(browser.baseUrl + 'index.html#/repeater');
40+
it('should navigate back and forward properly from link', async () => {
41+
await element(by.linkText('repeater')).click();
42+
expect(await browser.getCurrentUrl()).toEqual(`${browser.baseUrl}index.html#/repeater`);
43+
44+
await browser.navigate().back();
45+
expect(await browser.getCurrentUrl()).toEqual(`${browser.baseUrl}index.html#/form`);
46+
47+
await browser.navigate().forward();
48+
expect(await browser.getCurrentUrl()).toEqual(`${browser.baseUrl}index.html#/repeater`);
5749
});
5850
});

spec/basicConf.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ exports.config = {
1010
// Spec patterns are relative to this directory.
1111
specs: [
1212
'basic/elements_spec.js',
13-
'basic/lib_spec.js'
13+
'basic/lib_spec.js',
14+
'basic/navigation_spec.js',
15+
'basic/handling_spec.js'
1416
],
1517

1618
// Exclude patterns are relative to this directory.

spec/ciFullConf.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ exports.config = {
1212
// TODO(selenium4): revert back to basic/*_spec.js
1313
specs: [
1414
'basic/elements_spec.js',
15-
'basic/lib_spec.js'
15+
'basic/lib_spec.js',
16+
'basic/navigation_spec.js',
17+
'basic/handling_spec.js'
1618
],
1719

1820
// Exclude patterns are relative to this directory.

0 commit comments

Comments
 (0)