Agent skill

Playwright Testing

by aehrc in aehrc/pathling

Expert guidance for writing end-to-end tests with Playwright Test framework.

Apache-2.0Auto-check passedTesting & QA

Install Playwright Testing

skills CLI
$ npx skills add aehrc/pathling --skill playwright-testing -a claude-code

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

GitHub CLI
$ gh skill install aehrc/pathling playwright-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/aehrc/pathling.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/playwright-testing .claude/skills/playwright-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-testing
GitHub stars
137
Token cost
~1.5k tokens
SKILL.md length
209 words
Files
6 (incl. references)
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Expert guidance for writing end-to-end tests with Playwright Test framework.

  • Works in 5 steps: page.getByRole('button', { name:… → page.getByLabel('Email') — Form labels → page.getByText('Welcome') — Visible text → …
  • Writing browser automation tests
  • SKILL.md covers Quick Start, Core Concepts, Test Structure and Configuration, plus 3 more sections
  • Calls npx

What it does

Playwright Testing is an agent skill from aehrc/pathling. Expert guidance for writing end-to-end tests with Playwright Test framework. Use this skill when writing browser automation tests, creating test suites, working with locators and assertions, mocking network requests, handling authentication, or configuring the Playwright test runner. Trigger keywords include "playwright", "e2e test", "end-to-end", "browser test", "getByRole", "locator", "toBeVisible", "page.goto", "test runner".

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/actions.md`, `references/advanced.md` and `references/assertions.md`).

It sits in Testing & QA, covering Browser testing, End-to-end testing and Test generation. It works with Playwright. The repository describes itself as: Tools that make it easier to use FHIR and clinical terminology within data analytics, built on Apache Spark. The licence is Apache-2.0.

When your agent uses it

  • Writing browser automation tests
  • Creating test suites
  • Working with locators and assertions
  • Mocking network requests

Example prompts

  • “playwright”
  • “e2e test”
  • “end-to-end”
  • “/playwright-testing”

Requirements

  • Node.js

Workflow steps

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

  1. page.getByRole('button', { name: 'Submit' }) — ARIA roles (most resilient)
  2. page.getByLabel('Email') — Form labels
  3. page.getByText('Welcome') — Visible text
  4. page.getByTestId('user-menu') — Test IDs (explicit contracts)
  5. page.getByPlaceholder('Search') — Placeholder text

What it can do on your machine

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

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

  • Network

    No URLs in SKILL.md. Its commands use npx, 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 Testing loads about 1.5k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 113 tokens; SKILL.md has 209 words of instructions outside code blocks.

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

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 aehrc/pathling at commit 56a3b4a, republished under its Apache-2.0 licence (© aehrc). 209 words, ~1,542 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-testing/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
playwright-testing
description
Expert guidance for writing end-to-end tests with Playwright Test framework. Use this skill when writing browser automation tests, creating test suites, working with locators and assertions, mocking network requests, handling authentication, or configuring the Playwright test runner. Trigger keywords include "playwright", "e2e test", "end-to-end", "browser test", "getByRole", "locator", "toBeVisible", "page.goto", "test runner".

Playwright Testing

End-to-end testing framework with auto-waiting, web-first assertions, and multi-browser support.

Quick Start

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

test("user can log in", async ({ page }) => {
    await page.goto("/login");
    await page.getByLabel("Email").fill("user@example.com");
    await page.getByLabel("Password").fill("secret");
    await page.getByRole("button", { name: "Sign in" }).click();
    await expect(page.getByText("Welcome")).toBeVisible();
});

Core Concepts

Locators (Priority Order)
  1. page.getByRole('button', { name: 'Submit' }) — ARIA roles (most resilient)
  2. page.getByLabel('Email') — Form labels
  3. page.getByText('Welcome') — Visible text
  4. page.getByTestId('user-menu') — Test IDs (explicit contracts)
  5. page.getByPlaceholder('Search') — Placeholder text

Avoid CSS selectors and XPath—they break with DOM changes.

Chaining and filtering:

typescript
// Chain to narrow scope
page.locator(".modal").getByRole("button", { name: "Save" });

// Filter by text or child elements
page.getByRole("listitem").filter({ hasText: "Product" });
page.getByRole("listitem").filter({ has: page.getByRole("button") });

See references/locators.md for complete locator API.

Assertions

Auto-retrying (use these for web elements):

typescript
await expect(locator).toBeVisible();
await expect(locator).toHaveText("Hello");
await expect(locator).toHaveValue("input text");
await expect(locator).toBeChecked();
await expect(page).toHaveURL(/dashboard/);

Non-retrying (for static values):

typescript
expect(value).toBe(5);
expect(array).toContain("item");
expect(obj).toEqual({ key: "value" });

See references/assertions.md for all assertion types.

Actions
typescript
await locator.click();
await locator.fill("text"); // Clear and type
await locator.pressSequentially("t"); // Character by character
await locator.selectOption("value");
await locator.check(); // Checkbox
await locator.setInputFiles("file.pdf");
await page.keyboard.press("Enter");

All actions auto-wait for elements to be visible, stable, and enabled.

See references/actions.md for complete action reference.

Test Structure

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

test.describe("Feature", () => {
    test.beforeEach(async ({ page }) => {
        await page.goto("/");
    });

    test("scenario one", async ({ page }) => {
        // Arrange - Act - Assert
    });

    test("scenario two", async ({ page }) => {
        // ...
    });
});
Hooks
  • test.beforeEach() / test.afterEach() — Run before/after each test
  • test.beforeAll() / test.afterAll() — Run once per worker

Configuration

Minimal playwright.config.ts:

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

export default defineConfig({
    testDir: "./tests",
    fullyParallel: true,
    retries: process.env.CI ? 2 : 0,
    workers: process.env.CI ? 2 : undefined,
    reporter: "html",
    use: {
        baseURL: "http://localhost:3000",
        trace: "on-first-retry",
    },
    projects: [
        { name: "chromium", use: { ...devices["Desktop Chrome"] } },
        { name: "firefox", use: { ...devices["Desktop Firefox"] } },
        { name: "webkit", use: { ...devices["Desktop Safari"] } },
    ],
    webServer: {
        command: "npm run dev",
        url: "http://localhost:3000",
        reuseExistingServer: !process.env.CI,
    },
});

See references/configuration.md for all options.

CLI Commands

bash
npx playwright test                    # Run all tests
npx playwright test --ui               # Interactive UI mode
npx playwright test --headed           # Show browser
npx playwright test --debug            # Step-through debugger
npx playwright test -g "login"         # Filter by title
npx playwright test --project=chromium # Specific browser
npx playwright test --last-failed      # Retry failures only
npx playwright codegen                 # Generate tests
npx playwright show-report             # View HTML report

Advanced Features

Network Mocking
typescript
await page.route("**/api/users", (route) =>
    route.fulfill({ json: [{ id: 1, name: "Mock User" }] }),
);

await page.route("**/api/error", (route) => route.fulfill({ status: 500 }));
Authentication State
typescript
// Save auth state after login
await page.context().storageState({ path: "auth.json" });

// Reuse in config
use: {
    storageState: "auth.json";
}
Fixtures
typescript
const test = base.extend<{ userPage: Page }>({
    userPage: async ({ browser }, use) => {
        const context = await browser.newContext();
        const page = await context.newPage();
        await page.goto("/login");
        // ... login
        await use(page);
        await context.close();
    },
});

See references/advanced.md for network mocking, auth patterns, fixtures, and Page Object Model.

Best Practices

  1. Use role-based locators — getByRole() is most resilient to changes
  2. Prefer auto-retrying assertions — await expect(locator).toBeVisible() not locator.isVisible()
  3. Keep tests isolated — Each test gets fresh browser context
  4. Avoid hardcoded waits — Playwright auto-waits; use explicit waits only for custom conditions
  5. Test user behaviour — Focus on what users see, not implementation details
  6. Use soft assertions sparingly — expect.soft() continues after failure for comprehensive reports

© aehrc, Apache-2.0. 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 .claude/skills/playwright-testing of aehrc/pathling.

  • SKILL.md
  • references/actions.md
  • references/advanced.md
  • references/assertions.md
  • references/configuration.md
  • references/locators.md

Open the folder on GitHubat commit 56a3b4a

Compare with similar skills

Playwright 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 Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright Testing this skillaehrc/pathling137—~1.5kAutomated safety check: PassApache-2.0
Open BrowserJasonHonKL/Openbrowser114—~1.6kAutomated safety check: PassMIT
Uat Testingooiyeefei/ccc494—~2.7kAutomated safety check: NotesMIT
Playwright E2E Builderdavila7/claude-code-templates32k—~5.3kAutomated safety check: NotesMIT
Playwrightmagnus919/agent-skills111—~3.4kAutomated safety check: NotesMIT
Playwrightsecondsky/claude-skills227—~3.7kAutomated safety check: NotesMIT

Similar skills

  • Open Browser

    JasonHonKL/Openbrowser

    A skill your agent uses whenever the task involves browsing web pages, extracting page content, clicking forms, or completing web workflows.

    114 GitHub stars~1.6k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Uat Testing

    ooiyeefei/ccc

    End-to-end User Acceptance Testing for web applications. An agent skill from ooiyeefei/ccc.

    494 GitHub stars~2.7k tokensUpdated 2 mo ago
    Testing & QAAuto-check: notes
  • 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

    magnus919/agent-skills

    Operate Playwright for browser automation end to end: author and debug E2E test suites (robust locators, network interception and mocking, parallel workers, accessibility snapshot checks), wire them…

    111 GitHub stars~3.4k tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • 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
  • Official

    Drives a real browser from the command line with playwright-cli to open pages, interact, mock requests, save state and work with Playwright tests.

    5.3k GitHub starsUsed in 23 repos~2.8k tokens
    Testing & QAAuto-check passed

More from aehrc/pathling

All 25 skills in this repo
  • Fhir API

    aehrc/pathling

    Expert guidance for implementing FHIR RESTful API servers and clients following the HL7 FHIR specification.

    137 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Fhir Bulk Data

    aehrc/pathling

    Expert guidance for implementing FHIR Bulk Data Access (Flat FHIR) following the HL7 specification.

    137 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Databricks CLI

    aehrc/pathling

    Expert guidance for using the Databricks CLI to manage Databricks workspaces, clusters, jobs, pipelines, Unity Catalog, SQL warehouses, serving endpoints, secrets, bundles, and all other Databricks…

    137 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Fhir Search Spec

    aehrc/pathling

    FHIR RESTful search specification expert with access to the official HL7 search specification text and the formal SearchParameter registry.

    137 GitHub stars~649 tokensUpdated today
    Auto-check passed
  • Design and generate comprehensive FHIRPath test suites using input domain partitioning and Pathling's DSL test framework.

    137 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Hapi Fhir Server

    aehrc/pathling

    Expert guidance for implementing FHIR servers using HAPI FHIR Plain Server framework.

    137 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Playwright Testing

What does Playwright Testing do?

Expert guidance for writing end-to-end tests with Playwright Test framework. Playwright Testing is an agent skill from aehrc/pathling. Expert guidance for writing end-to-end tests with Playwright Test framework.

When should I use Playwright Testing?

Playwright Testing fits situations like: writing browser automation tests; creating test suites; working with locators and assertions; mocking network requests.

How do I install Playwright Testing in Claude Code?

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

How do I install Playwright Testing in Codex?

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

Can I use Playwright 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 aehrc/pathling --skill playwright-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-testing, .gemini/skills/playwright-testing, .github/skills/playwright-testing and .opencode/skills/playwright-testing in your project.

What does Playwright Testing need to run?

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

Does Playwright Testing access the network?

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

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

Playwright Testing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Playwright Testing use?

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

What are the alternatives to Playwright Testing?

Skills that share tags, products or a category with Playwright Testing: Open Browser (JasonHonKL/Openbrowser, 114 stars), Uat Testing (ooiyeefei/ccc, 494 stars), Playwright E2E Builder (davila7/claude-code-templates, 32k stars) and Playwright (magnus919/agent-skills, 111 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright Testing?

aehrc (a GitHub organization) maintains it in aehrc/pathling, which has 137 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 7, 2026.

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