Cypress is an open-source javascript-based testing tool. In a nutshell, Cypress is a next-generation front end testing tool built for the modern web. Cypress comes fully baked, batteries included. Here is a list of things it can do:
- Cypress takes snapshots as your tests run, so you can see exactly what happened at each step.
- You can directly debug from the Browsers Developer tools.
- Cypress automatically waits for commands and assertions before moving on.
- You can verify and control the behavior of functions, server responses, or timers, which are useful in writing Unit Tests.
- You can mock, manipulate, and test network traffic without involving your server.
- Screenshots are taken automatically on failure, and videos of your entire test suite are automatically recorded when run from the CLI.
- You can run your tests on multiple browsers.
Over the past few weeks, I have been playing around with cypress, and it has been an enriching experience. I have been doing Automation for a few years now, but working with cypress has been a different experience altogether, mostly because of its intuitive commands and test debugging features. So, based on my learnings and experience, I have written a few blogs explaining the different features and capabilities of cypress. Every blog includes a working example (a test script automating a scenario) with a detailed explanation. Also, don’t forget to check out the Github repo if you want to skip to the good part 🙂
Cypress 10 Upgrade
In this article, I will discuss in detail how I upgraded my current project to cypress 10. I would...
How to handle basic auth in Cypress
In this article, we will look in detail at how we can handle basic auth in cypress. Let's see the...
How to do recursion in Cypress
In this article, we will look in detail at how we can implement recursion in cypress. Let's...
Commonly used JQuery commands in Cypress
In this article, we will be discussing in detail some of the most commonly used JQuery commands in...
How to use filter(), find() and within() commands in cypress
In this article, we will discuss in detail how we can find DOM elements using filter(), find(),...
How to handle new browser Tab and Window in Cypress
In this article, we will discuss in detail how we can handle new browser windows and tabs in...
How to perform Drag and Drop on HTML and Angular sites with Cypress
In this article, we will discuss in detail how we can perform drag and drop operations on HTML and...
How to use parents(), parent() and children() commands in cypress
In this article, we will discuss in detail how we can traverse DOM elements using parents(),...
How to perform Database Testing (SQL) in Cypress
In this article, we will explore in detail how we can perform common database actions on any SQL...
How to hover over elements in Cypress
Cypress doesn't provide any native commands like cy.hover() to hover over elements, instead it...
How to use Cypress with Cucumber BDD (Cypress 10 Upgrade)
Cucumber is a tool that supports Behaviour-Driven Development (BDD). Cucumber reads executable...
How to mock an API response using cy.intercept()
Mocking APIs helps in situations where we only have the front-end of the application or we are...
How to visually generate tests using Cypress Studio(Cypress 10 alternative)
Cypress Studio provides a visual way to generate tests within the Test Runner, by recording...
Cypress Dashboard
The Dashboard is a Cypress service that gives you access to recorded tests. The Dashboard provides...
Cypress Page Object with Locator Functions and Custom Commands
Page Object Model is a design pattern that focuses on making a Test Automation Framework...
How to apply Tags to your Cypress Tests like Smoke, E2E
Cypress as of today (v 9.2.1) doesn't provide any support for tagging tests. But fortunately due...
How to generate Html Reports in Cypress
To generate HTML reports in cypress we would be using Mochawesome in combination with...
How to test iframes with cypress
Cypress cannot directly interact with iframes because of its architecture, hence it doesn't...
Test Retries in Cypress
Test Retries is one of the most interesting features in cypress. Once test retries are enabled,...
How to handle Shadow DOM in Cypress
With version 5.2.0 cypress officially started supporting shadow dom. You have to use the command...
How to execute tests in order in cypress(update for cypress 10)
Using the cypress configuration we can execute cypress tests in a sequence we desire. Simply write...
Using skip and only in cypress
Skip and only comes from the Mocha framework in cypress. As the name suggests skip skips the tests...
How to handle Javascript Alert, Confirm & Prompt in Cypress
In this article, we will discuss how we can handle Javascript Alert, Javascript Confirm, and...
Mock API Response in Cypress using cy.server() and cy.route()
Mocking APIs helps in situations where we only have the front-end of the application or we are...
How to chain multiple API’s in Cypress
While doing API testing there are test scenarios that require you to chain multiple APIs in order...
API Testing in Cypress
In this article, we will discuss how we can perform API testing using cypress. To further deep...
How to download a file in cypress
In this article, we will discuss how we can download a file in cypress using the...
How to upload a file in cypress
In this article, we will discuss how we can upload a file in cypress. Method 1: Using the...
Conditional Testing (If-Else) in Cypress
Conditional testing refers to the common programming pattern: If X, then Y, else Z. Lets automate...
How to Interact with Multiple Elements using each()
Each is used to interact with multiple elements. It is used to iterate through an array-like...