0xdarkmatter/claude-mods/cypress-ops
Claude Code and agent skill by 0xdarkmatter/claude-mods
- community
Checking that the SKILL.md file is still in the repository.
Cypress end-to-end and component testing operations - selector/retry-ability strategy, cy.intercept network stubbing, cy.session auth, component vs e2e, flake diagnosis, CI, Test Replay. Use for: cypress, e2e test, component test, cy.get, cy.intercept, cy.session, data-cy, data-test, retry-ability, flake, flaky test, cypress.config, cy.mount, Test Replay, custom commands, fixtures.
Install
npx vskill@latest install 0xdarkmatter/claude-mods/cypress-opsSKILL.md
Cypress Operations
Facts verified as of 2026-07.
Version context (verified against docs.cypress.io, 2026-06): Cypress 14.x, Test Replay (v13+), cy.session with cacheAcrossSpecs. APIs move — confirm against the live docs when a detail is load-bearing.
End-to-end and component testing with Cypress (cypress, TS/JS). The runner executes tests inside a real browser via the Cypress App (cypress open) or headlessly (cypress run). The defining mental model: `cy.*` commands are not promises — they enqueue onto an async command chain that Cypress drains for you. Internalise that and the agentic gotchas below disappear.
Quick Start
Specs live in cypress/e2e/**/*.cy.ts (E2E) and beside components or cypress/component/ (component). Config is a single cypress.config.ts at the repo root.
The Async Command Queue (read this first)
cy.get(...) returns a Chainer, not the element and not a Promise. Commands are scheduled, then run in order after the test function returns. This is the source of nearly every Cypress mistake an agent makes.
Rules that follow from this:
- No `const`/`let` to "store" a command result. Use
.as()aliases +cy.get('@alias'). - No `async/await` on `cy.*`. The queue handles ordering. Mixing in real promises?
wrap them with cy.then(() => promise) or cy.wrap(promise).
- No `if/else` on element state read synchronously. Conditional testing is an
anti-pattern in Cypress (the DOM may not have settled); make the app deterministic, or drive the branch off a server/cy.intercept state you control. Deep dive: references/network-and-auth.md.
Retry-ability (why you almost never need waits)
Cypress retries queries and assertions until they pass or the command times out (default 4s). It does not retry actions (.click(), .type(), .select()) — those fire once, though the queries leading up to them retry until the element is actionable (visible, not disabled, not animating).
| Construct | Retries? | Use for | |
|---|---|---|---|
cy.get / .find / .contains / .its / .invoke (queries) | Yes — whole chain re-queries | Locating/reading DOM that may not be ready | |
.should(...) / expect inside it | Yes — the callback re-runs | Assertions; conditional waits on settled state | |
.click / .type / .select (actions) | No — fire once | Interactions (leading queries still retry) | |
.then(cb) | No — runs once, no retry protection | Extracting a value; NOT for assertions |
If you reach for cy.wait(3000), you're missing an assertion or an aliased intercept. The only legitimate cy.wait takes an alias (cy.wait('@getUsers')), never a number.
Selector Strategy
Prefer a dedicated test attribute over CSS classes, IDs, or tag names — the latter are brittle and change with styling/refactors. Cypress recommends data-cy or data-test (the Cypress Real World App standardises on `data-test`); pick one and enforce it.
Wrap the convention in a custom command so specs stay terse:
Reserve cy.contains('Log In') for when the visible text itself is what you're asserting; otherwise it couples tests to copy.
Network Stubbing — cy.intercept
cy.intercept is the single API for spying on and stubbing network traffic. Set it up before the action that triggers the request, alias it, then wait on the alias.
Stub what you don't own, exercise what you do. Stubbing third-party/slow endpoints makes tests fast and deterministic; hitting your real backend (seeded via cy.request) verifies the client↔server contract. Decide per endpoint. GraphQL, request modification, and seed-via-cy.request patterns: references/network-and-auth.md.
Authentication — cy.session
Log in once, cache the session, restore it across tests (and optionally specs). This is the biggest suite-speed win after stubbing.
Critical behaviour: cookies, `localStorage`, and `sessionStorage` across all domains are cleared before `setup` runs, regardless of `testIsolation`. Faster still: skip the UI and log in via cy.request inside setup, persisting the token. Patterns (API login, token priming, cy.origin for cross-origin SSO): references/network-and-auth.md.
Component vs E2E Testing
Same runner, two testing types. E2E drives a deployed app through cy.visit. Component mounts a single component in a real browser via cy.mount — no server, no navigation, props/events under direct control.
| E2E | Component | ||
|---|---|---|---|
| Entry | cy.visit('/path') | cy.mount(<Comp/>) | |
| Needs running app server | Yes | No (bundler dev server only) | |
| Spec location | cypress/e2e/**/*.cy.ts | beside the component / cypress/component/ | |
| Support file | cypress/support/e2e.ts | cypress/support/component.ts (registers cy.mount) | |
| Best for | User flows, integration, auth | Props/events/slots, edge states, visual |
Frameworks: React 18–19, Vue 3, Angular 18–21, Svelte 5. Bundlers: Vite 5–8 (React/Vue/ Svelte) or webpack 5 (all + Next.js). Configured under component.devServer.{framework,bundler}. Mounting per framework, store/router mocking, slots: references/component-testing.md.
Test Isolation, Fixtures, Custom Commands
- `testIsolation: true` (default, E2E) clears cookies/storage and resets to
about:blank
before each test. Each test must pass run in isolation (it.only to verify) — never rely on a previous test's state. Reset server-side state in beforeEach, not afterEach (an after hook may not run if you refresh mid-test).
- Multiple assertions per test are fine — don't split into one-assertion tests; state
reset between tests costs more than extra assertions.
- Fixtures are static JSON in
cypress/fixtures/, loaded bycy.fixture('users.json')
or referenced directly in cy.intercept(..., { fixture: 'users.json' }).
- Custom commands (
Cypress.Commands.add) live incypress/support/commands.ts; add
the cypress/react (etc.) types and a declare global block for TS autocomplete.
CI
| Decision | Guidance | |
|---|---|---|
| Start the app | Start it before Cypress (start + wait-on), kill after — never cy.exec a server mid-test | |
| Parallelism | cypress run --record --parallel splits specs across machines — requires Cypress Cloud (paid). Free alternative: shard specs manually across matrix jobs with --spec | |
| Retries | Config retries: { runMode: 2, openMode: 0 } — surface flakes as a queue, don't paper over them | |
| Debugging CI failures | Test Replay (v13+, Chromium-only) over video: captures DOM, network, console, errors for time-travel debugging in Cloud |
Full workflows (matrix sharding, containers, artifact upload): references/ci-and-flake.md.
Flake Diagnosis
Most Cypress flake traces to one of: an action chained where a query/assertion belonged, a missing aliased cy.wait, conditional logic on un-settled DOM, or leaked state between tests.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cypress-ops/SKILL.md
Popularity
- Repository stars
- 42
- Repository forks
- 7
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/0xdarkmatter/claude-mods/cypress-ops)