cypress-automation
БесплатноБез исполняемых скриптовНе проверенBuild Cypress test suites in TypeScript: E2E tests, component tests, custom commands, cy.intercept network control, cy.session login, Cypress Cloud, and CI…
от petrkindlmann★ 317 звёзд на GitHubОб этом скилле
Quick Route
| You need to... | Go to |
|---|---|
| Write an E2E spec (load, intercept, assert) | Core Principles + references/intercept-patterns.md |
Add a typed custom command / cy.session login |
Custom Commands + references/config-and-commands.md |
| Mount and test a single component | Component Testing + references/component-and-fixtures.md |
Scaffold cypress.config.ts / project layout |
Project Structure + references/config-and-commands.md |
| Stub, spy, simulate errors, or poll an API | cy.intercept Patterns + references/intercept-patterns.md |
| Run in CI / parallelize on Cypress Cloud | CI Integration + references/ci-recipes.md |
| Handle an SSO / OAuth redirect | Cross-Origin Flows + references/intercept-patterns.md |
Discovery Questions
Check .agents/qa-project-context.md first -- if it exists, use it and skip questions already answered there.
- Component testing, E2E, or both? Component testing mounts individual components in isolation; E2E tests the full app through the browser. Most projects need both. Component testing requires a framework-specific mount (React, Vue, Angular, Svelte).
- Cypress Cloud? Cloud provides parallelization, flake detection, analytics, Test Replay, and the AI add-on. If the team uses it, configure
projectIdand the record key. If not, everything runs locally or in CI without Cloud. - TypeScript? Strongly recommended and the default here -- Cypress supports it natively. All examples use TypeScript.
- Framework and bundler? React + Vite, Next.js + Webpack, Vue + Vite, Angular -- component-testing config depends on this.
- Cross-origin auth? If login redirects to a separate domain (SSO, OAuth provider), you need
cy.origin. Note it now so the login command is built for it. - Existing suite or fresh start? If migrating, start with the flakiest or most critical tests, not a big-bang rewrite (see
test-migration).
Core Principles
1. Commands Are Enqueued, Not Executed Immediately
The single most important concept. Cypress commands (cy.get, cy.click, cy.type) do not execute when called -- they are added to a queue and run serially, asynchronously. You cannot use async/await with Cypress commands, and you cannot store the return value in a variable.
// WRONG -- this looks synchronous but is not
const button = cy.get('[data-testid="submit"]'); // button is a Chainable, not an element
button.click(); // works only by accident, via chaining
// CORRECT -- chain commands; use .then() when you need a value
cy.get('[data-testid="submit"]').click();
cy.get('[data-testid="price"]').invoke('text').then((text) => {
const price = parseFloat(text.replace('$', ''));
expect(price).to.be.greaterThan(0);
});
2. Retry-ability Is Built-In (For Queries, Not Actions)
Cypress automatically retries queries (cy.get, cy.find, cy.contains) and assertions until they pass or time out. It does not retry actions (cy.click, cy.type, cy.select):
cy.get('.loading').should('not.exist')waits for the indicator to disappearcy.get('.item').should('have.length', 5)waits for 5 itemscy.click()executes once -- if the element is not actionable, it fails
3. Network Control with cy.intercept
cy.intercept intercepts HTTP requests at the network layer -- stub responses, wait for requests to complete, assert on request bodies. Mastering it is the difference between flaky and stable tests. Always wait on a network alias or a DOM assertion, never a fixed cy.wait(ms).
4. Isolation: Each Test Starts Clean
Every it() runs in fresh browser state -- Cypress clears cookies, localStorage, and sessionStorage between tests by default. Tests must not depend on other tests' state or order. Use beforeEach for shared setup, not inter-test dependencies.
5. Data Attributes for Test Selectors
Use data-testid, data-cy, or data-test. They survive CSS refactors, class renames, and localization. Configure the preferred attribute in cypress.config.ts.
Project Structure & Configuration
Standard layout splits e2e/, component/, fixtures/, and support/, with cypress.config.ts at the root configuring both runners. Key config choices: baseUrl from env (never hardcode for CI), explicit viewport, retries.runMode: 2 for CI, and the framework/bundler pair under component.devServer. Compon
Установить cypress-automation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cypress-automation?
Build Cypress test suites in TypeScript: E2E tests, component tests, custom commands, cy.intercept network control, cy.session login, Cypress Cloud, and CI integration. Covers retry-ability, the command queue, cross-origin flows with cy.origin, and data-driven testing with fixtures. Use when: "write E2E test in Cypress," "Cypress page object / custom command," "cy.," "cy.intercept," "Cypress component test," "Cypress Cloud," "cypress.config.ts." Not for: Playwright suites — use playwright-automation; flaky-test healing or quarantine — use test-reliability; bulk selector regeneration after a UI refactor — use selector-drift-recovery; Selenium-to-Cypress conversion — use test-migration. Related: playwright-automation, ci-cd-integration, visual-testing, unit-testing, test-reliability.
Как установить скилл cypress-automation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cypress-automation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic