unknown error: Chrome failed to start: exited abnormally when trying to test electron spectron with mocha
unknown error: Chrome failed to start: exited abnormally when trying to test electron spectron with mocha
我正在尝试测试电子光谱测试。我的项目非常简单,只需克隆一个 electron quick start repo,然后将代码写入 spec.js,就像 electron-userland/spectron
的自述文件中所写的那样
但是当我 运行 npm 测试时,我遇到了这个错误:
$ npm test
> electron-quick-start@1.0.0 test /media/dna/Data D/koding/electron-example/testing-spectron
> mocha
Application launch
1) "before each" hook for "shows an initial window"
0 passing (809ms)
1 failing
1) Application launch
"before each" hook for "shows an initial window":
Error: Failed to create session.
unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /media/dna/Data D/koding/electron-example/testing-spectron/node_modules/spectron/lib/launcher.js is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
at startWebDriverSession (node_modules/webdriver/build/utils.js:45:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
之前我尝试重新安装 mocha 和 spectron,但 return 结果相同。
我的开发依赖项:
...
"devDependencies": {
"electron": "^10.1.2",
"mocha": "^8.1.3",
"spectron": "^11.1.0"
}
...
我的 os 信息:
Distributor ID: LinuxMint
Description: Linux Mint 19 Tara
Release: 19
Codename: tara
我正在使用 nodejs v12.18.4
你可以在这里克隆我的电子测试项目:electron-example
我已经将我的 electron 版本降级到 9.3.1,现在我的项目工作正常。您可以从electron-userland/spectron
中找到可以相互支持的电子和光谱版本的具体信息
我正在尝试测试电子光谱测试。我的项目非常简单,只需克隆一个 electron quick start repo,然后将代码写入 spec.js,就像 electron-userland/spectron
的自述文件中所写的那样但是当我 运行 npm 测试时,我遇到了这个错误:
$ npm test
> electron-quick-start@1.0.0 test /media/dna/Data D/koding/electron-example/testing-spectron
> mocha
Application launch
1) "before each" hook for "shows an initial window"
0 passing (809ms)
1 failing
1) Application launch
"before each" hook for "shows an initial window":
Error: Failed to create session.
unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /media/dna/Data D/koding/electron-example/testing-spectron/node_modules/spectron/lib/launcher.js is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
at startWebDriverSession (node_modules/webdriver/build/utils.js:45:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
之前我尝试重新安装 mocha 和 spectron,但 return 结果相同。
我的开发依赖项:
...
"devDependencies": {
"electron": "^10.1.2",
"mocha": "^8.1.3",
"spectron": "^11.1.0"
}
...
我的 os 信息:
Distributor ID: LinuxMint
Description: Linux Mint 19 Tara
Release: 19
Codename: tara
我正在使用 nodejs v12.18.4
你可以在这里克隆我的电子测试项目:electron-example
我已经将我的 electron 版本降级到 9.3.1,现在我的项目工作正常。您可以从electron-userland/spectron
中找到可以相互支持的电子和光谱版本的具体信息