I can't find any valid nightwatch configuration for safari that does not include the entire Selenium jar. The nightwatch documentation says:
Using Selenium Standalone Server used to be the de-factor standard for managing the various browser drivers and services, but starting with Nightwatch 1.0 is no longer required, nor is it recommended, unless you are testing against legacy browsers, such as Internet Explorer.
Does safari count as a legacy browser? Does anyone have an example of a working nightwatch 1.x config file that can run tests against safari?
MacOS: High Sierra 10.13.6
Safari: 12.0.2
Nightwatch: v1.0.18
My current nightwatch.json which works for Chrome but not safari:
{
"src_folders": [
"__tests__/e2e/tests"
],
"output_folder": "__tests__/e2e/reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "",
"globals_path": "",
"webdriver": {
"start_process": true
},
"test_settings": {
"default": {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"chromeOptions": {
"args": [
"--window-size=1440,900"
]
}
}
},
"devChrome": {
"launch_url": "https://DEV_HOST",
"globals": {
"env": "dev"
},
"webdriver": {
"server_path": "node_modules/chromedriver/lib/chromedriver/chromedriver.exe",
"port": 9515
}
},
"devSafari": {
"launch_url": "https://DEV_HOST",
"globals": {
"env": "dev"
},
"webdriver": {
"server_path": "/usr/bin/safaridriver",
"port": 9515
}
}
}
}
Current error I am getting when I run the devSafari config: Could not start server: must specify at least one configuration argument.
Got some help from the nightwatch team on GitHub (https://github.com/nightwatchjs/nightwatch-docs/issues/94) and I now have a working example config file for Nightwatch 1.x and Safari 10+. NOTE: By "working" I mean that the browser opens and I can see Nightwatch interacting with it. The tests don't actually pass the way they do in Chrome, but most likely this is just due to small browser differences that can be resolved in the test cases themselves.
{
"src_folders": [
"__tests__/e2e/tests"
],
"output_folder": "__tests__/e2e/reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "",
"globals_path": "",
"webdriver": {
"start_process": true,
"server_path": "/usr/bin/safaridriver",
"port": 4445
},
"test_settings": {
"default": {
"desiredCapabilities": {
"browserName": "safari",
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"safari": {
"launch_url": "localhost",
"desiredCapabilities": {
"browserName":"safari"
},
"globals": {
"env": "dev"
}
}
}
}
/usr/bin/safaridriver --enable