-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Create pass-through version of protractor.browser
#3884
Comments
Another thing we could do would be to have await browser.restart();
await browser.get(...); |
We will have to return a promise from Also, returning a promise from |
That also doesn't really do anything to resolve the stale reference problem |
If we replace the |
There are two main issues with the way we handle
protractor.browser
(i.e.global.browser
):setupGlobals_
again inbrowser.restart
, overwriting the old reference. This could cause problems if anyone saves a reference to the oldbrowser
object. For instance, in When using ExpectedConditions after browser.restart(), getting "Driver does not have valid session ID" error #3881, a test is saving a reference to ExpectedConditions, which in turn has a reference tobrowser
, causing a problem..ready
deeply into protractor commands. Currently this is not a problem because.ready
for three reasons:.ready()
is only used to make sure timeouts are set correctly, and it's not a big deal if we don't wait for it properly.ready()
is a webdriver promise, and is waited on by the control flow.ready()
is waited on inRunner.run()
, so this only matters whenbrowser.forkNewDriverInstance
orbrowser.restart()
are used#3881 is an incorrect usage, but it was a reasonable mistake.
.ready()
isn't a big deal at the moment, but we're going to use it more as reduce out reliance on the webdriver control flow.I propose we make a class
ShallowBrowser
, which basically implements all methods/properties something like this:Then in
restart
we would setbrowser_.browserInstance_
, instead of overwritingbrowser_
and the global variables.To be clear, I think this is an extremely ugly solution which I hate. If you have a better idea please let me know.
@juliemr @cnishina @mgiambalvo feedback would be appreciated
The text was updated successfully, but these errors were encountered: