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.
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
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.
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.
Hi Ankur, Hope you are doing good.
ReplyCan I have your mail id/contact num please.
Am looking for Cypress course to learn.
Thanks,
Sowjanya.