Sunday, April 19, 2020

Cypress: How cypress can be installed in our windows machine

In our previous post, we have discussed various features of our latest automation tool cypress.
Installation of cypress is easier than any other automation tools. We can install it through npm. 
It is a desktop application and it can run Windows, macOS, and Linux.

In my case, I am using windows OS.

Here I will show you a step by step process to install cypress.

Step 1: 
Create a folder on your drive with any name. Here I make a folder in my D:\Development\ directory named ‘cypress-test’.

Step 2: 
Now open your command prompt window or windows PowerShell editor and run the following command to install cypress globally. 
Note that you can install cypress globally or dev dependency. 

To install cypress globally run the following command.
npm install cypress -g

To install cypress locally you have to move to the directory where you want to develop the cypress script.

In my case, I just move to the directory D:\Development\ named\cypress-test’
The command is,



Run the following command to initiate a package.json file.



Now run the npm command to install cypress.



Now Cypress will start to install.



Note that I am installing cypress version 4.4.0.
This is the latest version when I am writing my post.



Now cypress has successfully installed and we are ready to write our first cypress test.
If you go to the cypress-test folder you see the following folder and files.

 

In the next post I will show how we can make our cypress project and write a test script and execute.

Saturday, April 18, 2020

Cypress: An open-source front end tool for an end to end testing

Nowadays end to end test is becoming popular and tester are very much fond of these tools. 
In that case, Cypress is one step ahead due to its first execution of the test script. Scripts are written in 
javascript and no runtime server needed. 

It is an open-source and developer-friendly tool and builds from scratch and no selenium dependency.

According to cypress, it has the following features that make it different from other tools. 
  • For every step, it takes a screenshot. When you hover it shows a recorded screenshot.
  • It can automatically rerun when any changes happen in the script.
  • It has spies, stubs, and clocks like unit tests.
  • Since it does not use any selenium or web driver, tests result are consistent, reliable and flake-free.
  • Debugging is user friendly.
  • No waits needed. It can automatically start and stops when needed.
  • Network Trafic can be stubbed when needed.
  • Screenshot can be taken automatically when scripts fail. Also, video can be recorded for the whole steps.

In my next post, I show how cypress can be installed and a simple test can be run. 

Welcome to the Cypress world!

Cypress: How to handle browser-based authentication pop up dialog in Cypress

Five years ago I have written a blog on how to handle browser-based authentication for selenium webdriver.   Now it is for cypress. Cypress...