Cypress Tutorial : A Brief Introduction to Cypress


Cypress Tutorial : A Brief Introduction to Cypress



In this article, we will be having an introduction of Cypress.io and how to set this up and creating our first test in cypress.

Introduction to Cypress.io

Cypress.io is an open-source test automation tool built for modern web applications. It is fast, easy and reliable testing for anything that runs in a browser.

The most important part of it, it doesn’t build on Selenium WebDriver.
Cypress.io is NOT Selenium and hence there is a new architecture been built
from the ground up.
It has an all-in-one package leaving no extra efforts to be spent for Test Automation framework design. Cypress.io is very fast and hence it is majorly used by Developers than QA Engineers to perform unit testing.


Cypress tests are implemented on Mocha and Chai so its syntax is very much similar to Java Script which uses test in describe() and it() blocks.

There are few pre-requisites for installation of cypress.io

1. NodeJS
2. Node Package Manager (NPM)
3. IDE – Visual Studio Code.
4. Terminal / Windows Command Prompt

Getting Started with cypress.io

There are 2 ways in which cypress.io can be installed

1)   Running via Executable

   Please Click on this link and select download now option to install cypress
   on your machine.




2)   Installation via NPM

We will be doing installation via second way

1)     Open Command prompt in Windows or Terminal in MAC.

2)     Create a new project called, FirstCypressProject.


3)     Initiated the project via NPM module and provide the necessary project details.

4)     Install Cypress.io



5)     Navigate to ./bin folder under ./node_modules and open the Cypress.io



6)     After the Cypress.io server will be open It will ask us to create a sample project. Click on OK to create the sample project.

This sample project will already have several tests already written in Cypress.io.


7)     We can open these sample tests in our IDE or notepad.


8)     If we make any changes or simply save this it will automatically open a new chrome the browser and will get executed.



Test will be getting executed very fast as Cypress.io does not wait to recompile the code again. All Test results will be displayed on the left side of the screen.





SHARE THIS

Author:

My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post
Sowjanya
November 18, 2019 at 3:51 PM

Hi Ankur, Hope you are doing good.
Can I have your mail id/contact num please.
Am looking for Cypress course to learn.

Thanks,
Sowjanya.

Reply
avatar