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

Remove all direct usage of webdriver.promise #3990

Open
sjelin opened this issue Jan 19, 2017 · 0 comments
Open

Remove all direct usage of webdriver.promise #3990

sjelin opened this issue Jan 19, 2017 · 0 comments

Comments

@sjelin
Copy link
Contributor

sjelin commented Jan 19, 2017

Currently I'm shifting things from new wdpromise.Promise() and wdpromise.fulfilled() to flow.promise() and wdpromise.when(). These functions are useful because they instance a ManagedPromise when the control flow is enabled, but a native ES6 promise when the control flow is disabled.

However, when the control flow is completely removed from selenium-webdriver many of the helper functions will go away. The when() function and SimpleScheduler will certainly go away.

We have two options:

  1. Create a helper file promiseUtils.ts which has its own version of
    • wdpromise.when()
    • wdpromise.all()
    • wdpromise.controlFlow()
    • flow.promise()
    • etc.
  2. Wait until selenium-webdriver removes the control flow entirely and then transition over to the ES6 native functions
    • Promise.fulfill()
    • Promise.all()
    • null (there is no ES6 equivalent to the control flow)
    • new Promise()
    • etc.

Option 2 is certainly more standard, it has some disadvantages:

  • It cannot be started until the control flow is totally removed, as it would break any users relying on the control flow
  • During the period of time while we wait for the control flow to be removed, these functions may be deprecated.
  • If we decide to do Feature Request: Allow users to use a custom ControlFlow/scheduler #4024, we're going to have to write our own mini version of SimpleScheduler anyway.

Option 1 is what jasmine did in angular/jasminewd#82, but that's largely because jasminewd isn't tied to a specific version of selenium-webdriver like Protractor is.

@sjelin sjelin changed the title Remove all direct usage of webdriver.promise and instead shift everything over to a promiseUtils.ts file Remove all direct usage of webdriver.promise Feb 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant