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

Commit ba33f08

Browse files
authored
chore(test): move controlLock test off of the control flow (#5022)
1 parent eb5913a commit ba33f08

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

scripts/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var passingTests = [
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',
37-
// 'node built/cli.js spec/controlLockConf.js',
37+
'node built/cli.js spec/controlLockConf.js',
3838
// 'node built/cli.js spec/customFramework.js',
3939
// 'node built/cli.js spec/noGlobalsConf.js',
4040
// 'node built/cli.js spec/angular2Conf.js',

spec/control/spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
describe('protractor control flow', function() {
2-
it('should not deadlock', function() {
3-
browser.driver.wait(function() {
1+
describe('protractor control flow', () => {
2+
it('should not deadlock', async() => {
3+
await browser.driver.wait(() => {
44
return true;
55
}, 1000);
66
expect(true).toEqual(true);

spec/controlLockConf.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var env = require('./environment.js');
2-
var webdriver = require('selenium-webdriver');
1+
const env = require('./environment.js');
2+
const webdriver = require('selenium-webdriver');
33

44
// Tests for cases that have caused WebDriver promise locks in
55
// the past.
66
exports.config = {
77
seleniumAddress: env.seleniumAddress,
8+
SELENIUM_PROMISE_MANAGER: false,
89

910
framework: 'jasmine',
1011

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

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

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

0 commit comments

Comments
 (0)