Forem

Cover image for Jenkins & GitHub Integration with Selenium Python
Dilpreet Johal
Dilpreet Johal

Posted on

5 2

Jenkins & GitHub Integration with Selenium Python

In this post, we will finalize everything by running our tests in Jenkins. We will cover Jenkins & GitHub Integration with the Selenium Python tests as well as generate a JUnit report at the end to see the results in Jenkins.

Pre-requisite

Make sure you have Jenkins installed in your local machine so that you can follow along with the rest of the steps. You can watch the Jenkins Installation video below that I made for the WebdriverIO tutorial series to see how to do that –


Push changes to GitHub

Once you have Jenkins installed, the next thing you will need to do is push all the code changes to your GitHub repository. But, before that, make sure to create a requirements.txt file to store all your packages details –

pip freeze > requirements.txt

This will create a new file listing all the packages that you were using in the virtual environment.

Now, you can push all the changes to GitHub.


Jenkins Integration

To make Jenkins work with the Python environment, you will need to install the ShiningPanda plugin. Then, create a new job in Jenkins, and in the build step, select Custom Python Builder and add the following steps –

code

The above script will create a virtual environment and install all the necessary packages for you. Once packages are installed we are triggering our tests using the pytest command.


Check out the video below to learn more about generating reports using the SeleniumBase framework –


📧 Subscribe to my mailing list to get access to more content like this

👍 Follow automationbro on Twitter for the latest updates

...

I love coffees! And, if this post helped you out and you would like to support my work, you can do that by clicking on the button below and buying me a cup of coffee -

Buy me a coffee

You can also support me by liking and sharing this content.

Thanks for reading!

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay