Agent skill

Playwright E2E Testing

by fugazi in fugazi/test-automation-skills-agents

Author and maintain versioned Playwright (@playwright/test) TypeScript UI specs for browser user flows.

MITAuto-check passedTesting & QA

Install Playwright E2E Testing

skills CLI
$ npx skills add fugazi/test-automation-skills-agents --skill playwright-e2e-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install fugazi/test-automation-skills-agents playwright-e2e-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/fugazi/test-automation-skills-agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/playwright-e2e-testing .claude/skills/playwright-e2e-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
playwright-e2e-testing
GitHub stars
247
Token cost
~3.2k tokens
SKILL.md length
770 words
Files
19 (incl. references)
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Author and maintain versioned Playwright (@playwright/test) TypeScript UI specs for browser user flows.

  • Works in 4 steps: Test Runner & TypeScript → Locator Strategy (Priority Order) → Auto-Waiting & Web-First Assertions → …
  • Asked to create
  • SKILL.md covers When to Use This Skill, Prerequisites, First Questions to Ask and Core Principles, plus 7 more sections
  • Calls npx and npm

What it does

Playwright E2E Testing is an agent skill from fugazi/test-automation-skills-agents. Author and maintain versioned Playwright (@playwright/test) TypeScript UI specs for browser user flows. Use when asked to create, run, debug, or refactor E2E tests, form/navigation/auth flows, responsive checks, UI mocking, fixtures, Page Objects, or visual comparisons. Use api-testing for standalone REST/GraphQL contracts and playwright-cli for live browser sessions. Keywords: E2E spec, Playwright test, POM, fixtures, UI regression.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 19 other files, including reference files (for example `references/debugging-errors-network.md`, `references/debugging-flaky-locators.md` and `references/debugging-tools-ui.md`).

It sits in Testing & QA, covering End-to-end testing, Browser testing and API testing. It works with Playwright, TypeScript and GraphQL. The repository describes itself as: A practical library of agents, instructions, and skills designed specifically for QA Automation Engineers, focusing on production-oriented solutions. The licence is MIT.

When your agent uses it

  • Asked to create
  • Refactor E2E tests
  • Form/navigation/auth flows
  • Responsive checks

Example prompts

  • “/playwright-e2e-testing”

Requirements

  • Node.js

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Test Runner & TypeScript
  2. Locator Strategy (Priority Order)
  3. Auto-Waiting & Web-First Assertions
  4. Test Structure with Steps

What it can do on your machine

Read from SKILL.md and the folder at commit 65a72d5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Playwright E2E Testing loads about 3.2k tokens when it runs, and up to ~21k if it reads all its reference files. Until then it costs about 115 tokens; SKILL.md has 770 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~115
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~21k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from fugazi/test-automation-skills-agents at commit 65a72d5, republished under its MIT licence (© fugazi). 770 words, ~3,230 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-e2e-testing/SKILL.md (or your agent's skills folder). This skill also uses 18 other files; get the full folder from GitHub.
name
playwright-e2e-testing
description
Author and maintain versioned Playwright (@playwright/test) TypeScript UI specs for browser user flows. Use when asked to create, run, debug, or refactor E2E tests, form/navigation/auth flows, responsive checks, UI mocking, fixtures, Page Objects, or visual comparisons. Use api-testing for standalone REST/GraphQL contracts and playwright-cli for live browser sessions. Keywords: E2E spec, Playwright test, POM, fixtures, UI regression.
license
Complete terms in LICENSE.txt

Playwright E2E Testing (TypeScript)

Comprehensive toolkit for end-to-end testing of web applications using Playwright with TypeScript. Enables robust UI testing, UI-dependent API setup, and responsive design verification following best practices.

Activation: This skill is triggered when authoring or maintaining versioned Playwright UI specs and their test infrastructure.

When to Use This Skill

  • Write E2E tests for user flows, forms, navigation, and authentication
  • UI-dependent API setup via the request fixture or network interception
  • Responsive testing across mobile, tablet, and desktop viewports
  • Debug flaky tests using traces, screenshots, videos, and Playwright Inspector
  • Setup test infrastructure with Page Object Model and fixtures
  • Mock/intercept APIs for isolated, deterministic testing
  • Visual regression testing with screenshot comparisons
Do NOT Use For
  • Standalone API/contract testing with no browser (use api-testing).
  • Driving a live browser interactively for exploration or debugging (use playwright-cli).
  • Governing a large regression suite, tiers, or CI sharding strategy (use playwright-regression-testing).
  • Selenium/Java browser automation (use webapp-selenium-testing).

Prerequisites

RequirementDetails
Node.jsv18+ recommended
Package Managernpm, yarn, or pnpm
Playwright@playwright/test package
TypeScripttypescript + ts-node (optional but recommended)
BrowsersInstalled via npx playwright install
Quick Setup
bash
# Initialize new project
npm init playwright@latest

# Or add to existing project
npm install -D @playwright/test
npx playwright install

First Questions to Ask

Before writing tests, clarify:

  1. App URL: Local dev server command + port, or staging URL?
  2. Critical flows: Which user journeys must be covered (happy path + error states)?
  3. Browsers/devices: Chrome, Firefox, Safari? Mobile viewports?
  4. API strategy: Real backend, mocked responses, or hybrid?
  5. Test data: Seed data available? Reset/cleanup strategy?

Core Principles

1. Test Runner & TypeScript

Always use @playwright/test with TypeScript for type safety and better IDE support.

typescript
import { test, expect } from "@playwright/test";

test("user can login", async ({ page }) => {
  await page.goto("/login");
  await page.getByLabel("Email").fill("user@test.com");
  await page.getByLabel("Password").fill("password123");
  await page.getByRole("button", { name: "Sign in" }).click();
  await expect(page).toHaveURL(/.*dashboard/);
});
2. Locator Strategy (Priority Order)

Prefer role-based locators (getByRole) with accessible names, then label → placeholder → text → test ID → CSS (last resort). XPath is never used.

➡️ Full priority hierarchy, role reference, and examples: Locator Strategies: Priority — the single source of truth.

3. Auto-Waiting & Web-First Assertions

Playwright auto-waits for elements. Never use sleep() or arbitrary timeouts.

typescript
// [ok] Web-first assertions (auto-retry)
await expect(page.getByRole("alert")).toBeVisible();
await expect(page).toHaveURL(/dashboard/);
await expect(page.getByTestId("status")).toHaveText("Success!");

// [no] Avoid manual waits
await page.waitForTimeout(2000); // Bad practice
4. Test Structure with Steps

Use test.step() for readable reports and failure localization:

typescript
test("checkout flow", async ({ page }) => {
  await test.step("Add item to cart", async () => {
    await page.goto("/products/1");
    await page.getByRole("button", { name: "Add to Cart" }).click();
  });

  await test.step("Complete checkout", async () => {
    await page.goto("/checkout");
    await page.getByRole("button", { name: "Pay Now" }).click();
  });

  await test.step("Verify confirmation", async () => {
    await expect(page.getByRole("heading")).toContainText("Order Confirmed");
  });
});

Key Workflows

Forms & Navigation
typescript
// Form submit and wait for navigation (auto-waiting)
await page.getByRole("button", { name: "Login" }).click();
await expect(page).toHaveURL(/.*dashboard/);

// Form with API response validation
const responsePromise = page.waitForResponse(
  (r) => r.url().includes("/api/login") && r.status() === 200,
);
await page.getByRole("button", { name: "Login" }).click();
const response = await responsePromise;
API Testing (Request Fixture)
typescript
test("API health check", async ({ request }) => {
  const response = await request.get("/api/health");
  expect(response.ok()).toBeTruthy();
  expect(await response.json()).toMatchObject({ status: "ok" });
});
API Mocking & Interception
typescript
test("handles API error", async ({ page }) => {
  await page.route("**/api/users", (route) =>
    route.fulfill({
      status: 500,
      body: JSON.stringify({ error: "Server error" }),
    }),
  );
  await page.goto("/users");
  await expect(page.getByRole("alert")).toContainText("Something went wrong");
});
Responsive Testing
typescript
const viewports = [
  { width: 375, height: 667, name: "mobile" },
  { width: 768, height: 1024, name: "tablet" },
  { width: 1280, height: 720, name: "desktop" },
];

for (const vp of viewports) {
  test(`navigation works on ${vp.name}`, async ({ page }) => {
    await page.setViewportSize(vp);
    await page.goto("/");
    // Mobile: hamburger menu
    if (vp.width < 768) {
      await page.getByRole("button", { name: /menu/i }).click();
    }
    await page.getByRole("link", { name: "About" }).click();
    await expect(page).toHaveURL(/about/);
  });
}

Configuration

Use playwright.config.ts for project-wide settings:

typescript
import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
  testDir: "./tests",
  retries: process.env.CI ? 2 : 0,
  reporter: [["html"], ["junit", { outputFile: "results.xml" }]],
  use: {
    baseURL: "http://localhost:3000",
    trace: "on-first-retry",
    screenshot: "only-on-failure",
    video: "retain-on-failure",
  },
  projects: [
    { name: "chromium", use: devices["Desktop Chrome"] },
    { name: "mobile", use: devices["Pixel 5"] },
  ],
  webServer: {
    command: "npm run dev",
    url: "http://localhost:3000",
    reuseExistingServer: !process.env.CI,
  },
});

Troubleshooting

ProblemCauseSolution
Element not foundWrong locator or not renderedUse PWDEBUG=1 to inspect, verify with getByRole
Timeout waitingElement hidden or slow loadCheck for overlays, increase timeout, use waitFor()
Flaky testsRace conditions, animationsAdd test.step(), use proper waits, disable animations
Strict mode violationMultiple elements matchUse .first(), .filter(), or more specific locator
Screenshots differDynamic contentMask dynamic areas, use deterministic data
CI fails, local passesEnvironment differencesCheck baseURL, timeouts, webServer config
API mock not workingRoute pattern mismatchUse **/api/... glob, verify with page.on('request')

Show full SKILL.md (338 more words)Show less

CLI Quick Reference

CommandDescription
npx playwright testRun all tests headless
npx playwright test --uiOpen UI mode (interactive)
npx playwright test --headedRun with visible browser
npx playwright test --debugRun with Playwright Inspector
npx playwright test -g "login"Run tests matching pattern
npx playwright test --project=chromiumRun specific project
npx playwright show-reportOpen HTML report
npx playwright codegenGenerate tests by recording
PWDEBUG=1 npx playwright testDebug with Inspector
DEBUG=pw:api npx playwright testVerbose API logging

Red Flags

  • CSS/XPath locators when a role/label/testId is available — brittle and breaks on refactor.
  • waitForTimeout / manual sleeps instead of web-first auto-retrying assertions.
  • Tests sharing state and depending on execution order — flaky and order-coupled.
  • Assertions only on status/URL with no visible-state check — hides render regressions.
  • Inline page setup repeated across tests instead of fixtures — duplication and drift.

References

DocumentContent
Snippets: SetupConfig, auth setup, custom fixtures & logging
Snippets: InteractionsForm interactions, API testing & network interception
Snippets: Viewports & AuthResponsive viewports & authentication patterns
Snippets: Assertions & DebugAssertions, debug commands & utility helpers
Locator Strategies: PriorityLocator priority hierarchy & role-based locators
Locator Strategies: TextLabel, text, placeholder, alt-text & test-ID locators
Locator Strategies: FilteringFiltering, chaining & complex locator patterns
Locator Strategies: Anti & DebugAnti-patterns, CSS last-resort, debugging & quick reference
POM: BasicsPOM concepts, directory structure, base page & fluent API
POM: ComponentsPage object & reusable component object implementation
POM: FixturesCustom & authenticated page-object fixtures
POM: PracticesBest practices, anti-patterns & a complete worked example
Debugging: Tools & UIDebugging tools, UI mode, Inspector & headed mode
Debugging: Tracing & LogsTrace viewer, verbose logging, screenshots & videos
Debugging: Errors & NetworkConsole/page errors & network debugging
Debugging: Flaky & LocatorsFlaky-test fixes, locator debugging & quick commands

Verification

  • Uses custom fixture injection — No new PageObject() calls in spec files; all POMs injected via fixtures
  • Locators use recommended strategies — All locators use getByRole(), getByTestId(), or getByText(); no CSS selectors for interactive elements
  • Tests are independent — Each test sets up and tears down its own state; no beforeAll with shared mutable state
  • Error states covered — At least one test verifies error/empty/loading states alongside happy path

© fugazi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 18 other files (references) in skills/playwright-e2e-testing of fugazi/test-automation-skills-agents.

  • SKILL.md
  • LICENSE.txt
  • references/debugging-errors-network.md
  • references/debugging-flaky-locators.md
  • references/debugging-tools-ui.md
  • references/debugging-tracing-logging.md
  • references/file-map-template.md
  • references/locator-strategies-anti-debug.md
  • references/locator-strategies-filtering.md
  • references/locator-strategies-priority.md
  • references/locator-strategies-text.md
  • references/page-object-model-basics.md
  • references/page-object-model-components.md
  • references/page-object-model-fixtures.md
  • references/page-object-model-practices.md
  • references/snippets-assertions-debugging.md
  • references/snippets-interactions.md
  • references/snippets-setup.md
  • references/snippets-viewports-auth.md

Open the folder on GitHubat commit 65a72d5

Compare with similar skills

Playwright E2E Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Playwright E2E Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright E2E Testing this skillfugazi/test-automation-skills-agents247—~3.2kAutomated safety check: PassMIT
API Testingpetrkindlmann/qa-skills163—~2.7kAutomated safety check: PassMIT
Playwright Login Flowsandrewyng/context-hub14k—~715Automated safety check: PassMIT
Common Tasksidavidov13/agentic-playwright223—~2.5kAutomated safety check: PassMIT
Playwright E2E Builderdavila7/claude-code-templates32k—~5.3kAutomated safety check: NotesMIT
Playwright Automationpetrkindlmann/qa-skills163—~5.5kAutomated safety check: PassMIT

Similar skills

  • API Testing

    petrkindlmann/qa-skills

    Test REST and GraphQL APIs with Playwright APIRequestContext, Supertest, or standalone HTTP clients.

    163 GitHub stars~2.7k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Playwright Login Flows

    andrewyng/context-hub

    Collects reusable Playwright patterns for logging in during end-to-end tests: password forms, OAuth redirects, saved browser state and TOTP two-factor codes.

    14k GitHub stars~715 tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • Common Tasks

    idavidov13/agentic-playwright

    Copy-paste AI prompt templates for common Playwright scaffold development tasks — adding page objects, functional/E2E/API tests, Zod schemas, factories, fixtures, and components.

    223 GitHub stars~2.5k tokensUpdated 6 days ago
    Testing & QAAuto-check passed
  • Playwright E2E Builder

    davila7/claude-code-templates

    Plan and build comprehensive Playwright E2E test suites with Page Object Model, authentication state persistence, custom fixtures, visual regression, and CI integration.

    32k GitHub stars~5.3k tokensUpdated today
    Testing & QAAuto-check: notes
  • Playwright Automation

    petrkindlmann/qa-skills

    Write production-grade Playwright tests in TypeScript: Page Object Model, fixtures, auto-waiting, user-facing locators, parallel execution, CI integration, sharding, and 2025-2026 feature awareness.

    163 GitHub stars~5.5k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Playwright

    secondsky/claude-skills

    Browser automation and E2E testing with Playwright. An agent skill from secondsky/claude-skills.

    227 GitHub stars~3.7k tokensUpdated 9 days ago
    Testing & QAAuto-check: notes

More from fugazi/test-automation-skills-agents

All 10 skills in this repo
  • Accessibility Selenium Testing

    fugazi/test-automation-skills-agents

    Accessibility testing toolkit using Selenium WebDriver 4+ with Java 21+ and axe-core engine.

    247 GitHub stars~2.5k tokensUpdated 4 days ago
    Auto-check passed
  • API Testing

    fugazi/test-automation-skills-agents

    Test REST and GraphQL endpoint contracts using Playwright request fixture (TypeScript) or REST Assured (Java).

    247 GitHub stars~1.5k tokensUpdated 4 days ago
    Auto-check passed
  • QA Manual Istqb

    fugazi/test-automation-skills-agents

    Create QA artifacts from requirements: test plans, test conditions/cases, bug reports, regression suites, traceability, and exploratory charters.

    247 GitHub stars~3.6k tokensUpdated 4 days ago
    Auto-check passed
  • Webapp Selenium Testing

    fugazi/test-automation-skills-agents

    Author and maintain versioned Selenium WebDriver tests with Java and JUnit 5.

    247 GitHub stars~2.8k tokensUpdated 4 days ago
    Auto-check passed
  • A11y Playwright Testing

    fugazi/test-automation-skills-agents

    Accessibility testing for web applications using Playwright (@playwright/test), TypeScript, and axe-core.

    247 GitHub stars~3.2k tokensUpdated 4 days ago
    Auto-check passed
  • Grill Me QA

    fugazi/test-automation-skills-agents

    A guided interview to challenge and validate QA automation plans, test strategies, and framework designs before implementation.

    247 GitHub stars~3.9k tokensUpdated 4 days ago
    Auto-check passed

Categories

Questions about Playwright E2E Testing

What does Playwright E2E Testing do?

Author and maintain versioned Playwright (@playwright/test) TypeScript UI specs for browser user flows. Playwright E2E Testing is an agent skill from fugazi/test-automation-skills-agents. Author and maintain versioned Playwright (@playwright/test) TypeScript UI specs for browser user flows.

When should I use Playwright E2E Testing?

Playwright E2E Testing fits situations like: asked to create; refactor E2E tests; form/navigation/auth flows; responsive checks.

How do I install Playwright E2E Testing in Claude Code?

Run `npx skills add fugazi/test-automation-skills-agents --skill playwright-e2e-testing -a claude-code`. Or copy the skill folder (skills/playwright-e2e-testing in fugazi/test-automation-skills-agents) into .claude/skills/playwright-e2e-testing in your project. Claude Code loads it when a task matches its description.

How do I install Playwright E2E Testing in Codex?

Run `npx skills add fugazi/test-automation-skills-agents --skill playwright-e2e-testing -a codex`. Or copy the skill folder (skills/playwright-e2e-testing in fugazi/test-automation-skills-agents) into .agents/skills/playwright-e2e-testing in your project. Codex loads it when a task matches its description.

Can I use Playwright E2E Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add fugazi/test-automation-skills-agents --skill playwright-e2e-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/playwright-e2e-testing, .gemini/skills/playwright-e2e-testing, .github/skills/playwright-e2e-testing and .opencode/skills/playwright-e2e-testing in your project.

What does Playwright E2E Testing need to run?

Going by SKILL.md and its folder, Playwright E2E Testing needs the command-line tools its instructions call (npx and npm). Our summary lists: Node.js.

Does Playwright E2E Testing access the network?

SKILL.md contains no URLs. Its commands use npx and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Playwright E2E Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Playwright E2E Testing use?

Playwright E2E Testing is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Playwright E2E Testing use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17k tokens, read only when the agent opens those files.

What are the alternatives to Playwright E2E Testing?

Skills that share tags, products or a category with Playwright E2E Testing: API Testing (petrkindlmann/qa-skills, 163 stars), Playwright Login Flows (andrewyng/context-hub, 14k stars), Common Tasks (idavidov13/agentic-playwright, 223 stars) and Playwright E2E Builder (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright E2E Testing?

fugazi (a GitHub user) maintains it in fugazi/test-automation-skills-agents, which has 247 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 3, 2026.

Source: fugazi/test-automation-skills-agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.