Skip to content

Instantly share code, notes, and snippets.

@gdomiciano
Created June 20, 2018 08:22
Show Gist options
  • Save gdomiciano/0afdb4c58cfa766cac2d4eb076ba6ea8 to your computer and use it in GitHub Desktop.
Save gdomiciano/0afdb4c58cfa766cac2d4eb076ba6ea8 to your computer and use it in GitHub Desktop.
Nightwatch configuration headless without selenium
const SCREENSHOT_PATH = 'test/integration/screenshots/';
const BINPATH = 'test/integration/libs';
const TIME_OUT = process.env.NODE_ENV !== 'testing' ? 2000 : false;
const CHROME = process.env.NODE_ENV !== 'testing' ? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' : '/usr/bin/google-chrome';
module.exports = {
src_folders: ['test/integration/specs'],
output_folder: 'test/integration/reports',
selenium: {
start_process: false,
port: 4444,
cli_args: {
'webdriver.chrome.driver': `${BINPATH}/chromedriver/chromedriver`,
},
},
test_settings: {
default: {
launch_url: 'localhost:3000',
selenium_port: '9515',
selenium_host: 'localhost',
silent: true,
screenshots: {
enabled: true,
path: SCREENSHOT_PATH,
on_failure: true,
},
globals: {
Timeout: TIME_OUT,
urls: {
Home: 'http://localhost:3000',
RubyConf: 'http://localhost:3000/ruby-conf',
},
input: {
simpleName: 'Geisy',
completeName: 'Geiseany Domiciano',
specialCharName: 'João José da Silva',
numbers: '123456',
}
},
desiredCapabilities: {
browserName: 'chrome',
acceptSslCerts: true,
chromeOptions: {
args: [
'--headless',
'--no-sandbox',
'--window-size=360, 640',
],
binary: CHROME,
},
},
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
},
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment