You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varwebdriver=require('selenium-webdriver');varcommon=require('./common.js');letflowWrap=(promise: any)=>{returncommon.getFakeDriver().controlFlow().execute(()=>{returnpromise;});};describe('mixed promises + control flow',function(){letval: number;it('should wait for it() to finish',function(){val=1;returnnewPromise((resolve: Function)=>{resolve(webdriver.promise.fulfilled(7));}).then((seven: any)=>{flowWrap(webdriver.promise.delayed(1000).then(()=>{val=seven;}));});});it('should have waited for setter in previous it()',function(){expect(val).toBe(7);});});
This results in the error:
Expected 1 to be 7.
Meaning that the val = seven line wasn't run (I have verified this in other ways too). You need all three of the following to make this bug happen:
An ES6 promise (or possibly a q promise though I haven't tried)
A webdriver promise
controlFlow.execute() synchronization
It's as though the combination of webdriver and ES6 promises just makes the control flow fall over.
The text was updated successfully, but these errors were encountered:
Take a look at this test:
This results in the error:
Meaning that the
val = seven
line wasn't run (I have verified this in other ways too). You need all three of the following to make this bug happen:q
promise though I haven't tried)controlFlow.execute()
synchronizationIt's as though the combination of webdriver and ES6 promises just makes the control flow fall over.
The text was updated successfully, but these errors were encountered: