CI script:
- npm install
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- apt install -y ./google-chrome-stable_current_amd64.deb
- apt-get install -y default-jdk
- npm run test:e2e:headless
package.json :
test:e2e:headless : "vue-cli-service test:e2e --config ./tests/e2e/main-test/nightwatch.conf.js --env chromeHeadless "
“dependencies”: {
“chromedriver”: “2.46.0”,
“selenium-server”: “3.9.0”
}
nightwatch config :
selenium: {
start_process: true,
server_path: require('selenium-server').path,
port: 4449,
cli_args: {
'webdriver.chrome.driver': require('chromedriver').path
}
},
test_settings: {
default: {
selenium_port: 4449,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL: 'http://localhost:' + config.devServer.port
}
},
chromeHeadless: {
desiredCapabilities: {
browserName: 'chromeHeadless',
javascriptEnabled: true,
acceptSslCerts: true,
chromeOptions: {
args: [
'headless',
'disable-gpu',
'no-sandbox'
]
}
}
}