我尝试不使用硒来运行Nightwatch,所以我尝试使用Drivers运行Nightwatch,但是在这种情况下,我需要2个终端窗口。一个用于启动驱动程序,一个用于运行Nightwatch。
所以可以帮助在一个终端中打开Nightwatch中Driver的子进程进行测试的方法。
这是我的nightwatch.json代码:
{
"src_folders": [
"./tests"
],
"output_folder": "./reports",
"custom_commands_path": "./custom_commands",
"custom_assertions_path": "",
"globals_path": "",
"live_output": false,
"parallel_process_delay": 10,
"disable_colors": false,
"test_workers": false,
"test_settings": {
"default": {
"webdriver": {
"launch_url" : "127.0.0.1",
"start_process": true,
"server_path": "./node_modules/.bin/chromedriver",
"port":9515
},
"selenium_port": 9515,
"selenium_host": "localhost",
"default_path_prefix": "",
"desiredCapabilities": {
"browserName": "chrome",
"loggingPrefs": {
"driver": "INFO",
"server": "OFF",
"browser": "INFO"
},
"chromeOptions": {
"args": [
"headless",
"no-sandbox",
"disable-gpu"
]
}
}
}
}
}