Closed mastafadhil closed 1 year ago
There's a Dockerfile here: https://github.com/seleniumbase/SeleniumBase/blob/master/Dockerfile
There are a few SeleniumBase Jenkins tutorials here:
Here's a video on the SeleniumBase Jenkins integration (it's from 2016, but the main details still hold True): https://www.youtube.com/watch?v=n-sno20R9P0
Hi mdmintz, i've already looked into the links provided above and i am also already usingthe same Dockerfile to build my own image (with minor adjustments, i was able to attach my test scripts into the image), however none of the links above provides any sort of Jenkinsfile pipeline sample/example that can be used to build a pipeline in Jenkins. Is it possible that the Jenkinsfile script that I have attached above is not working, because the Dockerfile is meant to be used with Linux env (i am testing on Windows env for now)?
Thank you so much in advance and sorry for the inconvenience caused. Truly love your framework and been using it for months now.
The Dockerfile that SeleniumBase provides is for a Linux env. That shouldn't be used with a Windows env. You can simplify things by just focusing on running pytest
from a Jenkinsfile
.
Based on https://www.jenkins.io/doc/book/pipeline/jenkinsfile/ examples, here's a possible Jenkinsfile
script that assumes Python and pip
are already installed:
pipeline {
agent any
stages {
stage('Build') {
steps {
pip install -U seleniumbase
}
}
stage('Test') {
steps {
pytest --dashboard --html=report.html -s --headless
}
}
}
}
Here are some outside resources I found regarding pytest
and Jenkinsfile
:
Since you're using seleniumbase
as a pytest
plugin, the real focus should be on running pytest
from your Jenkins environments.
Hi,
I have been trying for days to try and get my jenkins pipeline to work, I was already able to execute tests via docker on my local using cmd lines, however when trying to do the same steps on jenkins it keeps on failing. Is there any way you could possibly provide an example of working jenkins pipeline script (regardless of using dockerfile to build the image or by using the docker image on dockerhub) that is able to generate reports within the docker container.
Here is what i have been working with :
node { git 'https://gitlab.com/username/repo.git'
}
thank you so much in advance.