
Table of Contents
What is cypress Used For ?
Cypress Automation Tool is a UI Automation tool used for automating web applications that run in browser. Its an open source and locally installed tool for with lot of salient features.
- ScreenShots – Takes Screenshots for all steps either passed or failed.
- In-built Waits – Cypress automatically waits for commands and assertions there is no need for any implicit and explicit waits.
It helps automating different kind of testing as follows :-
- Unit Tests
- Component Tests
- Acceptance Tests
- E2E Tests
- Regression Tests
Cypress Architecture Explained

Cypress Architecture works on the concept of client-server architecture. Here Client(Browser) and Server(Node.js) interact with each other via HTTP Requests and HTTP responses executing the cypress command with the help of a proxy server and reacting with DOM elements within the browser tp perform desired flows for given web application.
Cypress vs Selenium: Key Differences
Traits | Cypress | Selenium |
Tech Stack | JavaScript & TypeScript | Multiple languages (Java, Python, C# etc.) |
Browsers | Chrome, Edge, Firefox, Electron | Chrome, IE, Safari,Edge,Firefox,Opera |
Frameworks | Supports only Mocha JS and Chai JS | Supports multiple framweorks depending on which language is used |
Setup | Setup is wasy with multiple options including command line options | Setup is required as external dependencies are required to run |
Installing Cypress
Pre – Requsites
There are multiple ways in which cypress can be installed
Installation via Command Line
npm init
# Provide Package Name
#Provide rest of the mandatory details
npm install
cd /your/project/path
npm install cypress --save-dev
Cypress via a build file(package.json)
In most of the Enterprise testing setup cypress is installed at run time via a build file. Here and in our framework we will discuss the 3rd option for installation.
Package.JSON will act as a build file and dependency manager. It manages all the dependencies for building the project and all build scripts with different options.
Understanding package.json
in Cypress Projects
- Name – Name of you Project
- Dependencies & Dev Dependencies – dependencies and corresponding version.
- Scripts – Build and Different Run configuration
cypress run [options]
We have multiple options to choose from. Below table shows the most important ones you are using.
Option | Description |
--browser , -b | Run Cypress in the browser with the given name. |
–e2e | Run end to end tests(default) |
--env , -e | Specify Environment variables |
--headless | Hide the browser instead of running headed(default cypress run) |
--record | Whether to record the test run |
--tag , -t | Identify a run with a tag or tags |
Running Cypress Tests
Cypress gets install usually inside ./node_modules/bin/cypress
cd to bin
cypress open
Leave a Reply