Automation testing through Cypress

Raghwendra Sonu
2 min readJun 20, 2023

--

Why JavaScript framework?

JavaScript automation frameworks come with the necessary tools and capabilities to automate web application testing- efficiently, ensuring higher quality, faster development cycles, and improved user experience.

Why Cypress?

Cypress is one of those popular tools which has established its place very quickly. Cypress has gained popularity due to its developer-friendly approach, fast execution, and robust features. It aims to provide an enjoyable and productive testing experience for web developers and testers, making it an appealing choice for automating modern web applications.

How does Cypress work?

Cypress works by running directly in the browser. It usages proxy to communicate with browser.

What makes Cypress a unique tool?

This is a all-in-one testing framework. It has got most of plugins developed and maintained in-house. So, no need to download and rely on third party libraries. Also, since Cypress run directly in the browser it is very fast compared to Selenium. And last but not the least it usages Java Script language for writing code which is first choice for JS developers. So it is suitable for both Dev & Testing folks.

Now Let’s see it’s setup:

We can get Cypress ready to work by using Node js NPM and VS code IDE.

Node JS installation: https://nodejs.org/en/download

VS Code IDE : https://code.visualstudio.com/download

Once VS Code is installed, goto terminal and run

npm init -y

command to create package.json and folder structure. In Cypress, the package.json file is a configuration file that resides in the root directory of your Cypress project. It is a standard file used in Node.js projects to define metadata and dependencies for the project.

After this run

npm install cypress@latest

this command will download & install latest version of Cypress on your machine. There are four major default folders will be created when you install Cypress.

  1. Fixture
  2. Integration
  3. Plugins and
  4. Support

Once Cypress is installed you can verify if all the setup is fine using below command:

npx cypress verify

Cypress has got a list of inbuilt commands that can be used to write tests.

Later you can integrate Cypress with Cucumber for BDD style test development and Allure reports for fancy reports generation.

In a nutshell:

Cypress automation is easy to write and execute as compared to Selenium.

This article contains only the introduction and some quick steps for getting started.

Cypress Automation framework is available here , have a look and feel free to clone it for practicing.

raghwendra-sonu/cypress-cucumber-allure: cypress-cucumber-allure-automation-frameowrkfor-e2e-testing (github.com)

--

--

Raghwendra Sonu

Software Automation Testing expert with 9 years of work experience in diverse tools and technologies.