playwright-automation

playwright-automation is a skill for Claude Code, Codex from petrkindlmann/qa-skills. It costs 177 tokens per session (5,474 once invoked), scanned A, original, MIT.

A guide for writing browser tests with Playwright, a tool that automates real user actions in web browsers, using TypeScript. It covers reusable page structures, test setup, browser coverage, and running tests in CI.

In plain words
What is it for?
Use it to create or migrate end-to-end tests, organize page objects and fixtures, test Chromium, Firefox, and WebKit, and run suites in parallel or across CI workers.
Why use it?
Browser tests often become fragile when they depend on page structure, fixed delays, or poorly isolated setup. This helps make tests wait for meaningful conditions and use locators based on what users see.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

Good fit Use it to create or migrate end-to-end tests, organize page objects and fixtures, test Chromium, Firefox, and WebKit, and run suites in parallel or across CI workers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/petrkindlmann/qa-skills/playwright-automation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add petrkindlmann/qa-skills --skill playwright-automation
Clone the repo
git clone --depth 1 https://github.com/petrkindlmann/qa-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playwright-automation

README.md
[![agentmods](https://agentmods.dev/badge/skills/petrkindlmann/qa-skills/playwright-automation/github.svg)](https://agentmods.dev/skills/petrkindlmann/qa-skills/playwright-automation)
Your own site
<a href="https://agentmods.dev/skills/petrkindlmann/qa-skills/playwright-automation"><img src="https://agentmods.dev/badge/skills/petrkindlmann/qa-skills/playwright-automation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright-automation

Your own site · 80×15
<a href="https://agentmods.dev/skills/petrkindlmann/qa-skills/playwright-automation"><img src="https://agentmods.dev/badge/skills/petrkindlmann/qa-skills/playwright-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 177 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,474 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 22 Oct 2026
  • Snyk pass 22 Oct 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00177 $0.05474
Opus 5.5 $0.00071 $0.02190
Sonnet 5.5 $0.00035 $0.01095
Haiku 4.5 $0.00018 $0.00547

Measured 3d ago against content hash 122994986aee, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

playwright-automation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/playwright-automation/SKILL.md · 479 lines

How it starts

The opening of the file, as written. The whole thing — 479 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Discovery Questions

Check .agents/qa-project-context.md first — if it exists, use it and skip any question answered there. Then ask only what's missing:

  1. TypeScript or JavaScript? Match what the project already uses. For a new suite TypeScript is strongly recommended — it catches locator and assertion mistakes at compile time, and the examples here use it. In a JavaScript project or a fixed .mjs harness, write plain ESM with the same patterns (drop the type annotations), and check it with node --check and --list instead of tsc.
  2. Which browsers? Chromium for local dev; add Firefox and WebKit in CI. Mobile viewports are separate Playwright projects, not separate test files — they change the device descriptor.
  3. Existing suite or fresh start? Migrating from Cypress/Selenium, rewrite the flakiest tests first; never big-bang. Changes the sequencing entirely.
  4. Single site or multi-site? Multi-site needs shared fixtures and per-site config objects — see references/multi-site-architecture.md.

Core Principles

  1. User-facing locators first. getByRole > getByLabel > getByTestId > CSS (last resort). Text and label matching is a case-insensitive substring by default, so getByLabel('Password') also matches "New password" and "Confirm password", hidden fields included, and fails strict mode; pass { exact: true } when labels share words. Locators must reflect what the user sees, not how the DOM is structured. See references/selector-strategies.md.
  2. Auto-waiting — NEVER use waitForTimeout. Every Playwright action and web-first assertion auto-waits. If you think you need a timeout, you need a better locator or assertion.
  3. Test isolation. Each test gets a fresh BrowserContext, but this does not isolate server-side accounts, carts, orders or password changes. Allocate independent records/accounts or a fresh database where tests mutate shared state. Tests must not depend on execution order.
  4. Parallel by default, serial only when necessary. Use fullyParallel: true. Reserve test.describe.serial for flows that genuinely cannot be isolated (rare).
  5. Fixtures for setup, not hooks. Fixtures compose, provide type safety, and tear down automatically. Prefer them over beforeEach/afterEach for anything non-trivial. See references/fixtures-and-projects.md.

Read the full file on GitHub · 479 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed · +1 lines 122994986aee
  2. 5d ago Changed · +17 lines · -5 tokens per session ca3142f0ed93
  3. 1mo ago First seen · 461 lines · 182 tokens per session scan A f2ece1d2ab09

Subscribe to this mod's changes

playwright-automation is a skill published in the GitHub repository petrkindlmann/qa-skills (210 stars, last pushed 3d ago), licensed MIT. It adds 177 tokens to every session and 5,474 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.