playwright-best-practices
Skill3 starsChanged 3 months agoMITView on GitHub
Writes, reviews, and debugs Playwright tests for web apps with stable locators, fixtures, auth setup, API mocking, trace debugging, responsive checks, accessibility assertions, and CI reliability. Use when creating Playwright tests, fixing flaky e2e tests, debugging traces, testing UI flows, or configuring browser tests.
20 other projects use a version of this.
Adopted by
Most recently taken up by
- figueroaignacio/ignaciofigueroa.devtheir own version, first seen Nov 8, 2026
- ever-co/ever-workstheir own version, first seen Nov 8, 2026
- ever-works/ever-workstheir own version, first seen Nov 5, 2026
- lecluse-net/galaristheir own version, first seen Oct 30, 2026
- lcx9451/dsh-engineering-skill-packtheir own version, first seen Oct 25, 2026
- Tgoldi/claude-skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use nodejs-backend-patterns, next-cache-components and 9 more.
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.
xfstudioSkillnodejs-backend-patterns
Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices. Use when creating Node.js servers, REST APIs, GraphQL backends, or microservices architectures.
Also in 5 projects that use this
VercelSkillnext-cache-components
Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag
Also in 4 projects that use this
VercelSkillnext-upgrade
Upgrade Next.js to the latest version following official migration guides and codemods
Also in 3 projects that use this
midudevSkilltailwind-css-patterns
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.
Also in 3 projects that use this
KadajettSkillnestjs-best-practices
NestJS best practices and architecture patterns for building production-ready applications. This skill should be used when writing, reviewing, or refactoring NestJS code to ensure proper patterns for modules, dependency injection, security, and performance.
Also in 3 projects that use this
xenitV1Skillnodejs-best-practices
Node.js development principles and decision-making. Framework selection, async patterns, security, and architecture. Teaches thinking, not copying.
Also in 3 projects that use this
- +1 more from vercel-labs
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- sanity-io/sanity★ 6.4ksame name
- currents-dev/playwright-best-practices-skill★ 420same name
- tazo90/next-openapi-gen★ 196same name
- ever-co/ever-works★ 190same name
- ever-works/ever-works★ 190same name
- flpbalada/fb-skills★ 8same name
- figueroaignacio/ignaciofigueroa.dev★ 7same name
- lcx9451/dsh-engineering-skill-pack★ 3same name
- dennisgr7/snob-cli★ 2same name
- idexal/idexal-skills★ 2same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- api-designSkill
- backend-craftSkill
- meilisearchSkill
- design-coreSkill
- design-datavizSkill
- design-flowsSkill
- design-formsSkill
- design-product-uiSkill
- design-researchSkill
- design-reviewSkill
- design-slidesSkill
- design-systemsSkill
- design-webSkill
- agent-syncSkill
- build-autonomous-agentsSkill
- coding-disciplineSkill
- completion-gateSkill
- deliver-dependency-upgradesSkill
- documentation-and-adrsSkill
- grill-harness-with-docsSkill
- learn-agentic-engineeringSkill
- pnpmSkill
- scaffold-harnessSkill
- scaffold-monorepoSkill
- shift-left-securitySkill
- start-gateSkill
- update-harnessSkill
- write-a-skillSkill
- frontend-craftSkill
- ansible-automationSkill
- gitea-actionsSkill
- gitea-teaSkill
- manage-infrastructure-as-codeSkill
- multi-stage-dockerfileSkill
- secure-linux-web-hostingSkill
- integrate-product-complianceSkill
- plain-numbersSkill
- product-craftSkill
- run-product-engineeringSkill
- testing-strategiesSkill
- writing-coreSkill
- writing-editorialSkill
- writing-engineeringSkill
- writing-marketingSkill
- writing-productSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 11 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 20 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this for browser-level tests that should behave like a reliable user.
- Distinctive: line 14
Read existing Playwright config, fixtures, helpers, test ids, auth setup, route mocks, and CI commands.
- Distinctive: line 16
Follow the repo's locator strategy.
- Distinctive: line 18
Keep assertions tied to user-visible behavior and accessibility semantics.
- Distinctive: line 19
Do not add sleeps to hide race conditions.
- Distinctive: line 23
Prefer role, label, text, and stable test ids over CSS selectors.
- Distinctive: line 25
Keep tests isolated and repeatable.
- Distinctive: line 30
Use fixtures for auth and shared setup.
- Distinctive: line 33
Keep mobile/responsive tests explicit when layout or touch behavior matters.
- Very specific: line 46
Use getByRole when semantics are stable and meaningful.
- Very specific: line 47
Use getByLabel for form controls.
- Distinctive: line 48
Use project test ids for complex widgets or localized copy.
- Distinctive: line 49
Avoid nth-child selectors unless testing ordered content explicitly.
“Common” is measured: kept by at least 6 in 10 of the 20 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.
Files
Playwright Best Practices
Use this for browser-level tests that should behave like a reliable user.
Project Fit Check
Before writing tests:
- Read existing Playwright config, fixtures, helpers, test ids, auth setup, route mocks, and CI commands.
- Follow the repo's locator strategy.
- Reuse existing page objects/helpers only when they reduce duplication.
- Keep assertions tied to user-visible behavior and accessibility semantics.
- Do not add sleeps to hide race conditions.
Test Rules
- Prefer role, label, text, and stable test ids over CSS selectors.
- Assert the outcome, not every implementation step.
- Keep tests isolated and repeatable.
- Leaving a page through a client-side navigation is not finished when the
click returns. Wait for the destination before starting the next navigation:
a
gotointo a navigation still in flight aborts it, and the failure is intermittent, which in a release gate means the gate decides by coin toss. - Use fixtures for auth and shared setup.
- Mock external services at the boundary when real services make tests slow or flaky.
- Keep mobile/responsive tests explicit when layout or touch behavior matters.
Debugging Flow
- Reproduce with the smallest test command.
- Inspect trace, screenshot, console, and network output.
- Identify whether the failure is product bug, selector drift, async race, data setup, browser difference, or environment issue.
- Fix the cause, not the timeout.
- Re-run the failed test and any nearby coverage.
Locator Rules
- Use
getByRolewhen semantics are stable and meaningful. - Use
getByLabelfor form controls. - Use project test ids for complex widgets or localized copy.
- Avoid nth-child selectors unless testing ordered content explicitly.
Red Flags
waitForTimeoutgotoimmediately after a click that navigates- broad CSS selectors
- tests depend on run order
- production third-party service required for normal CI
- assertion passes before async work completes
- UI changed but accessibility name no longer matches intent
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
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.

