# Cypress

> A JavaScript tool that tests web apps in a real browser. You see each step.

**Field:** Software Development  
**Category:** Testing & Quality  
**Also known as:** Cypress.io, Cypress Testing, Cypress E2E

## Think of it like

Think of it like a robot shopper you can watch. It walks through your store while you see each step.

## Definition

Cypress is a JavaScript tool for testing web apps in a real browser. It runs inside the browser, beside the app, so it sees each step as it happens. It does end-to-end tests and tests for single components. A runner window shows every step, so you can go back and see what failed. It works with Chrome-family browsers and Firefox.

## Example

Jack's Cypress test opens the shop, adds a mug and checks the cart shows 1. It runs on every pull request.

## Example code

```javascript
it("adds a mug to the cart", () => {
  cy.visit("/shop");
  cy.contains("Add to cart").click();
  cy.get("[data-cy=cart-count]").should("have.text", "1");
});
```

Visit the page, click the button, check the cart count.

## Why it matters

You can watch each step of a failing test, which makes it fast to fix.

## Common mistake

Finding elements by their look, like a CSS class. Use a test-only label, so a redesign does not break tests.

## Three principles

- **Real browser.** Runs beside the app.
- **Watch it run.** Step back through each action.
- **Stable labels.** Find elements by test labels.

## Related terms

- [End-to-End Test (E2E)](https://learn.benibix.com/term/development/end-to-end-test)
- [Playwright](https://learn.benibix.com/term/development/playwright)
- [Selenium](https://learn.benibix.com/term/development/selenium)
- [Browser Automation](https://learn.benibix.com/term/development/browser-automation)
- [JavaScript](https://learn.benibix.com/term/development/javascript)

## Told apart from

- [Playwright vs Cypress](https://learn.benibix.com/compare/playwright-vs-cypress): People think Playwright and Cypress are one tool with two names, and they are not. Cypress runs inside the browser, beside the app. Its tests are in JavaScript or TypeScript only. Playwright drives the browser from outside. It works in all three main browser engines, and it also takes Python, Java and .NET.

![A table of test tools by job. Unit tests: Jest and Vitest for JavaScript, pytest for Python, JUnit for Java. UI components: Testing Library, which finds things the way a user does. Browser end-to-end tests, lit up: Cypress, Playwright and Selenium, which drive a real browser.](https://learn.benibix.com/diagrams/dev3-test-tools.svg)

---

Source: https://learn.benibix.com/term/development/cypress
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
