Cypress Rules
Fast, easy end-to-end testing for web applications. Write, run, and debug tests with time-travel debugging and real browsers.
3 rules
No Arbitrary Waits (cy.wait Anti-Pattern)
Beginner
Prohibit cy.wait(ms) for arbitrary delays in Cypress tests — use intercept aliases, assertions, and retry-able commands instead for reliable, fast test execution.
globs: **/*.cy.ts, **/*.cy.tsx, **/cypress/**
cy-wait, retry-ability, flaky-tests, anti-pattern
View Rule
Selector Strategy with data-cy Attributes
Beginner
Enforce data-cy attributes as the primary selector strategy for Cypress tests — decouple test selectors from CSS classes, IDs, and DOM structure for resilient tests.
globs: **/*.cy.ts, **/*.cy.tsx, **/cypress/**
selectors, data-cy, test-attributes, best-practices
View Rule
Test Independence Requirements
Intermediate
Enforce complete independence between Cypress tests — no shared state, no test order dependencies, programmatic setup via API calls, and proper cleanup between runs.
globs: **/*.cy.ts, **/*.cy.tsx, **/cypress/**
test-independence, isolation, state-management, cypress
View Rule