Docker image for running protractor tests or any Selenium based tests. Docker Repo
SELENIUM_PROMISE_MANAGER: false,
directConnect: true,
baseUrl: BASE_URL,
capabilities: {
browserName: "chrome",
chromeOptions: {
args: [ "--headless", "--no-sandbox"]
}
}
- Create a npm script to run your tests in package.json
- Either install dependencies or create a pretest script
- Note: As the volume is being attached to the image. Make sure the node modules are linux compatible.
docker run --rm -v $(pwd):/vol -w /vol amarbir22/nodejs-chrome-java /bin/bash -c 'npm run test'
As node and Java is pre-installed, You can run tests based on various frameworks such as Webdriver.IO, NightwatchJS etc. Install Selenium Server etc.
Special thanks to Jessie Frazelle for her great work on Containerization.