Agent skill

Playwright Expert

by Jeffallan in Jeffallan/claude-skills

Writes and debugs Playwright end-to-end tests with page objects, role-based locators, fixtures, API mocking, traces and CI setup.

MITAuto-check passedTesting & QA

Install Playwright Expert

skills CLI
$ npx skills add Jeffallan/claude-skills --skill playwright-expert -a claude-code

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

GitHub CLI
$ gh skill install Jeffallan/claude-skills playwright-expert --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/Jeffallan/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/playwright-expert .claude/skills/playwright-expert && 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-expert
GitHub stars
12k
Token cost
~1.4k tokens
SKILL.md length
231 words
Files
6 (incl. references)
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

Writes and debugs Playwright end-to-end tests with page objects, role-based locators, fixtures, API mocking, traces and CI setup.

  • Works in 5 steps: Analyze requirements - Identify user… → Setup - Configure Playwright with proper… → Write tests - Use POM pattern, proper… → …
  • Writing end-to-end tests for login, checkout or other user flows
  • SKILL.md covers Core Workflow, Reference Guide, Constraints and Code Examples, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The agent identifies the user flows to cover, configures Playwright, writes tests using the Page Object Model, sensible selectors and auto-waiting, debugs failures by running the test, reading the trace, fixing and verifying, and adds the suite to the CI/CD pipeline. Output includes page object classes, test files with proper assertions, fixture setup when needed and configuration recommendations.

The rules prefer role-based selectors, independent tests with no shared state, traces and screenshots for debugging and parallel runs. They rule out waitForTimeout, CSS class selectors, ignoring flaky tests and first or nth calls without a reason. Reference files cover selectors and locator priority, page objects and fixtures, route interception for API mocking, playwright.config.ts and debugging flaky tests with the trace viewer.

When your agent uses it

  • Writing end-to-end tests for login, checkout or other user flows
  • Refactoring repeated browser steps into page objects
  • Diagnosing flaky Playwright tests with the trace viewer
  • Mocking API responses by intercepting routes
  • Configuring Playwright reporters and CI runs

Example prompts

  • “Write a Playwright test for the login flow using a LoginPage page object.”
  • “This checkout test fails one run in five, so use the trace to find out why.”
  • “Mock the /api/products response so the listing test does not need the backend.”
  • “Set up playwright.config.ts with traces and screenshots enabled and tests running in parallel.”

Requirements

  • The Playwright test runner (`@playwright/test`)

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Analyze requirements - Identify user flows to test
  2. Setup - Configure Playwright with proper settings
  3. Write tests - Use POM pattern, proper selectors, auto-waiting
  4. Debug - Run test → check trace → identify issue → fix → verify fix
  5. Integrate - Add to CI/CD pipeline

What it can do on your machine

Read from SKILL.md and the folder at commit 1be15d8. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

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

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • synergetic.solutions
    • jeffallan.github.io

    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 Expert loads about 1.4k tokens when it runs, and up to ~5.5k if it reads all its reference files. Until then it costs about 111 tokens; SKILL.md has 231 words of instructions outside code blocks.

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

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 Jeffallan/claude-skills at commit 1be15d8, republished under its MIT licence (© Jeffallan). 231 words, ~1,433 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-expert/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
playwright-expert
description
Use when writing E2E tests with Playwright, setting up test infrastructure, or debugging flaky browser tests. Invoke to write test scripts, create page objects, configure test fixtures, set up reporters, add CI integration, implement API mocking, or perform visual regression testing. Trigger terms: Playwright, E2E test, end-to-end, browser testing, automation, UI testing, visual testing, Page Object Model, test flakiness.
license
MIT
metadata.author
https://github.com/Jeffallan
metadata.company
https://synergetic.solutions
metadata.version
1.1.0
metadata.domain
quality
metadata.triggers
Playwright, E2E test, end-to-end, browser testing, automation, UI testing, visual testing
metadata.role
specialist
metadata.scope
testing
metadata.output-format
code
metadata.related-skills
test-master, react-expert, devops-engineer

Playwright Expert

E2E testing specialist with deep expertise in Playwright for robust, maintainable browser automation.

Core Workflow

  1. Analyze requirements - Identify user flows to test
  2. Setup - Configure Playwright with proper settings
  3. Write tests - Use POM pattern, proper selectors, auto-waiting
  4. Debug - Run test → check trace → identify issue → fix → verify fix
  5. Integrate - Add to CI/CD pipeline

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Selectorsreferences/selectors-locators.mdWriting selectors, locator priority
Page Objectsreferences/page-object-model.mdPOM patterns, fixtures
API Mockingreferences/api-mocking.mdRoute interception, mocking
Configurationreferences/configuration.mdplaywright.config.ts setup
Debuggingreferences/debugging-flaky.mdFlaky tests, trace viewer

Constraints

MUST DO
  • Use role-based selectors when possible
  • Leverage auto-waiting (don't add arbitrary timeouts)
  • Keep tests independent (no shared state)
  • Use Page Object Model for maintainability
  • Enable traces/screenshots for debugging
  • Run tests in parallel
MUST NOT DO
  • Use waitForTimeout() (use proper waits)
  • Rely on CSS class selectors (brittle)
  • Share state between tests
  • Ignore flaky tests
  • Use first(), nth() without good reason

Code Examples

Selector: Role-based (correct) vs CSS class (brittle)
typescript
// ✅ Role-based selector — resilient to styling changes
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByLabel('Email address').fill('user@example.com');

// ❌ CSS class selector — breaks on refactor
await page.locator('.btn-primary.submit-btn').click();
await page.locator('.email-input').fill('user@example.com');
Page Object Model + Test File
typescript
// pages/LoginPage.ts
import { type Page, type Locator } from '@playwright/test';

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

  constructor(page: Page) {
    this.page = page;
    this.emailInput = page.getByLabel('Email address');
    this.passwordInput = page.getByLabel('Password');
    this.submitButton = page.getByRole('button', { name: 'Sign in' });
    this.errorMessage = page.getByRole('alert');
  }

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

  async login(email: string, password: string) {
    await this.emailInput.fill(email);
    await this.passwordInput.fill(password);
    await this.submitButton.click();
  }
}
typescript
// tests/login.spec.ts
import { test, expect } from '@playwright/test';
import { LoginPage } from '../pages/LoginPage';

test.describe('Login', () => {
  let loginPage: LoginPage;

  test.beforeEach(async ({ page }) => {
    loginPage = new LoginPage(page);
    await loginPage.goto();
  });

  test('successful login redirects to dashboard', async ({ page }) => {
    await loginPage.login('user@example.com', 'correct-password');
    await expect(page).toHaveURL('/dashboard');
  });

  test('invalid credentials shows error', async () => {
    await loginPage.login('user@example.com', 'wrong-password');
    await expect(loginPage.errorMessage).toBeVisible();
    await expect(loginPage.errorMessage).toContainText('Invalid credentials');
  });
});
Debugging Workflow for Flaky Tests
typescript
// 1. Run failing test with trace enabled
// playwright.config.ts
use: {
  trace: 'on-first-retry',
  screenshot: 'only-on-failure',
}

// 2. Re-run with retries to capture trace
// npx playwright test --retries=2

// 3. Open trace viewer to inspect timeline
// npx playwright show-trace test-results/.../trace.zip

// 4. Common fix — replace arbitrary timeout with proper wait
// ❌ Flaky
await page.waitForTimeout(2000);
await page.getByRole('button', { name: 'Save' }).click();

// ✅ Reliable — waits for element state
await page.getByRole('button', { name: 'Save' }).waitFor({ state: 'visible' });
await page.getByRole('button', { name: 'Save' }).click();

// 5. Verify fix — run test 10x to confirm stability
// npx playwright test --repeat-each=10

Output Templates

When implementing Playwright tests, provide:

  1. Page Object classes
  2. Test files with proper assertions
  3. Fixture setup if needed
  4. Configuration recommendations

Knowledge Reference

Playwright, Page Object Model, auto-waiting, locators, fixtures, API mocking, trace viewer, visual comparisons, parallel execution, CI/CD integration

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

© Jeffallan, 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 5 other files (references) in skills/playwright-expert of Jeffallan/claude-skills.

  • SKILL.md
  • references/api-mocking.md
  • references/configuration.md
  • references/debugging-flaky.md
  • references/page-object-model.md
  • references/selectors-locators.md

Open the folder on GitHubat commit 1be15d8

Compare with similar skills

Playwright Expert 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 Expert compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright Expert this skillJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
Playwright Testingchongdashu/vibejam-starter-pack149—~2.2kAutomated safety check: PassNone
Playwright Expertcin12211/orca-q224—~1.3kAutomated safety check: PassMIT
Web Testing with Playwright and Vitestwithkynam/vibecode-pro-max-kit1.1k—~892Automated safety check: PassApache-2.0
Playwright ExpertAratKruglik/claude-laravel155—~824Automated safety check: PassNone
Playwright Automationpetrkindlmann/qa-skills165—~5.5kAutomated safety check: PassMIT

Similar skills

  • Playwright Testing

    chongdashu/vibejam-starter-pack

    Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.

    149 GitHub stars~2.2k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Playwright Expert

    cin12211/orca-q

    Playwright E2E testing expert for browser automation, cross-browser testing, visual regression, network interception, and CI integration.

    224 GitHub stars~1.3k tokensUpdated 17 days ago
    Testing & QAAuto-check passed
  • Web Testing with Playwright and Vitest

    withkynam/vibecode-pro-max-kit

    Covers web testing from unit to E2E, load, visual, accessibility and security checks, with Playwright, Vitest and k6 guides plus a Playwright setup script.

    1.1k GitHub stars~892 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Playwright Expert

    AratKruglik/claude-laravel

    A skill your agent uses when writing E2E tests with Playwright, setting up test infrastructure, or debugging flaky browser tests.

    155 GitHub stars~824 tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • 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.

    165 GitHub stars~5.5k tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • Playwright Pro

    borghei/Claude-Skills

    End-to-end testing with Playwright: test generation, page objects, locator strategy, flaky- test diagnosis, visual regression, and CI integration.

    881 GitHub stars~2k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from Jeffallan/claude-skills

All 58 skills in this repo
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Auto-check passed
  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 2 repos~1.2k tokens
    Auto-check passed
  • Fine-Tuning Expert

    Jeffallan/claude-skills

    Guides LLM fine-tuning with LoRA and QLoRA through Hugging Face PEFT, from dataset validation and training checks to adapter merging, quantization and deployment.

    12k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • GraphQL Architect

    Jeffallan/claude-skills

    Designs GraphQL schemas and Apollo Federation graphs, with DataLoader resolvers, subscriptions, query complexity limits and caching.

    12k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Kubernetes Specialist

    Jeffallan/claude-skills

    Creates and checks Kubernetes manifests, Helm charts, RBAC and network policies, and helps debug pod problems, with kubectl checks and rollback steps.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Laravel Specialist

    Jeffallan/claude-skills

    Builds Laravel 10+ applications with Eloquent models, Sanctum authentication, Horizon queues, API resources and Livewire components, tested with Pest or PHPUnit.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed

Works with

Categories

Questions about Playwright Expert

What does Playwright Expert do?

Writes and debugs Playwright end-to-end tests with page objects, role-based locators, fixtures, API mocking, traces and CI setup. The agent identifies the user flows to cover, configures Playwright, writes tests using the Page Object Model, sensible selectors and auto-waiting, debugs failures by running the test, reading the trace, fixing and verifying, and adds the suite to the CI/CD pipeline. Output includes page object classes, test files with proper assertions, fixture setup when needed and configuration recommendations.

When should I use Playwright Expert?

Playwright Expert fits situations like: writing end-to-end tests for login, checkout or other user flows; refactoring repeated browser steps into page objects; diagnosing flaky Playwright tests with the trace viewer; mocking API responses by intercepting routes.

How do I install Playwright Expert in Claude Code?

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

How do I install Playwright Expert in Codex?

Run `npx skills add Jeffallan/claude-skills --skill playwright-expert -a codex`. Or copy the skill folder (skills/playwright-expert in Jeffallan/claude-skills) into .agents/skills/playwright-expert in your project. Codex loads it when a task matches its description.

Can I use Playwright Expert 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 Jeffallan/claude-skills --skill playwright-expert -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-expert, .gemini/skills/playwright-expert, .github/skills/playwright-expert and .opencode/skills/playwright-expert in your project.

What does Playwright Expert need to run?

SKILL.md names no scripts, command-line tools or credentials: Playwright Expert is instructions for the agent only. Our summary lists: The Playwright test runner (`@playwright/test`).

Does Playwright Expert access the network?

SKILL.md names 3 domains. As links in the text: github.com, synergetic.solutions and jeffallan.github.io. This is read from the text; nothing was executed.

Is Playwright Expert 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 Expert use?

Playwright Expert is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Playwright Expert use?

About 1.4k tokens (SKILL.md is roughly 5.7k 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 4k tokens, read only when the agent opens those files.

What are the alternatives to Playwright Expert?

Skills that share tags, products or a category with Playwright Expert: Playwright Testing (chongdashu/vibejam-starter-pack, 149 stars), Playwright Expert (cin12211/orca-q, 224 stars), Web Testing with Playwright and Vitest (withkynam/vibecode-pro-max-kit, 1.1k stars) and Playwright Expert (AratKruglik/claude-laravel, 155 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright Expert?

Jeffallan (a GitHub user) maintains it in Jeffallan/claude-skills, which has 11,767 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on October 3, 2026.

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