A comprehensive testing tool for web apps that runs in-browser tests for reliable, fast feedback.

Install

mkdir -p .claude/skills/cypress && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11703" && unzip -o skill.zip -d .claude/skills/cypress && rm skill.zip

Installs to .claude/skills/cypress

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Cypress is an end-to-end testing framework for web applications that runs tests directly in the browser for fast, reliable feedback. It provides element selection, network interception, component testing, and CI integration with parallelization and video recording.
265 chars · catalog descriptionno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Select elements using `data-testid` or `data-cy` attributes
  • Simulate user interactions like typing, clicking, and selecting
  • Intercept and stub API calls with `cy.intercept()`
  • Create reusable custom commands for common workflows
  • Mount and test components in isolation using framework-specific libraries
  • Configure CI integration with parallelization and video recording

How it works

Cypress runs tests directly in the browser, allowing for element selection, network interception, and component testing. It uses specific commands for user actions and assertions.

Inputs & outputs

You give it
Test code written with Cypress API
You get back
Automated end-to-end or component test execution results

When to use cypress

  • Write E2E tests for checkouts
  • Mock API responses
  • Automate UI user journeys
  • Integrate tests with CI/CD

About this skill

Cypress

Overview

Cypress is an end-to-end testing framework for web applications that runs tests directly in the browser for fast, reliable feedback. It provides element selection, network interception, component testing, and CI integration with parallelization and video recording.

Instructions

  • When selecting elements, use data-testid or data-cy attributes with cy.get("[data-testid='submit']") instead of CSS classes or IDs for resilient selectors.
  • When testing interactions, use cy.get().type(), .click(), .select(), and .check() for user actions, and chain .should() assertions for expected outcomes.
  • When handling API calls, use cy.intercept() to stub external APIs with fixtures or spy on requests, and cy.wait("@alias") after actions that trigger calls instead of cy.wait(ms).
  • When writing custom commands, use Cypress.Commands.add() for reusable patterns like login, database seeding, and common workflows, with TypeScript declarations for IntelliSense.
  • When testing components, use cy.mount() with framework-specific mounting libraries (@cypress/react, @cypress/vue) to test components in isolation.
  • When configuring CI, use cypress run --record --key for Cypress Cloud integration with --parallel to split tests across machines, and --browser to specify the browser.
  • When setting up the project, configure cypress.config.ts with baseUrl, viewport dimensions, timeouts, and environment variables.

Examples

Example 1: Write E2E tests for a checkout flow

User request: "Add Cypress tests for our e-commerce checkout process"

Actions:

  1. Set up test with cy.visit("/products") and select a product
  2. Intercept the cart API with cy.intercept("POST", "/api/cart") and alias it
  3. Fill in shipping form using cy.get("[data-testid='email']").type(...)
  4. Assert order confirmation with cy.url().should("include", "/confirmation")

Output: A reliable E2E test covering the full checkout flow with stubbed API responses.

Example 2: Set up component testing for React

User request: "Configure Cypress component testing for our React project"

Actions:

  1. Install @cypress/react and configure component testing in cypress.config.ts
  2. Create stories for key components using cy.mount(<Component />)
  3. Test interactions with cy.get().click() and assert DOM changes
  4. Add to CI pipeline alongside E2E tests

Output: Isolated component tests running in a real browser with full Cypress API.

Guidelines

  • Use data-testid attributes for test selectors; never rely on CSS classes, text content, or DOM structure.
  • Keep tests independent: each test should set up its own state (login, seed data).
  • Use cy.intercept() to stub external APIs; do not let tests depend on third-party service availability.
  • Add cy.wait("@alias") after actions that trigger API calls; do not use cy.wait(ms) for timing.
  • Write tests from the user's perspective: "fill in the form, click submit, see confirmation."
  • Use fixtures for large API response data; inline small responses in cy.intercept().
  • Run Cypress in CI with --record for test replay, screenshots, and video on failure.

When not to use it

  • When relying on CSS classes or IDs for element selection
  • When using `cy.wait(ms)` for timing instead of `cy.wait("@alias")`

Limitations

  • Tests run directly in the browser, limiting interaction with OS-level features
  • Element selection should use `data-testid` or `data-cy` attributes, not CSS classes or IDs
  • Tests should be independent and set up their own state

How it compares

Cypress runs tests directly in the browser with its own API for element selection and network interception, providing faster and more reliable feedback than traditional WebDriver-based testing.

Compared to similar skills

cypress side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
cypress (this skill)04moNo flagsIntermediate
e2e-testing-patterns82moNo flagsIntermediate
testing-workflow169moReviewIntermediate
perf-lighthouse135moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry