install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/TerminalSkills/skills/cypress" ~/.claude/skills/comeonoliver-skillshub-cypress && rm -rf "$T"
manifest:
skills/TerminalSkills/skills/cypress/SKILL.mdsource content
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
ordata-testid
attributes withdata-cy
instead of CSS classes or IDs for resilient selectors.cy.get("[data-testid='submit']") - When testing interactions, use
,cy.get().type()
,.click()
, and.select()
for user actions, and chain.check()
assertions for expected outcomes..should() - When handling API calls, use
to stub external APIs with fixtures or spy on requests, andcy.intercept()
after actions that trigger calls instead ofcy.wait("@alias")
.cy.wait(ms) - When writing custom commands, use
for reusable patterns like login, database seeding, and common workflows, with TypeScript declarations for IntelliSense.Cypress.Commands.add() - When testing components, use
with framework-specific mounting libraries (cy.mount()
,@cypress/react
) to test components in isolation.@cypress/vue - When configuring CI, use
for Cypress Cloud integration withcypress run --record --key
to split tests across machines, and--parallel
to specify the browser.--browser - When setting up the project, configure
withcypress.config.ts
, viewport dimensions, timeouts, and environment variables.baseUrl
Examples
Example 1: Write E2E tests for a checkout flow
User request: "Add Cypress tests for our e-commerce checkout process"
Actions:
- Set up test with
and select a productcy.visit("/products") - Intercept the cart API with
and alias itcy.intercept("POST", "/api/cart") - Fill in shipping form using
cy.get("[data-testid='email']").type(...) - 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:
- Install
and configure component testing in@cypress/reactcypress.config.ts - Create stories for key components using
cy.mount(<Component />) - Test interactions with
and assert DOM changescy.get().click() - Add to CI pipeline alongside E2E tests
Output: Isolated component tests running in a real browser with full Cypress API.
Guidelines
- Use
attributes for test selectors; never rely on CSS classes, text content, or DOM structure.data-testid - Keep tests independent: each test should set up its own state (login, seed data).
- Use
to stub external APIs; do not let tests depend on third-party service availability.cy.intercept() - Add
after actions that trigger API calls; do not usecy.wait("@alias")
for timing.cy.wait(ms) - 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
for test replay, screenshots, and video on failure.--record