【发布时间】:2018-03-01 04:03:33
【问题描述】:
我已经基于Nightwatch.js 使用Nightwatch-Cucumber 创建了自动化测试。我可以在本地机器上启动测试,Selenium server 在本地机器上启动并执行测试。
但现在我想将现有测试集成到 Kubernetes 环境中。在本地机器上,我想使用minikube、helm、jenkins chart 来启动测试和selenium chart。但是这种设置与本地设置不同。我想在Jenkins 实例上开始测试,并且应该针对selenium chart 提供的正在运行的Selenium server 执行测试。所以我想用这样一个“远程”Selenium server。我不想使用在运行时启动的本地 Selenium server,但在 Kubernetes 环境中的某处仍然存在 Selenium server
但是如何配置我的nightwatch.conf.js 配置来实现那个场景呢?
我当前的配置如下:
const config = {
output_folder: "reports",
custom_commands_path: "commands",
// custom_assertions_path: 'assertions',
live_output: false,
page_objects_path: "pageobjects",
disable_colors: false,
selenium: {
start_process: true,
server_path: seleniumServer.path,
log_path: "",
host: "127.0.0.1",
port: 4444
},
test_settings: {
default: {
globals: {
waitForConditionTimeout: 30000,
waitForConditionPollInterval: 500
},
screenshots: {
enabled: true,
on_failure: true,
path: "screenshots"
},
//launch_url: "http://localhost:8087",
//selenium_port: 4444,
//selenium_host: "127.0.0.1",
desiredCapabilities: {
browserName: "phantomjs",
javascriptEnabled: true,
acceptSslCerts: true,
"phantomjs.binary.path": phantomjs.path
}
},
【问题讨论】:
标签: node.js selenium jenkins kubernetes nightwatch.js