Running Gwen in Jenkins
Then it's just a matter of calling
docker-compose run gwen in your Jenkins job or pipeline. Everything including a Selenoid browser environment and Gwen itself (and all it's dependencies) will then get spinned up and run.
To run your Gwen project in a Jenkins pipeline:
- Create a
Jenkinsfilefile in the root of your Gwen project.
/project # Your project root
└── Jenkinsfile # Jenkins pipeline script file
- Save the following content into the file.
// an agent with docker installed
sh 'mkdir -p gwen/output'
// Spin up environment and execute Gwen in docker
sh "docker-compose run gwen"
sh "docker-compose down"
archiveArtifacts artifacts: 'gwen/output/reports/**'
allowMissing : false,
keepAll : true,
reportDir : "gwen/output/reports/html",
reportFiles : 'index.html',
reportName : "Gwen-Report"
Push or commit your project to a Git repostitory
Create a new pipeline job in Jenkins and perform the following in the Pipeline configuration section:
- Checkout your Gwen project from Git
- Specify the
Jenkinsfileabove as the script
- Save the job
Schedule or run the job in Jenkins
- Evaluation reports will be generated and published to each job execution (Gwen-Report links)