Skip to main content
skill CX Codex

e2e-testing · oakoss — Claude Code skill: what it does, how to install

e2e-testing guides AI coding assistants on Playwright E2E test suite architecture, Page Object Models, network mocking, and CI sharding strategies.

MIT 142 installs ★ 29 updated 2026-08-17

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add oakoss/agent-skills --skill e2e-testing -a claude-code
Open on GitHub

What e2e-testing does

This skill provides structural patterns and architectural guidelines for Playwright end-to-end testing. It helps configure Page Object Models in tests/pages/, handle authentication via storageState, run accessibility audits with @axe-core/playwright, and implement visual regression testing.

The skill covers CI performance optimizations, including test splitting with --shard=1/N, merging blob reports, and executing only tests modified against the base branch. It emphasizes role-based locators over CSS or XPath and replaces waitForTimeout() calls with auto-waiting assertions like expect(element).toBeVisible().

Remember that storageState captures cookies and localStorage but ignores sessionStorage, which requires custom scripts with addInitScript(). For low-level browser automation commands or web scraping, Oakoss provides the separate playwright skill.

What it helps with

  • structure Page Object Model classes for complex user flows
  • configure CI test sharding and report merging in workflows
  • set up reusable authentication sessions using storageState
  • integrate accessibility audits with AxeBuilder and axe-core

Example prompts for the agent

  • Design a Page Object Model structure for our checkout flow using Playwright
  • Show me how to shard our Playwright tests in CI and merge blob reports
  • Set up storageState authentication with setup projects for our test suite

How to install e2e-testing

1Skills CLI (Vercel)

npx skills add oakoss/agent-skills --skill e2e-testing -a claude-code

2Manually: put the files in place

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

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

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about e2e-testing

How do I install e2e-testing in Claude Code?

Run npx skills add oakoss/agent-skills --skill e2e-testing -a claude-code. The skill file installs to ~/.claude/skills/e2e-testing/SKILL.md.

What is the difference between e2e-testing and the playwright skill?

The e2e-testing skill targets test suite design, authentication flows, CI sharding, and mocking strategies. For raw browser control, Playwright API methods, or web scraping, use the playwright skill instead.

How does this skill handle test authentication?

It suggests authenticating once via setup projects and storing credentials in storageState. The generated playwright/.auth/ directory should stay in .gitignore to avoid checking credentials into Git.

Source text

SKILL.md · MIT
---
name: e2e-testing
description: 'E2E test architecture and patterns with Playwright. Use when designing test suites, structuring Page Object Models, planning CI sharding strategies, setting up authentication flows, or organizing tests with tags and annotations. Use for test architecture, accessibility auditing with axe-core, network mocking strategies, visual regression workflows, HAR replay, and storageState authentication patterns. For Playwright API details, browser automation, or web scraping, use the playwright skill instead.'
license: MIT
metadata:
  author: oakoss
  version: '1.0'
user-invocable: false
---

# E2E Testing

## Overview

Covers E2E test architecture and patterns using Playwright — how to structure test suites, organize tests, and apply proven patterns for authentication, mocking, visual regression, accessibility auditing, and CI parallelism. Focuses on the WHY and WHEN of test patterns rather than Playwright API specifics.

**When to use:** Designing test suite architecture, structuring Page Object Models, planning CI sharding strategies, setting up authentication flows, organizing tests with tags and annotations, implementing visual regression workflows, mocking network requests, auditing accessibility.

**When NOT to use:** Unit testing (use Vitest/Jest), API-only testing (use integration tests), component testing in isolation (use component test runners). For Playwright API details, browser automation, scraping, or troubleshooting Playwright errors, use the `playwright` skill.

## Quick Reference

| Pattern               | API/Tool                                  | Key Points                                         |
| --------------------- | ----------------------------------------- | -------------------------------------------------- |
| Role-based locators   | `getByRole`, `getByText`, `getByLabel`    | Preferred over CSS/XPath selectors                 |
| Page Object Model     | Classes in `tests/pages/`                 | Encapsulate all page-specific locators and actions |
| Authentication        | `storageState` + setup projects           | Authenticate once, reuse across tests              |
| Visual regression     | `expect(page).toHaveScreenshot()`         | Mask dynamic content to prevent flakes             |
| Accessibility audit   | `AxeBuilder` from `@axe-core/playwright`  | `.withTags()` + `.analyze()` on key flows          |
| Trace debugging       | `trace: 'on-first-retry'`                 | Full DOM snapshots, network logs, and timeline     |
| Network mocking       | `page.route()`                            | Stable tests without third-party dependencies      |
| HAR replay            | `page.routeFromHAR()`                     | High-fidelity mocks from recorded traffic          |
| Image blocking        | `page.route('**/*.{png,jpg}', abort)`     | Speed up tests by skipping images                  |
| CI sharding           | `--shard=1/4`                             | Split suite across parallel CI machines            |
| Blob reports          | `--reporter=blob` + `merge-reports`       | Merge sharded results into a single report         |
| Test tags             | `{ tag: ['@smoke'] }`                     | Filter tests by category with `--grep`             |
| Test steps            | `test.step('name', async () => {})`       | Group actions in trace viewer and reports          |
| Changed tests only    | `--only-changed=$GITHUB_BASE_REF`         | Run only test files changed since base branch      |
| Native a11y checks    | `toHaveAccessibleName`, `toHaveRole`      | Lightweight alternative to full axe-core scans     |
| Git info in reports   | `captureGitInfo` reporter option          | Link test reports to commits for CI debugging      |
| Web-first assertions  | `expect(element).toBeVisible()`           | Auto-wait instead of `waitForTimeout`              |
| Fixture composition   | `mergeTests()` / `mergeExpects()`         | Combine 3+ fixture modules into one `test`         |
| Auto fixtures         | `{ auto: true }` on `test.extend()`       | Run for every test (logging, screenshots)          |
| Fixture options       | `{ option: true }` on `test.extend()`     | Configurable via config or `test.use()`            |
| Data-driven tests     | `for...of` loop generating `test()` calls | Parameterized tests from arrays or CSV files       |
| Context emulation     | `browser.newContext()` options            | locale, timezone, colorScheme, offline, isMobile   |
| Two roles in one test | Concurrent `browser.newContext()` calls   | Separate storageState per context                  |

## Common Mistakes

| Mistake                                                  | Correct Pattern                                                                 |
| -------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Using `page.waitForTimeout()` for element visibility     | Use web-first assertions like `expect(element).toBeVisible()` which auto-wait   |
| Writing raw locators directly in test files              | Encapsulate all selectors in Page Object Model classes                          |
| Testing third-party APIs (Stripe, Auth0) directly        | Mock external services with `page.route()` for stable, fast tests               |
| Debugging CI failures with screenshots instead of traces | Configure `trace: 'on-first-retry'` and use Playwright Trace Viewer             |
| Sharing state between tests via global variables         | Use a fresh `BrowserContext` per test for full isolation                        |
| Running all tests in a single CI job                     | Use Playwright sharding (`--shard=1/N`) across parallel machines                |
| Using CSS/XPath selectors for element location           | Use role-based locators that survive refactors and enforce accessibility        |
| Logging in via UI in every test                          | Use `storageState` with setup projects to authenticate once                     |
| Using `injectAxe`/`checkA11y` from `axe-playwright`      | Use `AxeBuilder` from `@axe-core/playwright` with `.analyze()`                  |
| Committing `storageState` JSON files to git              | Add `playwright/.auth/` to `.gitignore`                                         |
| Relying on `storageState` for sign-out tests             | Sign-out invalidates server session — sign in via UI for each sign-out test     |
| Assuming `storageState` persists sessionStorage          | It only saves cookies + localStorage — use `addInitScript()` for sessionStorage |
| Duplicating test code for locale/currency variants       | Use fixture options (`{ option: true }`) with per-project config overrides      |
| Creating fixtures without `mergeTests()` for 3+ modules  | Use `mergeTests()` to compose fixture files into a single `test` export         |

## Delegation

- **Discover which user flows lack E2E coverage**: Use `Explore` agent
- **Build a full Page Object Model test suite for an application**: Use `Task` agent
- **Plan a CI sharding strategy for a large test suite**: Use `Plan` agent

> For Playwright API details, browser automation, scraping, stealth mode, screenshots/PDFs, Docker deployment, or troubleshooting Playwright errors, use the `playwright` skill.

## References

- [Role-based locators, auto-waiting, chaining, filtering, and locator strategy](references/locators.md)
- [Page Object Model architecture, fixtures integration, and base page patterns](references/page-objects.md)
- [Fixtures: scoping, composition, auto fixtures, options, and data-driven tests](references/fixtures.md)
- [Authentication with storageState, setup projects, and multi-role testing](references/authentication.md)
- [Network mocking, route interception, HAR replay, and WebSocket mocking](references/mocking.md)
- [Accessibility auditing with AxeBuilder, WCAG tags, and reusable fixtures](references/accessibility.md)
- [Visual regression, snapshot testing, masking, tolerance thresholds, and baseline management](references/visual-testing.md)
- [CI sharding, parallelism, blob reports, and browser caching](references/ci-sharding.md)
- [Test organization with tags, annotations, test.step, and project configuration](references/test-organization.md)

© oakoss · MIT · oakoss/agent-skills

Similar skills

All skills for Testing and QA →

e2e-testing by other authors comes first.

e2e-testing affaan-m Playwright E2E testing patterns covering Page Object Model setup, CI/CD configuration, flaky test quarantine, and artifact capture. CX Codex +1 7,200installs e2e-testing platform-team e2e-testing defines Playwright end-to-end testing patterns for full-stack React and Python applications. Enforces Page Object Model architecture and stable selectors. CX Codex +1 1,600installs testing-e2e OrchestKit testing-e2e provides Playwright E2E standards, page object patterns, and axe-core accessibility checks. Activates when editing tests or playwright.config.*. CX Codex +1 160installs appbuilder-e2e-testing adobe appbuilder-e2e-testing generates Playwright end-to-end tests for Adobe App Builder SPAs and AEM extensions. Useful when automating browser flows inside ExC Shell or setting up CI checks. CX Codex +1 835installs e2e-testing-automation aj-geddes e2e-testing-automation — a skill that helps you write end-to-end tests: browser flows, user journeys and frontend-backend integration checks. CX Codex +1 698installs playwright-e2e-testing fugazi playwright-e2e-testing — a skill for writing and maintaining Playwright E2E specs in TypeScript: user flows, forms, auth, API mocking and visual comparisons. CX Codex +1 642installs playwright-e2e-testing-cursorrules-prompt-file PatrickJS playwright-e2e-testing-cursorrules-prompt-file — a Cursor rule that turns the agent into a QA engineer for Playwright and TypeScript, writing a 3–5 test file from a feature description. CX Codex +1 ★ 41,178repo stars e2e-playwright-testing Agent Skills Contributors e2e-playwright-testing is a Claude Code skill for writing and reviewing Playwright end-to-end tests. It activates for browser flows, form checks, and files under tests/e2e/. CX Codex +1 880installs

From the same set106

The whole set →
de-slopify The de-slopify skill for Claude Code flags stock phrases, excess em dashes, and AI traces in comments while editing LLM-touched text and code. CX Codex +1 146installs docker Skill for building Docker images, configuring Compose stacks, and preparing containers for production. CX Codex +1 145installs chrome-devtools chrome-devtools is a Claude Code skill that controls a real Chrome session through an extension or DevTools MCP to fill forms, inspect pages, and debug web apps. It works with an existing browser session. CX Codex +1 145installs hydration-guardian hydration-guardian finds where server-rendered HTML and the client React tree disagree, then points to the pattern that fixes it. CX Codex +1 144installs valkey This skill guides Valkey setup for caching, rate limits, queues, and Redis migration. Use it when choosing data patterns or configuring a Docker Compose service. CX Codex +1 142installs remotion A rulebook for Remotion: your agent builds video out of React components and keeps animation tied to the timeline instead of CSS. CX Codex +1 141installs vite A skill for Vite work: config file, plugins, dev server, build output, SSR and env variables. Useful when the agent edits vite.config.ts in your project. CX Codex +1 138installs postgres-tuning postgres-tuning — a skill for Claude Code, Codex, Cursor and other agents that provides PostgreSQL 17/18+ performance tuning guidance. Covers async I/O, query plan forensics, index strategy, autovacuum, pgvector, and connection pooling. CX Codex +1 136installs

Project sponsors

Companies that keep this analytics open