https://github.com/corevo/webdriver-async-failure
https://github.com/corevo/webdriver-async-failure
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/corevo/webdriver-async-failure
- Owner: corevo
- Created: 2018-07-25T11:05:04.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-26T07:39:08.000Z (almost 8 years ago)
- Last Synced: 2025-01-22T20:51:43.467Z (over 1 year ago)
- Language: JavaScript
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## selenium-webdriver throws without capturing the stacktrace
`yarn` or `npm install`
`yarn test` or `npm test`
The result is that the error won't be caught [here](https://github.com/corevo/webdriver-async-failure/blob/master/async.test.js#L12), nor will jest.
It will cause jest to unexpectedly exit, before even giving time to quit the drivers correctly.
## Difference in stacktrace capturing, the test framework is able to catch the error

## Proposed solution
A change to `perform()`.
https://github.com/SeleniumHQ/selenium/blob/selenium-3.6.0/javascript/node/selenium-webdriver/lib/actions.js#L116
```js
perform() {
// Make a protected copy of the scheduled actions. This will protect against
// users defining additional commands before this sequence is actually
// executed.
let actions = this.actions_.concat();
let driver = this.driver_;
return Promise.all(actions.map((action) => {
return driver.schedule(action.command, action.description);
}));
}
```