Skip to content

Commit

Permalink
[js] Introduce the SELENIUM_PROMISE_MANAGER environment variable, whi…
Browse files Browse the repository at this point in the history
…ch can be

set to 0 to disable use of the promise manager.

Full details and motivation behind this change can be found in #2969
  • Loading branch information
jleyba committed Nov 2, 2016
1 parent 332e45f commit 370703f
Show file tree
Hide file tree
Showing 39 changed files with 5,313 additions and 5,092 deletions.
4 changes: 4 additions & 0 deletions javascript/node/selenium-webdriver/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"moz:firefoxOptions" dictionary for Firefox-specific configuration values.
* Extending the `selenium-webdriver/testing` module to support tests defined
using generator functions.
* The promise manager can be disabled by setting an enviornment variable:
`SELENIUM_PROMISE_MANAGER=0`. This is part of a larger plan to remove the
promise manager, as documented at
<https://github.com/SeleniumHQ/selenium/issues/2969>


### API Changes
Expand Down
16 changes: 7 additions & 9 deletions javascript/node/selenium-webdriver/example/google_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@
* node selenium-webdriver/example/google_search.js
*/

var webdriver = require('..'),
By = webdriver.By,
until = webdriver.until;
const {Builder, By, until} = require('..');

var driver = new webdriver.Builder()
var driver = new Builder()
.forBrowser('firefox')
.build();

driver.get('http://www.google.com/ncr');
driver.findElement(By.name('q')).sendKeys('webdriver');
driver.findElement(By.name('btnG')).click();
driver.wait(until.titleIs('webdriver - Google Search'), 1000);
driver.quit();
driver.get('http://www.google.com/ncr')
.then(_ => driver.findElement(By.name('q')).sendKeys('webdriver'))
.then(_ => driver.findElement(By.name('btnG')).click())
.then(_ => driver.wait(until.titleIs('webdriver - Google Search'), 1000))
.then(_ => driver.quit());
2 changes: 1 addition & 1 deletion javascript/node/selenium-webdriver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ class Builder {
* __Note:__ this method is purely a convenience wrapper around
* {@link #build()}.
*
* @return {!promise.Promise<!webdriver.WebDriver>} A promise that will be
* @return {!promise.Thenable<!webdriver.WebDriver>} A promise that will be
* fulfilled with the newly created WebDriver instance once the browser
* has been fully initialized.
* @see #build()
Expand Down
Loading

0 comments on commit 370703f

Please sign in to comment.