diff --git a/scripts/test.js b/scripts/test.js index 64665d2fb..83ca8dd36 100755 --- a/scripts/test.js +++ b/scripts/test.js @@ -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', diff --git a/spec/control/spec.js b/spec/control/spec.js index bab554221..89d8872cd 100644 --- a/spec/control/spec.js +++ b/spec/control/spec.js @@ -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); diff --git a/spec/controlLockConf.js b/spec/controlLockConf.js index 06d2a6066..215a13d0c 100644 --- a/spec/controlLockConf.js +++ b/spec/controlLockConf.js @@ -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', @@ -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'); } };