How to integrate Jenkins with Cypress?

Reading Time: 2 minutes

In this blog, we will talk about the Integration of Cypress with Jenkins. Let’s discuss what is Jenkins? Jenkins is an open-source automation server. Similarly, it helps automate the parts of software development. Those are related to building, testing, and deploying. Also, deals with facilitating continuous integration and continuous delivery. Moreover, the main agenda will be to integrate Jenkins with cypress.

The topics to be covered here are

  1. Installing Jenkins in Ubuntu
  2. Integration of Jenkins with Cypress
  3. Continuous deployment of Cypress project using Jenkins

1. Installation of Jenkins in Ubuntu

  • Firstly, go to the terminal and add the repository key to the system.
wget -q -O – https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add –
  • When the key is added the system will return OK. Therefore, append the debin package repository address to the server’s source:list
sudo sh -c ‘echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list’
  • Run update so to apt will use the new repository
sudo apt update
  • Finally, install Jenkins and its dependencies
sudo apt install jenkins

2. Installation of Jenkins with Cypress

  • FOr instance, after Installing Jenkins we need to open Jenkins at http://localhost:8080/. Hence, here we will be able to see the Jenkins dashboard.
  • Firstly, we will create a new project from “New Item” on the left of the dashboard
  • Secondly, add a project name and select “Freestyle project”
  • Lastly, click on OK to create a project
  • After that, click on “Advanced” and add the workspace directory and name
  • Therefore, add the workspace repository and add a name. Finally, click on Apply.
  • Finally, click on Build and select “execute script”.  Hence, for executing all the test files we can add the command “npx cypress run” in the command section.
  • In addition, run the job and check the console output

References

https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-18-04

knoldus footer

Written by 

I work with Knoldus and have experience of 8+ years in quality assurance I have good experience on SeleniumWebdriver(C#), Selenium IDE, Nightwatch,Appium, Jira, TFS, ZAP, Fiddler, Jmeter, Jenkins, Selenium Webdriver. I am also ITIL certified.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading