Docker image for autumated testing with Chrome and NodeJS.
docker pull zhangyuan/docker-chromedriver-node821
NVM is not actived by default, load it by running the following command:
export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
In order to run tests with Chrome, use xvfb-run
to run your own command. For example:
xvfb-run npm run test
If you are using selenium-webdriver
, be sure to pass --headless
and --no-sandbox
to driver:
const webdriver = require('selenium-webdriver')
const chrome = require('selenium-webdriver/chrome')
const options = new chrome.Options()
options.addArguments(["--headless", "--window-size=1200,600", "--no-sandbox", "--disable-gpu"])
var driver = new webdriver.Builder()
.forBrowser('chrome')
.setChromeOptions(options)
.build()