Unable to run nightwatch tests on chrome.
Below is the modified nightwatch.json that I downloaded from nightwatch example:
{
"src_folders" : ["./examples/tests"],
"output_folder" : "./examples/reports",
"custom_commands_path" : "./examples/custom-commands",
"custom_assertions_path" : "",
"globals_path" : "./examples/globals.json",
"live_output" : false,
"selenium" : {
"start_process" : false,
"server_path" : "/lib/sel-serv.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "/lib/chromedriver/chromedriver.exe",
"webdriver.ie.driver" : "",
"webdriver.firefox.profile" : ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_host" : "127.0.0.1",
"selenium_port" : 4444,
"silent" : true,
"disable_colors": false,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"chrome":{
"desiredCapabilities" : {
"browserName" : "chrome",
"javascriptEnabled" : true,
"acceptSslCerts" : true
}
}
},
"desiredCapabilities": {
"name" : "test-example",
"browserName": "chrome"
},
"globals" : {
"myGlobal" : "some_sauce_global"
},
"selenium" : {
"start_process" : false
}
}
}
The error I get is this:
ERROR There was an error while starting the test runner:
Error: Invalid testing environment specified: chrome
at Object.CliRunner.parseTestSettings (/usr/local/lib/node_modules/nightwatch/lib/runner/cli/clirunner.js:448:15)
at Object.CliRunner.init (/usr/local/lib/node_modules/nightwatch/lib/runner/cli/clirunner.js:49:8)
at module.exports.runner.runner (/usr/local/lib/node_modules/nightwatch/lib/index.js:546:17)
at /usr/local/lib/node_modules/nightwatch/bin/runner.js:9:16
at module.exports.cli.cli (/usr/local/lib/node_modules/nightwatch/lib/index.js:504:5)
at Object.<anonymous> (/usr/local/lib/node_modules/nightwatch/bin/runner.js:8:14)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
I also found an older post which says you have to create new file in root directory so give it a try and nothing happened