spectron
spectron copied to clipboard
Chrome not reachable
I have an error when I run initial test from the example. It says that the test suit passed but also give an error that "Chrome is not reachable". Could you please help to resolve this issue?
npm test
> mocha --verbose
Application launch
✓ shows an initial window
(node:8772) UnhandledPromiseRejectionWarning: chrome not reachable: chrome not reachable
(Session info: chrome=85.0.4183.121)
at Object.getErrorFromResponseBody (/Users/matviihodovaniuk/app/node_modules/webdriver/build/utils.js:94:12)
at WebDriverRequest._request (/Users/matviihodovaniuk/app/node_modules/webdriver/build/request.js:132:31)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async Browser.wrapCommandFn (/Users/matviihodovaniuk/app/node_modules/@wdio/utils/build/shim.js:58:29)
(node:8772) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8772) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
1 passing (2s)
Thanks!
Same issue
"after each" hook:
chrome not reachable: chrome not reachable
(Session info: chrome=85.0.4183.121)
And all the next tests are skipped. This after migration to v 12.0.0, before in 10.0.0 this issue not reproduced. Please help to fix this issue.
Thanks!
OS: macOS 10.15.7 Electron: 10.1.5 Spectron: 12.0.0
This seems like it might be the macOS version of #751
I have found you can (very hackly) bypass the error being thrown by manually editing node_modules/webdriver/build/request.js
// add this block
if (error.message.startsWith('chrome not reachable')) {
console.log(error);
return {
value: null,
};
}
// just before the last return in the file
return retry(error, `Request failed with status ${response.statusCode} due to ${error.message}`);
It's no solution but it means you can at least get the Spectron tests running again!
Has anyone found a proper fix for this issue? I'm a similar issue:
1) Application launch
can open and close a bundle submission through the server:
chrome not reachable: chrome not reachable
(Session info: chrome=83.0.4103.122)
at Object.getErrorFromResponseBody (node_modules\webdriver\build\utils.js:94:12)
at WebDriverRequest._request (node_modules\webdriver\build\request.js:133:31)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Browser.wrapCommandFn (node_modules\@wdio\utils\build\shim.js:58:29)
at async Browser.getWindowCount (node_modules\@wdio\utils\build\shim.js:58:29)
2) Application launch
"after all" hook for "can open and close a bundle submission through the server":
Error: waitUntil condition failed with the following reason: chrome not reachable
(Session info: chrome=83.0.4103.122)
at D:\nielvas\dev\fnxtech\connect\node_modules\webdriverio\build\commands\browser\waitUntil.js:26:15
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Browser.wrapCommandFn (node_modules\@wdio\utils\build\shim.js:58:29)
at async ConnectTestApp.waitUntilWindow (test\utils\connectTestApp.js:46:9)
at async ConnectTestApp.close (test\utils\connectTestApp.js:17:4)
at async Context.<anonymous> (test\startup.js:18:3)
webdriverio: 6.10.10 electron-chromedriver 11.0.0 spectron: 13.0.0 electron: 11.1.0
The issue in my case was that spectron tried to use global version of chromedriver (v69.0 provided by CircleCI' ubuntu-1604:202101-01), not the one that electron-chromedriver downloaded (v89.0). Solution was to run export PATH=$(pwd)/node_modules/.bin:$PATH
before running e2e tests.