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
feat(SELENIUM_PROMISE_MANAGER=0): Improve support for SELENIUM_PROMISE_MANAGER=0
There are three major ways this was done in this change:
* In `callWhenIdle`, if `flow.isIdle` is not defined, we assume we are working
with a `SimpleScheduler` instance, and so the flow is effectively idle.
* In `initJasmineWd`, if `flow.reset` is not defined, we assume we are working
with a `SimpleScheduler` instance, and so don't bother resetting the flow.
* In `wrapInControlFlow`, we use `flow.promise` to create a new promise if
possible. Since `new webdriver.promise.Promise()` would have always made a
`ManagedPromise`, but `flow.promise` will do the right thing.
* In `wrapCompare`, we avoid the webdriver library entirely, and never instance
any extra promises. Using `webdriver.promise.when` and `webdriver.promise.all`
could have been a problem if our instance of `webdriver` had the control flow
turned on, but another instance somewhere did not (or even the same instance,
but just at a different point in time). Instead we use the new `maybePromise`
tool, which is a mess but is also exactly what we want.
* In `specs/*`, we replace `webdriver.promise.fulfilled` with
`webdriver.promise.when`.
* In `specs/*`, a new version of `adapterSpec.js` and `errorSpec.js` are
created: `asyncAwaitAdapterSpec.ts` and `asyncAwaitErrorSpec.ts`.
I also also fixed a minor bug where we weren't correctly checking for promises
inside an array of expected results. Before we had
```js
expected = Array.prototype.slice.call(arguments, 0)
...
webdriver.promise.isPromise(expected)
```
I thought about it for a little while, and there's no way that's correct.
`expected` is an `Array<any>`, there's no way it has a `.then` function.
Closes#69
0 commit comments