Skip to content

Commit 5650b96

Browse files
committed
[js] For #2969, remove the promise manager and all related APIs
1 parent ef44fef commit 5650b96

16 files changed

+791
-8156
lines changed

javascript/node/selenium-webdriver/CHANGES.md

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## v.next
1+
## v4.0.0-dev
22

33
### Changes to Supported Browsers
44

@@ -12,27 +12,52 @@ mode.
1212

1313
### API Changes
1414

15-
* Added `webdriver.manage().window().minimize()`
16-
* Added `webdriver.manage().window().fullscreen()`
17-
* The core WebDriver API no longer uses promise manager
18-
- Removed `index.Builder#setControlFlow()`
19-
- The following thenable types no longer have a `cancel()` method:
20-
- The dynamically generated thenable WebDrivers created by `index.Builder`
21-
- `lib/webdriver.AlertPromise`
22-
- `lib/webdriver.WebElementPromise`
23-
* The `testing/index` module no longer wraps the promise manager
24-
* Removed `remote/index.DriverService.prototype.stop()` (use `#kill()` instead)
25-
* Removed the `firefox.Binary` class. Custom binaries can still be selected
26-
using `firefox.Options#setBinary()`. Likewise, custom binary arguments can be
27-
specified with `firefox.Options#addArguments()`.
28-
* Removed the `lib/actions` module
29-
* Removed the `phantomjs` module
30-
* Removed the 'opera' module
31-
* Removed the `WebDriver.attachToSession()` factory method. Users can just use
32-
use the `WebDriver` constructor directly instead.
33-
* Removed the `WebDriver.prototype.touchActions()` method. Action sequences
34-
are now defined from a single origin: `WebDriver.prototype.actions()`.
35-
* Renamed `WebDriver#schedule()` to `WebDriver#execute()`
15+
* Added `webdriver.manage().window().minimize()`
16+
* Added `webdriver.manage().window().fullscreen()`
17+
* The core WebDriver API no longer uses promise manager
18+
- Removed `index.Builder#setControlFlow()`
19+
- The following thenable types no longer have a `cancel()` method:
20+
- The dynamically generated thenable WebDrivers created by `index.Builder`
21+
- `lib/webdriver.AlertPromise`
22+
- `lib/webdriver.WebElementPromise`
23+
* The `testing/index` module no longer wraps the promise manager
24+
* Removed `remote/index.DriverService.prototype.stop()` (use `#kill()` instead)
25+
* Removed the `firefox.Binary` class. Custom binaries can still be selected
26+
using `firefox.Options#setBinary()`. Likewise, custom binary arguments can be
27+
specified with `firefox.Options#addArguments()`.
28+
* Removed the `lib/actions` module
29+
* Removed the `phantomjs` module
30+
* Removed the 'opera' module
31+
* Removed the `WebDriver.attachToSession()` factory method. Users can just use
32+
use the `WebDriver` constructor directly instead.
33+
* Removed the `WebDriver.prototype.touchActions()` method. Action sequences
34+
are now defined from a single origin: `WebDriver.prototype.actions()`.
35+
* Removed the promise manager from `lib/promise`, which includes the removal
36+
of the following exported names (replacements, if any, in parentheses):
37+
- CancellableThenable
38+
- CancellationError
39+
- ControlFlow
40+
- Deferred
41+
- LONG_STACK_TRACES
42+
- MultipleUnhandledRejectionError
43+
- Promise (use native Promises)
44+
- Resolver
45+
- Scheduler
46+
- Thenable
47+
- USE_PROMISE_MANAGER
48+
- all (use Promise.all)
49+
- asap (use Promise.resolve)
50+
- captureStackTrace (use Error.captureStackTrace)
51+
- consume (use async functions)
52+
- controlFlow
53+
- createPromise (use new Promise)
54+
- defer
55+
- fulfilled (use Promise.resolve)
56+
- isGenerator
57+
- rejected (use Promise.reject)
58+
- setDefaultFlow
59+
- when (use Promise.resolve)
60+
* Renamed `WebDriver#schedule()` to `WebDriver#execute()`
3661

3762
### Changes for W3C WebDriver Spec Compliance
3863

javascript/node/selenium-webdriver/example/google_search_generator.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

javascript/node/selenium-webdriver/example/google_search_test.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030
*/
3131

3232
const {Builder, By, Key, until} = require('..');
33-
const test = require('../testing');
3433

35-
test.describe('Google Search', function() {
34+
describe('Google Search', function() {
3635
let driver;
3736

38-
test.before(function *() {
39-
driver = yield new Builder().forBrowser('firefox').build();
37+
before(async function() {
38+
driver = await new Builder().forBrowser('firefox').build();
4039
});
4140

4241
// You can write tests either using traditional promises.
@@ -47,14 +46,12 @@ test.describe('Google Search', function() {
4746
.then(_ => driver.wait(until.titleIs('webdriver - Google Search'), 1000));
4847
});
4948

50-
// Or you can define the test as a generator function. The test will wait for
51-
// any yielded promises to resolve before invoking the next step in the
52-
// generator.
53-
test.it('works with generators', function*() {
54-
yield driver.get('http://www.google.com/ncr');
55-
yield driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
56-
yield driver.wait(until.titleIs('webdriver - Google Search'), 1000);
49+
// Or you can define the test with an async function.
50+
it('works with generators', async function() {
51+
await driver.get('http://www.google.com/ncr');
52+
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
53+
await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
5754
});
5855

59-
test.after(() => driver.quit());
56+
after(() => driver.quit());
6057
});

javascript/node/selenium-webdriver/example/parallel_flows.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)