【发布时间】:2017-04-18 13:58:13
【问题描述】:
我正在尝试运行每个组件都位于 docker 中的测试环境(nightwatchjs、浏览器、selenium 服务器)。 但现在我一直在寻找正确的“设置”。我一直得到“连接被拒绝是 Selenium 启动”。 这很奇怪,因为我以类似的方式设置了 webdriverio 并且它可以工作(从 hulilabs repo 分叉的 repo)。 https://github.com/MichalDulemba/webdriverio
有人可以帮忙吗?
如果可行,我将为其他人创建一个 gihub/docker hub repo :)
码头工人组成:
version: '2'
services:
nightwatch:
image: dulemba/nightwatch
depends_on:
- chrome
- firefox
- hub
environment:
- HUB_PORT_4444_TCP_ADDR=hub
- HUB_PORT_4444_TCP_PORT=4444
volumes:
- /home/michal/Dokumenty/nw/nightwatch/app:/app
hub:
image: selenium/hub
ports:
- 4444:4444
firefox:
image: selenium/node-firefox-debug
ports:
- 5900
environment:
- HUB_PORT_4444_TCP_ADDR=hub
- HUB_PORT_4444_TCP_PORT=4444
depends_on:
- hub
chrome:
image: selenium/node-chrome-debug
ports:
- 5900
environment:
- HUB_PORT_4444_TCP_ADDR=hub
- HUB_PORT_4444_TCP_PORT=4444
depends_on:
- hub
NIGHTWATCH.JSON
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : false,
"server_path" : "/opt/selenium/selenium-server-standalone.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "",
"webdriver.gecko.driver" : "",
"webdriver.edge.driver" : ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "firefox",
"marionette": true
}
},
"chrome" : {
"desiredCapabilities": {
"browserName": "chrome"
}
},
"edge" : {
"desiredCapabilities": {
"browserName": "MicrosoftEdge"
}
}
}
}
【问题讨论】:
标签: selenium selenium-grid nightwatch.js