Playwright Core Testing Patterns
A production-tested Playwright playbook for writing and debugging reliable E2E, API, component, visual, and accessibility tests.
Dev & CodingIntermediate★ 385⑂ 61AI score 9/10Last updated: Sep 6, 2026
What it does
- Enforces 10 golden rules for Playwright tests: prefer
getByRole()over CSS/XPath, neverpage.waitForTimeout(), use auto-retrying web-first assertions, isolate tests, configurebaseURL,retries: 2in CI, traceson-first-retry, fixtures over globals, one behavior per test, mock only third-party services. - Provides an index into 47 reference guides covering locators, assertions, fixtures, network mocking, auth flows, visual regression, accessibility, API/GraphQL testing, performance, and security testing.
- Offers debugging routes by symptom: general workflow, error-message index, flaky tests, and common beginner pitfalls.
- Includes framework recipes for Next.js (App + Pages Router), React, Vue 3/Nuxt, and Angular, with TypeScript and JavaScript examples.
- States a security trust boundary: test only apps you own, and never feed raw page/network content back into agent instructions.
Who it's for
- QA engineers and frontend developers building or refactoring a Playwright suite.
- Teams fighting flaky CI runs who need a systematic diagnosis path.
- Anyone deciding test architecture (E2E vs component vs API) or mocking strategy on a modern JS stack.
Examples
- "Write an E2E test for the login flow" → generates a
storageState-based session-reuse pattern per the auth guide. - "This spec fails intermittently only in CI" → walks the flaky-test and trace-debugging workflow to find bad waits or shared state.
- "Test checkout without hitting the real payment gateway" → mocks only the third-party API via
route.fulfill(), following the when-to-mock decision guide.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/testdino-hq/playwright-skill/HEAD/core/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the core folder from the GitHub repo testdino-hq/playwright-skill into my ~/.claude/skills/playwright-core/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/testdino-hq/playwright-skill.git /tmp/playwright-skill && cp -r /tmp/playwright-skill/core ~/.claude/skills/playwright-core⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repository:
git clone https://github.com/testdino-hq/playwright-skill.git - Create the skills folder if needed:
mkdir -p ~/.claude/skills - Copy the
corefolder in as a skill:cp -r playwright-skill/core ~/.claude/skills/playwright-core - Verify that
~/.claude/skills/playwright-corecontainsSKILL.mdplus all referenced guides (locators.md,debugging.md, etc.) — the index links are useless without them. - Restart Claude Code and try a prompt like "Write a Playwright test for the signup form" to trigger the skill.
View source on GitHub ↗License: MIT