Create the Pipeline and Run the Tests
Learn how to create the pipeline and execute the Selenium tests using Docker containers.
The pipeline that runs the Selenium tests in a Docker container relies on the Dockerfile
from the root
project folder:
FROM selenium/node-chromeCOPY . .USER rootRUN apt-get updateRUN apt-get install maven -yRUN apt-get install openjdk-8-jdk -yENTRYPOINT ["bash", "command.sh"]
Add the above
Dockerfile
to the root of your project repository.
The Docker pipeline
The Docker pipeline YAML code is below:
trigger:- masterpool:vmImage: 'ubuntu-latest'steps:- task: Bash@3displayName: 'Create Java Test Image'inputs:targetType: inlinescript: 'docker build -t seleniumtests .'- task: Bash@3displayName: 'Run Java Test Container'inputs:targetType: inlinescript: 'docker run -e "BROWSER=chrome" --name tests seleniumtests'
The pipeline has only two tasks, one for building the Docker image and ...