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

chore(test): move restartBrowserBetweenTests off of the control flow #5020

Merged
merged 1 commit into from
Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var passingTests = [
// 'node built/cli.js spec/plugins/waitForAngularConf.js',
// 'node built/cli.js spec/interactionConf.js',
// 'node built/cli.js spec/directConnectConf.js',
// 'node built/cli.js spec/restartBrowserBetweenTestsConf.js',
'node built/cli.js spec/restartBrowserBetweenTestsConf.js',
// 'node built/cli.js spec/driverProviderLocalConf.js',
// 'node built/cli.js spec/driverProviderLocalConf.js --useBlockingProxy',
// 'node built/cli.js spec/getCapabilitiesConf.js',
Expand Down
24 changes: 11 additions & 13 deletions spec/restartBrowserBetweenTests/setCookies_spec.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
var env = require('../environment.js');
const env = require('../environment.js');

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

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

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

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

// Make sure the cookie is gone.
browser.manage().getCookie('testcookie').then(function(cookie) {
expect(cookie).toEqual(null);
});
const cookie = await browser.manage().getCookie('testcookie');
expect(cookie).toEqual(null);
});
});
3 changes: 2 additions & 1 deletion spec/restartBrowserBetweenTestsConf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
var env = require('./environment.js');
const env = require('./environment.js');

// The main suite of Protractor tests.
exports.config = {
seleniumAddress: env.seleniumAddress,
SELENIUM_PROMISE_MANAGER: false,

framework: 'jasmine',

Expand Down