Skip to main content
skill CX Codex

playwright-e2e-tester — Claude Code skill: what it does

playwright-e2e-tester is a Claude Code skill that generates Playwright test suites, sets up Page Object models, and configures CI/CD for browser automation.

MIT 200 installs ★ 274 updated 2026-10-30

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

What playwright-e2e-tester does

This skill guides coding agents through web test automation with Playwright. It writes test scripts from user stories, establishes Page Object patterns, and configures playwright.config.ts for Chromium, Firefox, and WebKit. It handles viewport setups, device emulation, and dynamic wait strategies.

The skill handles complex scenarios like session-based authentication fixtures, visual regression using toHaveScreenshot(), and network mocking through route() and fulfill(). Without Playwright browser binaries installed in your environment, test runs will fail immediately.

For continuous integration, it produces GitHub Actions workflows. It configures sharding, test retries, trace captures, and artifact uploads for HTML test reports.

What it helps with

  • Write end-to-end tests for user login and checkout flows
  • Organize UI selectors and actions into Page Object classes
  • Mock backend endpoints with route() and fulfill() responses
  • Implement screenshot comparison tests using toHaveScreenshot()
  • Configure a GitHub Actions workflow to run Playwright in parallel

Example prompts for the agent

  • Write a Playwright test suite for our sign-in form using role-based locators
  • Create a Page Object class for the checkout page with reusable actions
  • Set up a GitHub Actions workflow that installs Playwright browsers and uploads test reports

How to install playwright-e2e-tester

1Skills CLI (Vercel)

npx skills add curiositech/some_claude_skills --skill playwright-e2e-tester -a claude-code

2Manually: put the files in place

~/.claude/skills/playwright-e2e-tester/SKILL.md

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

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

Questions about playwright-e2e-tester

How to install playwright-e2e-tester in Claude Code?

Run npx skills add curiositech/some_claude_skills --skill playwright-e2e-tester -a claude-code. You can also save the file directly to ~/.claude/skills/playwright-e2e-tester/SKILL.md.

What does playwright-e2e-tester do?

It directs your assistant in writing Playwright tests, implementing Page Object Model architecture, mocking API responses, and setting up CI workflows.

How does it handle flaky tests?

It uses Playwright Trace Viewer configurations, role-based locators, web-first assertions, and automatic retry policies in test configurations.

Source text

SKILL.md · MIT
---
name: playwright-e2e-tester
description: Expert in end-to-end testing with Playwright, the modern cross-browser testing framework. Specializes in test generation, page object patterns, visual regression testing, and CI/CD integration.
  Handles complex testing scenarios including authentication flows, API mocking, and mobile emulation.
version: 1.0.0
metadata:
  category: testing
  tags:
  - e2e
  - playwright
  - testing
  - automation
  - ci-cd
  - cross-browser
  pairs-with:
  - skill: test-automation-expert
    reason: Playwright E2E tests are one tier in a comprehensive test automation strategy
  - skill: webapp-testing
    reason: 'Both use Playwright but for different scopes: E2E test suites vs interactive debugging'
  - skill: vitest-testing-patterns
    reason: Unit tests (Vitest) and E2E tests (Playwright) form complementary test pyramid layers
  - skill: github-actions-pipeline-builder
    reason: E2E tests run in CI pipelines with browser installation and artifact upload steps
---

# Playwright E2E Tester

## Overview

Expert in end-to-end testing with Playwright, the modern cross-browser testing framework. Specializes in test generation, page object patterns, visual regression testing, and CI/CD integration. Handles complex testing scenarios including authentication flows, API mocking, and mobile emulation.

## When to Use

- Setting up Playwright in a new or existing project
- Writing E2E tests for critical user flows
- Debugging flaky tests or test failures
- Implementing visual regression testing
- Configuring Playwright for CI/CD pipelines
- Migrating from Cypress, Selenium, or Puppeteer
- Testing authenticated flows with session management
- Cross-browser testing (Chromium, Firefox, WebKit)

## Capabilities

### Test Generation & Writing
- Generate Playwright tests from user stories or acceptance criteria
- Write tests using best practices (locators, assertions, waits)
- Implement Page Object Model (POM) patterns
- Create reusable test fixtures and utilities
- Handle dynamic content and race conditions

### Configuration & Setup
- Configure `playwright.config.ts` for different environments
- Set up projects for multiple browsers and viewports
- Configure base URL, timeouts, and retries
- Implement global setup/teardown for auth
- Set up test reporters (HTML, JSON, JUnit)

### Advanced Patterns
- API mocking with `route()` and `fulfill()`
- Network interception and request validation
- Visual regression with `toHaveScreenshot()`
- Accessibility testing with `@axe-core/playwright`
- Mobile emulation and device testing
- Geolocation and permissions mocking

### CI/CD Integration
- GitHub Actions workflow configuration
- Parallel test execution with sharding
- Artifact collection (traces, screenshots, videos)
- Flaky test detection and retry strategies
- Test result reporting and notifications

### Debugging & Maintenance
- Use Playwright Inspector and Trace Viewer
- Debug with `page.pause()` and headed mode
- Analyze test traces for failures
- Reduce test flakiness with proper waits
- Maintain test stability over time

## Dependencies

Works well with:
- `vitest-testing-patterns` - Unit test patterns that complement E2E
- `github-actions-pipeline-builder` - CI/CD pipeline setup
- `accessibility-auditor` - Extended accessibility testing
- `api-architect` - API contract testing alongside E2E

## Examples

### Basic Test Structure
```typescript
import { test, expect } from '@playwright/test';

test.describe('User Authentication', () => {
  test('should allow user to sign in', async ({ page }) => {
    await page.goto('/login');

    await page.getByLabel('Email').fill('[email protected]');
    await page.getByLabel('Password').fill('securepassword');
    await page.getByRole('button', { name: 'Sign In' }).click();

    await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
    await expect(page).toHaveURL('/dashboard');
  });
});
```

### Page Object Pattern
```typescript
// pages/LoginPage.ts
import { Page, Locator } from '@playwright/test';

export class LoginPage {
  readonly page: Page;
  readonly emailInput: Locator;
  readonly passwordInput: Locator;
  readonly signInButton: Locator;

  constructor(page: Page) {
    this.page = page;
    this.emailInput = page.getByLabel('Email');
    this.passwordInput = page.getByLabel('Password');
    this.signInButton = page.getByRole('button', { name: 'Sign In' });
  }

  async goto() {
    await this.page.goto('/login');
  }

  async signIn(email: string, password: string) {
    await this.emailInput.fill(email);
    await this.passwordInput.fill(password);
    await this.signInButton.click();
  }
}
```

### Auth Setup Fixture
```typescript
// fixtures/auth.ts
import { test as base } from '@playwright/test';

export const test = base.extend({
  authenticatedPage: async ({ page }, use) => {
    // Perform authentication
    await page.goto('/login');
    await page.getByLabel('Email').fill(process.env.TEST_USER!);
    await page.getByLabel('Password').fill(process.env.TEST_PASS!);
    await page.getByRole('button', { name: 'Sign In' }).click();

    // Wait for auth to complete
    await page.waitForURL('/dashboard');

    // Use the authenticated page in tests
    await use(page);
  },
});
```

### GitHub Actions CI
```yaml
name: E2E Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: Install dependencies
        run: npm ci

      - name: Install Playwright browsers
        run: npx playwright install --with-deps

      - name: Run E2E tests
        run: npx playwright test

      - name: Upload test results
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: playwright-report
          path: playwright-report/
```

### Visual Regression Test
```typescript
test('homepage matches snapshot', async ({ page }) => {
  await page.goto('/');

  // Full page screenshot comparison
  await expect(page).toHaveScreenshot('homepage.png', {
    fullPage: true,
    maxDiffPixelRatio: 0.01,
  });

  // Component-level screenshot
  const hero = page.getByTestId('hero-section');
  await expect(hero).toHaveScreenshot('hero-section.png');
});
```

### API Mocking
```typescript
test('displays products from API', async ({ page }) => {
  // Mock the API response
  await page.route('**/api/products', async (route) => {
    await route.fulfill({
      status: 200,
      contentType: 'application/json',
      body: JSON.stringify([
        { id: 1, name: 'Product A', price: 29.99 },
        { id: 2, name: 'Product B', price: 49.99 },
      ]),
    });
  });

  await page.goto('/products');

  await expect(page.getByText('Product A')).toBeVisible();
  await expect(page.getByText('$29.99')).toBeVisible();
});
```

## Best Practices

1. **Use role-based locators** - Prefer `getByRole()`, `getByLabel()`, `getByText()` over CSS selectors
2. **Avoid hard waits** - Use `waitForSelector()`, `waitForURL()`, or assertions instead of `waitForTimeout()`
3. **Isolate tests** - Each test should be independent and not rely on state from other tests
4. **Use fixtures** - Share setup logic through fixtures rather than `beforeEach` hooks
5. **Keep tests focused** - Test one user flow per test, avoid testing multiple unrelated things
6. **Handle flakiness proactively** - Use proper waits, retries, and stable locators
7. **Organize with Page Objects** - Encapsulate page interactions for maintainability
8. **Run in CI** - Always run E2E tests in CI before merging

## Common Pitfalls

- **Flaky locators**: Avoid fragile selectors like `nth-child(3)` or auto-generated class names
- **Race conditions**: Always wait for elements/navigation before interacting
- **Shared state**: Tests should not depend on execution order
- **Slow tests**: Use API calls to set up state instead of UI interactions when possible
- **Missing cleanup**: Clean up test data to avoid pollution between runs

© curiositech · MIT · curiositech/some_claude_skills

Similar skills

All skills for Testing and QA →

From the same set180

The whole set →
mdx-sanitizer mdx-sanitizer escapes angle brackets, TypeScript generics and Liquid templates in MDX before Docusaurus builds. Use it when pre-commit hooks or builds fail on unexpected token. CX Codex +1 202installs github-actions-pipeline-builder github-actions-pipeline-builder writes GitHub Actions workflows: matrix builds, dependency caching, deployments, automated tests, security scans, release automation. Triggers on "GitHub Actions", "CI/CD", "workflow", "deployment pipeline". CX Codex +1 202installs physics-rendering-expert physics-rendering-expert guides physics implementation for ropes, cables, and cloth using Position-Based Dynamics (PBD) and Verlet integration. Avoids spring instability and Euler gimbal lock. CX Codex +1 201installs supabase-admin supabase-admin — a skill for Supabase database work: schema design, Row Level Security policies, migrations, and query debugging. It helps when an agent modifies the database structure or figures out why a query returns nothing. CX Codex +1 200installs sober-addict-protector sober-addict-protector is a Claude Code skill for daily recovery check-ins, spotting triggers, assessing risk, and planning ways to protect sobriety before a lapse. CX Codex +1 199installs product-appeal-analyzer product-appeal-analyzer is a Claude Code skill that assesses product appeal, trust, and positioning. It reviews landing pages and product messaging. CX Codex +1 199installs background-job-orchestrator background-job-orchestrator designs background queues with BullMQ, Celery, or cloud tasks. Offloads heavy logic from HTTP handlers, configures retries, and scales worker processes. CX Codex +1 198installs skill-logger skill-logger — a skill for Claude Code, Codex, Cursor and more: records every skill invocation, computes a quality score, and captures feedback signals. Activate it when you want to know which skills underperform and why. CX Codex +1 197installs

Project sponsors

Companies that keep this analytics open