Skip to main content
skill Claude Code CX Codex Cursor

e2e-testing-patterns — Claude Code skill

This skill helps build E2E tests for critical user journeys with Playwright and Cypress. Use it when debugging flaky tests or setting testing standards.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install developer-essentials@claude-code-workflows
Open on GitHub

What e2e-testing-patterns does

e2e-testing-patterns focuses E2E coverage on login, signup, checkout, complex interactions, real API integration, authentication flows, and cross-browser behavior. It also draws a boundary around E2E testing: unit logic and API contracts belong in other test layers, while E2E tests should follow user-visible behavior.

The skill covers independent and deterministic tests, stable selectors with data-testid, data-cy, and Testing Library commands, test-data cleanup, and Page Objects. Cypress examples use @testing-library/cypress. Playwright examples include headed and debug runs, trace viewer, test.step, page.screenshot, and page.pause.

Install it when you are building critical workflows or investigating flaky suites. Skip it for isolated unit logic and API-contract checks, where E2E adds unnecessary scope.

What it helps with

  • cover login, signup, and checkout journeys
  • debug flaky end-to-end tests
  • choose stable selectors for Cypress and Playwright
  • check behavior across multiple browsers
  • validate a critical workflow in CI/CD

Example prompts for the agent

  • Create a Playwright E2E test for the checkout flow.
  • Investigate this flaky test and replace fixed timeouts with proper waits.
  • Show how to test the Email address field with `findByLabelText` and `data-testid`.

How to install e2e-testing-patterns

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install developer-essentials@claude-code-workflows

This installs the whole developer-essentials plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill e2e-testing-patterns -a claude-code

3Manually: put the files in place

~/.claude/skills/e2e-testing-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/e2e-testing-patterns/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

debug-optimize-lcp ChromeDevTools Breaks Largest Contentful Paint into four sequential stages and shows exactly where the main content load is bottlenecked. Claude Code CX Codex Cursor +1 3,500installs project-workflow-analysis-blueprint-generator official github A GitHub Copilot skill that maps project architecture and documents end-to-end workflows. Use it when you need implementation blueprints for similar features. GitHub Copilot 9,366installs java-refactoring-extract-method official github This skill guides Extract Method refactoring for complex Java methods while preserving behaviour. Use it when a method needs smaller, focused units backed by tests. GitHub Copilot 9,284installs breakdown-test official github Creates test strategies, QA plans, and issue checklists from feature documents. Use it when planning test work for a GitHub project. GitHub Copilot 9,264installs rust-mcp-server-generator official github Generate a Rust MCP server project with tools, prompts, resources, and an integration test. Use it when you want a project scaffold based on the official rmcp SDK. GitHub Copilot 9,181installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs

Questions about e2e-testing-patterns

How do I install e2e-testing-patterns in Claude Code?

Run npx skills add wshobson/agents --skill e2e-testing-patterns -a claude-code. The skill file is placed at ~/.claude/skills/e2e-testing-patterns/SKILL.md.

What does e2e-testing-patterns do?

It guides E2E coverage for critical user journeys, flaky-test debugging, and stable selector choices. The examples use Playwright and Cypress.

What is required for `findByRole` and `findByLabelText` in Cypress?

Add @testing-library/cypress and import @testing-library/cypress/add-commands in the Cypress support file.

Source text

SKILL.md · MIT
---
name: e2e-testing-patterns
description: Master end-to-end testing with Playwright and Cypress to build reliable test suites that catch bugs, improve confidence, and enable fast deployment. Use when implementing E2E tests, debugging flaky tests, or establishing testing standards.
---

# E2E Testing Patterns

Build reliable, fast, and maintainable end-to-end test suites that provide confidence to ship code quickly and catch regressions before users do.

## When to Use This Skill

- Implementing end-to-end test automation
- Debugging flaky or unreliable tests
- Testing critical user workflows
- Setting up CI/CD test pipelines
- Testing across multiple browsers
- Validating accessibility requirements
- Testing responsive designs
- Establishing E2E testing standards

## Core Concepts

### 1. E2E Testing Fundamentals

**What to Test with E2E:**

- Critical user journeys (login, checkout, signup)
- Complex interactions (drag-and-drop, multi-step forms)
- Cross-browser compatibility
- Real API integration
- Authentication flows

**What NOT to Test with E2E:**

- Unit-level logic (use unit tests)
- API contracts (use integration tests)
- Edge cases (too slow)
- Internal implementation details

### 2. Test Philosophy

**The Testing Pyramid:**

```
        /\
       /E2E\         ← Few, focused on critical paths
      /─────\
     /Integr\        ← More, test component interactions
    /────────\
   /Unit Tests\      ← Many, fast, isolated
  /────────────\
```

**Best Practices:**

- Test user behavior, not implementation
- Keep tests independent
- Make tests deterministic
- Optimize for speed
- Use data-testid, not CSS selectors

## Detailed patterns and worked examples

Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.

## Best Practices

1. **Use Data Attributes**: `data-testid` or `data-cy` for stable selectors
2. **Avoid Brittle Selectors**: Don't rely on CSS classes or DOM structure
3. **Test User Behavior**: Click, type, see - not implementation details
4. **Keep Tests Independent**: Each test should run in isolation
5. **Clean Up Test Data**: Create and destroy test data in each test
6. **Use Page Objects**: Encapsulate page logic
7. **Meaningful Assertions**: Check actual user-visible behavior
8. **Optimize for Speed**: Mock when possible, parallel execution

```typescript
// ❌ Bad selectors
cy.get(".btn.btn-primary.submit-button").click();
cy.get("div > form > div:nth-child(2) > input").type("text");

// ✅ Good selectors (findBy* commands come from @testing-library/cypress;
// add `import "@testing-library/cypress/add-commands";` to your Cypress support file)
cy.findByRole("button", { name: "Submit" }).click();
cy.findByLabelText("Email address").type("[email protected]");
cy.get('[data-testid="email-input"]').type("[email protected]");
```

## Common Pitfalls

- **Flaky Tests**: Use proper waits, not fixed timeouts
- **Slow Tests**: Mock external APIs, use parallel execution
- **Over-Testing**: Don't test every edge case with E2E
- **Coupled Tests**: Tests should not depend on each other
- **Poor Selectors**: Avoid CSS classes and nth-child
- **No Cleanup**: Clean up test data after each test
- **Testing Implementation**: Test user behavior, not internals

## Debugging Failing Tests

```typescript
// Playwright debugging
// 1. Run in headed mode
npx playwright test --headed

// 2. Run in debug mode
npx playwright test --debug

// 3. Use trace viewer (record with `use: { trace: 'on-first-retry' }` in the config)
npx playwright show-trace path/to/trace.zip
await page.screenshot({ path: 'screenshot.png' });

// 4. Add test.step for better reporting
test('checkout flow', async ({ page }) => {
    await test.step('Add item to cart', async () => {
        await page.goto('/products');
        await page.getByRole('button', { name: 'Add to Cart' }).click();
    });

    await test.step('Proceed to checkout', async () => {
        await page.goto('/cart');
        await page.getByRole('button', { name: 'Checkout' }).click();
    });
});

// 5. Inspect page state
await page.pause();  // Pauses execution, opens inspector
```

© Seth Hobson · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor