This project demonstrates the usage of selenium-webdriver, cucumberjs in a Node.js project with Docker and Jenkins CI
├── cucumber.js
├── package-lock.json
└── package.json
└── README.md
- Scenarios are defined in .feature files, which are stored in the features directory
- Step definitions are defined in .js files which are stored in the step_definitions directory
- Reports in,
- html format is stored in cucumber-report.html
- json format is stored in cucumber-report.json
- package.json holds important information about the project. It contains human-readable metadata about the project (like the project name and description) as well as functional metadata like the package version number and a list of dependencies required by the application
- README.md file to communicate important information about Selenium WebDriver, CucumberJS example project
- Dockerfile informs Docker what base image we would like to use for the Node.js application project
- Jenkinsfile is a text file that contains the definition of a Jenkins Pipeline and is checked into source control
Install dependencies
npm install
Run standalone
npx cucumber-js
docker build command with --target install flag so that we specifically run the install build stage
docker build -t selenium-webdriver-cucumber-js-example-project-install --target install .
Docker command to start the container and run install
docker run --rm -v ${PWD}:/usr/src/app/ --name selenium-webdriver-cucumber-js-example-project-install selenium-webdriver-cucumber-js-example-project-install
docker build command with --target test flag so that we specifically run the test build stage
docker build -t selenium-webdriver-cucumber-js-example-project-test --target test .
Docker command to start the container and run test
docker run --rm -v ${PWD}:/usr/src/app/ --name selenium-webdriver-cucumber-js-example-project-test selenium-webdriver-cucumber-js-example-project-test