How can you simply Configure Cypress on Jenkins?
MD. Abdullah Al Fahad
Software QA Engineer at DataPath Ltd. | Automation Testing | API Testing | Performance Testing | Manual Testing | Security Testing
Cypress has become one of the fast-growing modern test automation framework in the software industry. As you learn cypress you would probably come across the need to integrate your cypress tests with your CI environment. So let’s see how we can do using Jenkins.
Step 1: Add NodeJs plugin
As you know, we need Node.js to run cypress. So as the first step, we will install Nodejs in our Jenkins environment. In Jenkins, go to
Manage Jenkins > Manage Plugins > Available Plugins and search for NodeJS Plugin and add it.
Step 2: Add NodeJs Installation
After you successfully add the NodeJs Plugin, you need to add a NodeJs installation to it. To do that go to
Manage Jenkins > Global Tool Configuration and click Add NodeJS. Then,
Step 3: Create your Jenkins project
Now you need to create your Jenkins project. To keep things simple let’s create a freestyle project. In Jenkins click New Item, give a project name and select Freestyle project
I assume you have your project in git. So, In Source Code Management add your git URL and credentials for the cypress project. If you do not use git I recommend you to move to git as it’s going to help you a lot in managing your code.
领英推荐
Step 5: Add external dependencies (linux / CenOS)
If your Jenkins server OS is windows, you are all set. If not for Linux uses you need to add the following configurations
$ apt-get install libgtk2.0–0 libgtk-3–0 libnotify-dev libgconf-2–4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
If you are on centOS
$ yum install -y xorg-x11-server-Xvfb gtk2-devel gtk3-devel libnotify-devel GConf2 nss libXScrnSaver alsa-lib
Find more details on, cypress CI
Step 6: Final step — BUILD !!
Now you are all set. You just need to add your cypress command to execute your script.
Now you can build it by clicking Build Now
Let’s talk about cross-browser testing and reporting in another article.
Thank you