【发布时间】:2017-04-21 13:52:10
【问题描述】:
我正在使用 nightwatch 在 Chrome 和 Firefox 上运行测试。
在 Chrome 上,一切都像魅力一样。我在我们的服务器上成功地在 Firefox 上运行了测试,但我的机器上出现了问题。
目前,由于 Marionette 不是很稳定,我们正在使用 Firefox ESR 测试我们的软件,该软件无需任何驱动程序即可获得 selenium 的支持。
在我的 linux 机器上,我安装了 Firefox(最新)和 Firefox(扩展支持版本)。
- Firefox 可在
/usr/bin/firefox中访问 - Firefox ESR 在
/usr/bin/firefox-es
使用量角器,我可以使用名为 firefox_path 的魔法属性指定要触发的可执行文件。
但我还没有找到如何让nightwatch使用/usr/bin/firefox-esr
有什么想法吗?
我的配置,如果你有兴趣:
const seleniumPath = /*computed value*/;
module.exports = {
"src_folders": ["test/e2e"],
"output_folder": "reports/e2e",
"detailed_output": false,
"selenium": {
"start_process": true,
"server_path": seleniumPath,
"log_path": "",
"host": "127.0.0.1",
"port": 4444,
"cli_args": {},
},
"test_settings": {
"default": {
"launch_url": launchUrl,
"exclude": ["utils/**/*", "gulpfile.js", "nightwatch*.js"],
"selenium_port": 4444,
"selenium_host": "localhost",
"silent": true,
"screenshots": {
"enabled": true,
"path": "reports/e2e/screenshots",
},
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true,
},
},
"test_runner": {
"type": "mocha",
"options": {
"ui": "bdd",
"reporter": "spec",
},
},
}
【问题讨论】:
-
你可以将
selenium.start_process设置为true,然后让守夜人来决定如何运行。
标签: javascript selenium firefox nightwatch.js