我能够在当前设置上成功地在 chrome 上运行测试,但是我无法将其他浏览器添加到我的测试中。我正在使用 grunt 模块“grunt-protractor-runner”来运行我的 e2e 测试。
环顾四周,我知道 grunt-protractor-runner 模块确实支持 multiCapabilities,所以从表面上看,我希望编辑目标配置文件以包含 multiCapabilities 并将 chromeOnly 更新为 false 的简单任务。
尽管我可以通过 multiCapabilities,但我无法将 chromeOnly 选项更改为“false”并让我的测试成功运行。将 Firefox 和 Chrome 传递给 multiCapabilities 时出现的错误,
运行 2 个 WebDriver [launcher] 运行程序进程退出,错误代码:8
------------------------------------
PID: 7812 (capability: chrome #1)
------------------------------------
Using the selenium server at http://localhost:4444/wd/hub
C:\Project\node_modules\protractor\node_modules\selenium- webdriver\lib\webdriver\promise.js:1702
throw error;
^
------------------------------------
PID: 6444 (capability: firefox #1)
------------------------------------
Using the selenium server at http://localhost:4444/wd/hub
C:\Project\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1702
throw error;
^
我在 Windows 7 上运行我的设置,使用 grunt-protractor-runner 1.0.1、protractor 0.23.1、chromedriver 2.9 和 selenium-server-standalone 2.41.0