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

Commit 701ca94

Browse files
committed
chore(test): move restartBrowserBetweenTests off of the control flow
1 parent 37043ca commit 701ca94

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

scripts/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var passingTests = [
3030
// 'node built/cli.js spec/plugins/waitForAngularConf.js',
3131
// 'node built/cli.js spec/interactionConf.js',
3232
// 'node built/cli.js spec/directConnectConf.js',
33-
// 'node built/cli.js spec/restartBrowserBetweenTestsConf.js',
33+
'node built/cli.js spec/restartBrowserBetweenTestsConf.js',
3434
// 'node built/cli.js spec/driverProviderLocalConf.js',
3535
// 'node built/cli.js spec/driverProviderLocalConf.js --useBlockingProxy',
3636
// 'node built/cli.js spec/getCapabilitiesConf.js',
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
var env = require('../environment.js');
1+
const env = require('../environment.js');
22

3-
describe('pages with login', function() {
4-
it('should set a cookie', function() {
5-
browser.get(env.baseUrl + '/ng1/index.html');
3+
describe('pages with login', () => {
4+
it('should set a cookie', async() => {
5+
await browser.get(env.baseUrl + '/ng1/index.html');
66

7-
browser.manage().addCookie({name:'testcookie', value: 'Jane-1234'});
7+
await browser.manage().addCookie({name:'testcookie', value: 'Jane-1234'});
88

99
// Make sure the cookie is set.
10-
browser.manage().getCookie('testcookie').then(function(cookie) {
11-
expect(cookie.value).toEqual('Jane-1234');
12-
});
10+
const cookie = await browser.manage().getCookie('testcookie');
11+
expect(cookie.value).toEqual('Jane-1234');
1312
});
1413

15-
it('should check the cookie is gone', function() {
16-
browser.get(env.baseUrl + '/ng1/index.html');
14+
it('should check the cookie is gone', async() => {
15+
await browser.get(env.baseUrl + '/ng1/index.html');
1716

1817
// Make sure the cookie is gone.
19-
browser.manage().getCookie('testcookie').then(function(cookie) {
20-
expect(cookie).toEqual(null);
21-
});
18+
const cookie = await browser.manage().getCookie('testcookie');
19+
expect(cookie).toEqual(null);
2220
});
2321
});

spec/restartBrowserBetweenTestsConf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
var env = require('./environment.js');
1+
const env = require('./environment.js');
22

33
// The main suite of Protractor tests.
44
exports.config = {
55
seleniumAddress: env.seleniumAddress,
6+
SELENIUM_PROMISE_MANAGER: false,
67

78
framework: 'jasmine',
89

0 commit comments

Comments
 (0)