PROVIDER Β· the developer-friendly E2E testing tool
Cypress
Cypress runs E2E tests inside the browser where an interactive runner with time travel and auto waiting localise failures fastest, and network stubbing with component testing lets frontend teams own validation.
Pros
Cons
Product Information
Detailed Notes
Overview
Cypress arrived in 2017 differing from Selenium-family tools by running inside the browser, where test code shares the runtime with the app to access DOM, network requests, and application state directly, backed by time-travel debugging and automatic waiting.
For Programming Languages & Frameworks work the value is frontend teams owning E2E, since the interactive Test Runner snapshots every step for fast failure localisation, cy.intercept stubs and asserts network calls without a real backend, and component testing mode covers frontend components in isolation.
Recognise the limits, because only Chromium browsers and Firefox are supported with Safari needing commercial WebKit support, cross-origin, multi-tab, and multi-origin scenarios are constrained, only JS and TS are allowed, and cloud parallelism needs paid Cypress Cloud with self-hosted CI parallelism fiddly.
Core Strengths
- An interactive runner with time travel for fast failure localisation
- Automatic waiting removing explicit sleeps
- cy.intercept stubs network calls decoupling tests from backends
- Component testing sharing one toolchain with unit tests
Product Ecosystem
Core API
cy.visit, cy.get, cy.intercept, cy.request, and custom commands.
Debugging and running
The interactive runner with video and screenshots plus open and run modes.
Integration
Component testing for React and Vue, CI via GitHub Actions, and Cypress Cloud parallelism.
Drawbacks
- Only Chromium and Firefox with Safari and WebKit constrained
- Weak support for cross-origin, multi-tab, and multi-origin flows
- Tests must be written in JavaScript or TypeScript
- Parallelism needs paid Cypress Cloud or costly self-hosting
Use Cases
- Critical frontend flow E2E (β β β β β ) - Best debugging
- Component integration tests (β β β β β ) - Component mode
- Full multi-browser coverage (β β β ) - Playwright is broader
- Real mobile device testing (β β ) - Needs dedicated tools
Pricing
| Plan | Price | Scope |
|---|---|---|
| Cypress open source | $0 | MIT licensed, free |
| Cypress Cloud free | $0 | Limited test recordings monthly |
| Cypress Cloud Team | From about USD 67 monthly | Parallelism and history |
The open-source edition is free and sufficient locally and for small CI, while parallelism and history need Cypress Cloud from about USD 67 monthly, where Playwright's free parallelism often pays better for multi-browser needs.
FAQ
-
Cypress or Playwright? Cypress for debugging experience and self-service frontend testing, Playwright for multi-browser, multi-tab, and free parallelism.
-
Can it test Safari? Only through commercial WebKit support, so Playwright covers WebKit more practically.
-
How long does it take? Ten to twenty critical flow cases typically take one to two person-weeks with UI changes driving maintenance.
Code Examples
Stub the API and assert the list
describe('data center list', () => {
it('renders data center cards', () => {
cy.intercept('GET', '/api/plans', { body: [{ id: 1, name: 'Hong Kong VPS' }] });
cy.visit('/');
cy.get('[data-testid="plan-card"]')
.should('have.length.greaterThan', 0)
.first().should('contain.text', 'Hong Kong');
});
});
cy.intercept decouples frontend tests from a real backend and is key to removing flakiness.
Component testing
import { mount } from 'cypress/react18';
import PlanCard from './PlanCard';
it('shows the price', () => {
mount(<PlanCard name="Hong Kong VPS" price={99} />);
cy.contains('99');
});
Community & Resources
Communities and official channels
- Cypress Docs β Concepts, API, and best practice
- GitHub cypress-io/cypress β Source, issues, and releases
- Stack Overflow #cypress β Selector and flakiness answers
Learning resources and tools
- Kitchen Sink Examples β Official examples covering every API
- Cypress Testing Library β Query elements as users see them
- Real World App β Full-stack reference application