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

chore(test): move controlLock test off of the control flow #5022

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 @@ -34,7 +34,7 @@ var passingTests = [
// 'node built/cli.js spec/driverProviderLocalConf.js',
// 'node built/cli.js spec/driverProviderLocalConf.js --useBlockingProxy',
// 'node built/cli.js spec/getCapabilitiesConf.js',
// 'node built/cli.js spec/controlLockConf.js',
'node built/cli.js spec/controlLockConf.js',
// 'node built/cli.js spec/customFramework.js',
// 'node built/cli.js spec/noGlobalsConf.js',
// 'node built/cli.js spec/angular2Conf.js',
Expand Down
6 changes: 3 additions & 3 deletions spec/control/spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('protractor control flow', function() {
it('should not deadlock', function() {
browser.driver.wait(function() {
describe('protractor control flow', () => {
it('should not deadlock', async() => {
await browser.driver.wait(() => {
return true;
}, 1000);
expect(true).toEqual(true);
Expand Down
19 changes: 10 additions & 9 deletions spec/controlLockConf.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
var env = require('./environment.js');
var webdriver = require('selenium-webdriver');
const env = require('./environment.js');
const webdriver = require('selenium-webdriver');

// Tests for cases that have caused WebDriver promise locks in
// the past.
exports.config = {
seleniumAddress: env.seleniumAddress,
SELENIUM_PROMISE_MANAGER: false,

framework: 'jasmine',

Expand All @@ -16,15 +17,15 @@ exports.config = {

baseUrl: env.baseUrl + '/ng1/',

onPrepare: function() {

onPrepare: async function() {
// This is a reasonable use case - do some promise that takes some time,
// and then do a wait until something is set up correctly.
return webdriver.promise.delayed(100).then(function() {
// This could also be replaced by an 'execute' to see the same behavior.
return browser.driver.wait(function() {
return true;
}, 10000, 'onPrepare wait');
await new Promise(resolve => {
setTimeout(resolve, 100);
});
// This could also be replaced by an 'execute' to see the same behavior.
return await browser.driver.wait(function() {
return true;
}, 10000, 'onPrepare wait');
}
};