Closed bes closed 5 years ago
"An environment inherits all the base settings and all the settings defined under the "default" environment." - http://nightwatchjs.org/guide/#test-environments
Feel free to make any change suggestions by submitting a PR to our docs repo: https://github.com/nightwatchjs/nightwatch-docs.
So in your case, you will need to clear the chromeOptions
for now and I think you can write your config like below:
const selenium = require('selenium-server-standalone-jar');
const chromedriver = require('chromedriver');
const geckodriver = require('geckodriver');
module.exports = {
src_folders: ['./build/dist/tests/e2e'],
output_folder: './build/reports',
custom_commands_path: './build/dist/commands',
custom_assertions_path: './build/dist/assertions',
page_objects_path: './build/dist/pages',
globals_path: './build/dist/tests/globalsModule.js',
selenium: {
start_process: true,
server_path: selenium.path,
port: 4444,
log_path: './build/reports',
cli_args: {
'webdriver.chrome.driver': chromedriver.path,
'webdriver.gecko.driver': geckodriver.path,
},
},
test_settings: {
default: {
default_path_prefix: '/wd/hub',
silent: true,
screenshots: {
enabled: true,
on_failure: true,
on_error: true,
path: './build/reports/screenshots',
},
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'window-size=1280,800',
],
},
},
launch_url: 'http://localhost:8101/'
},
firefox_tests: {
desiredCapabilities: {
browserName: 'firefox',
marionette: true,
chromeOptions: null,
'moz:firefoxOptions': {
args: [
'--headless',
],
},
}
}
}
};
This issue has been automatically marked as stale because it has not had any recent activity. If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.
Hi,
I am running nightwatch 1.0.18 and if I have
chromeOptions
in thedefault
test_settings
, it always starts chrome, even if I start it using e.g.-e firefox_tests
P.S: The documentation is really not clear on how different sections in nightwatch.conf.js are merged - maybe I am overspecifying different blocks because of that. If there is something I can improve please let me know =)
Similar to https://github.com/nightwatchjs/nightwatch/issues/1737
BR Erik