agentleFS
willcoliveirawillcoliveira/qualiow-playwright-skills/skills/indexes/skill.md

playwright-e2e

Skill19 starsChanged 15 days agoMITView on GitHub

Playwright end-to-end testing skills for {{PROJECT_NAME}}: plan, generate, review and debug tests with page objects, web-first assertions, fixtures and a test data strategy. Use when writing, fixing or reviewing Playwright tests, page objects, fixtures or playwright.config.

  • Installs packages

13 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-review.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No substitute exploration: If playwright-cli is unavailable, stop and say so.

    line 48
  2. Very specific:

    Before submitting PRs: run the references/test-review.md checklist

    line 139
  3. Very specific:

    For patterns: check references/playwright-patterns.md for waitForResponse, toPass, expect.poll

    line 141
  4. Very specific:

    Before calling a suite stable: run it N times and report the distribution (references/pass-rate-and-flake-analysis.md), never a single …

    line 142

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

Playwright E2E Skills

What a finished spec looks like

import { test, expect } from '{{#if HAS_CUSTOM_FIXTURE}}{{FIXTURE_IMPORT_PATH}}{{else}}../fixtures{{/if}}' // the project fixtures, never '@playwright/test'

test.describe('Checkout', { tag: ['@smoke'] }, () => {           // one selection tag, in the options object
  test('a signed-in shopper places an order for one item', async ({ checkoutPage }) => {
    await checkoutPage.goto()
    await expect(checkoutPage.placeOrderButton).toBeEnabled()    // web-first: retries until true

    await checkoutPage.placeOrder()                              // page-object action, wrapped in test.step()

    await expect(checkoutPage.confirmation).toHaveText(/Order #\d+ placed/) // the outcome, not "the page loaded"
    await expect(checkoutPage.headerBasketCount).toHaveText('0') // every place the change shows up
    await expect(checkoutPage.placeOrderButton).toBeHidden()     // absence, anchored: it matched above
  })
})

Locators live on the page object as readonly properties, each one resolved against the real page. No page.waitForTimeout(), no { force: true }, no XPath, no retry that turns a failure green. The rules behind each line are in references/conventions.md; the test is verified by watching it fail once, not only by watching it pass.

Operating Procedure

Work in phases and say which one you are in. Detail is in references/workflow.md.

Classify the job → route to the reference → explore the real page, endpoint or failure → plan with a confidence score → stop before applying and wait for approval → apply → verify by running it more than once → report, unknowns included.

Four rules that hold everywhere:

  • Explore before generate. A locator never resolved against a real page is a guess with good syntax.
  • Below 5, emit no plan. A low confidence score means you are still exploring, not that you should attach a caveat to a proposal. Ask the question that would raise it.
  • A skeleton counts as a placeholder. TODO, empty page object methods, a commented-out assertion — all defer the same failure. Placeholders are not deliverables.
  • No substitute exploration. If playwright-cli is unavailable, stop and say so. Never infer selectors from application source.

Decision Tree

What do you need to do?
│
├─ Write a NEW test
{{#if HAS_TEMPLATES}}│  ├─ Plan first        → references/test-planning.md
│  ├─ Generate code     → references/test-generation.md
{{/if}}│  ├─ Locators/asserts  → references/locators-and-assertions.md
│  └─ Review when done  → references/test-review.md
│
├─ Debug a FAILING test
{{#if HAS_TEMPLATES}}│  ├─ Diagnose & fix    → references/test-debugging.md
{{/if}}│  ├─ Agent debugging   → references/agent-debugging.md
│  └─ Flaky on CI       → references/ci-and-flake-triage.md
│
├─ Test an API (no browser)
│  └─ Request context   → references/api-testing-patterns.md
│
├─ Prove DETERMINISM
│  └─ Run it N times    → references/pass-rate-and-flake-analysis.md
│
├─ Understand PATTERNS
│  ├─ Playwright APIs   → references/playwright-patterns.md
│  ├─ Fixtures & auth   → references/fixtures-and-auth.md
{{#if HAS_TEMPLATES}}│  ├─ Page objects      → references/page-object-conventions.md
{{/if}}│  └─ Test data         → references/data-strategy.md
│
├─ Follow CONVENTIONS
│  ├─ MUST/SHOULD/WON'T → references/conventions.md
{{#if HAS_TEMPLATES}}│  └─ This project's rules → references/project-conventions.md
{{/if}}│
├─ Automate a BROWSER   → official `playwright-cli` skill (see below)
│
└─ UNCLEAR what to do   → references/workflow.md

Skill Reference

ReferenceWhen to use
references/playwright-patterns.mdwaitForResponse, toPass, expect.poll, network-first safeguards
references/api-testing-patterns.mdTesting a service over HTTP with no browser: APIRequestContext, per-call credentials, schema contracts, bounded polling, delta assertions, request budgets
references/locators-and-assertions.mdStrict mode, locator composition, soft assertions, aria snapshots, visual comparison, mocking in tests, clock
references/fixtures-and-auth.mdCustom fixtures with base.extend, worker scope, auth via setup projects and storageState
references/data-strategy.mdChoosing between static data and dynamic factories
references/workflow.mdThe phases, the confidence gate, and what not to invent
references/conventions.mdThe MUST / SHOULD / WON'T rules every test follows
references/delegation-rules.mdWhat can be handed off, and what must not be
references/test-review.md7-category review checklist, quality gates, severity levels
references/ci-and-flake-triage.mdRetries, sharding, reporters, describe.configure, test.fail/fixme/slow, flake triage
references/pass-rate-and-flake-analysis.mdProving determinism by running the suite N times: the four outcomes, per-test stability, what to report
references/agent-debugging.md--debug=cli + playwright-cli attach, trace triage from the terminal
{{#if HAS_TEMPLATES}}references/page-object-conventions.mdPOM structure, selectors, component composition
references/project-conventions.mdThis project's own rules, file organization, CI conventions
references/test-debugging.mdFailure patterns, root cause classification, decision tree
references/test-generation.mdTest scaffolding templates, import rules, fixture docs
references/test-planning.mdExploration workflow, test plan template, planning checklist
{{/if}}

{{#if HAS_WORKFLOWS}}## Procedures

Six procedures ship with this skill. On Claude Code, Cursor and GitHub Copilot each is also a command you can invoke directly. Anywhere else — Codex, Gemini CLI, any agent reading .agents/skills/ — ask for one by name and read its file; the content is identical.

ProcedureCommandWhat it does
Plan a new test/playwright-planExplore, then emit a plan with a confidence score and stop
Write a test/playwright-testApply an accepted plan, then verify by running it repeatedly
Debug a failure/playwright-debugReproduce, classify from evidence, fix or report
Review test code/playwright-reviewMechanical pass, then judgement, in that order
Prove determinism/playwright-determinismRun N times and report the distribution
Get a PR's CI green/playwright-ciWatch a PR's CI run and drive it to green or a clear human hand-off

Bodies are in workflows/. Delegation limits are in references/delegation-rules.md.

{{/if}}## Browser automation and agent debugging

Playwright ships its own agent skills; this skill does not duplicate them.

  • playwright-cli drives a browser from the terminal (open, snapshot, click, fill, find, eval, generate-locator, attach). Install into this project with npx playwright cli install --skills (Playwright 1.62+) or npm i -g @playwright/cli@latest && playwright-cli install --skills.
  • playwright-trace inspects trace.zip files from the terminal (npx playwright trace ...). Install with npx playwright trace install-skill.
  • The workflow that ties them together (npx playwright test --debug=cli, playwright-cli attach, trace triage) is in references/agent-debugging.md.

Quick Reference

  • Before writing tests: {{#if HAS_TEMPLATES}}read references/test-planning.md, explore the page (playwright-cli if installed), then write using references/test-generation.md{{else}}explore the page (playwright-cli if installed), then write using the patterns in references/locators-and-assertions.md and references/fixtures-and-auth.md{{/if}}
  • Before submitting PRs: run the references/test-review.md checklist
  • When tests fail: {{#if HAS_TEMPLATES}}follow references/test-debugging.md, {{/if}}{{#if HAS_PLAYWRIGHT_159}}attach with --debug=cli (references/agent-debugging.md), {{/if}}classify the root cause, then fix the test or report the app bug
  • For patterns: check references/playwright-patterns.md for waitForResponse, toPass, expect.poll
  • Before calling a suite stable: run it N times and report the distribution (references/pass-rate-and-flake-analysis.md), never a single green run

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.