e2e-testing-playwright
Skill0 starsChanged 4 months agoMITView on GitHub
End-to-end (E2E) browser testing guidelines for Playwright. Use this skill whenever writing, reviewing, or debugging Playwright tests, choosing locators, diagnosing flaky tests, structuring Page Objects, or configuring CI for an E2E suite. Triggers on tasks involving *.spec.ts Playwright files, page.locator/getByRole usage, requests to "write an e2e test", "automate this flow", "fix this flaky test", or "set up Playwright CI".
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- api-testingSkill
- integration-testingSkill
- performance-testingSkill
- unit-testing-vitestSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 62
Read rules/_sections.md for full category descriptions.
- Very specific: line 63
When writing a new test, start from locators-role-based and waiting-web-first-assertions — most flakiness starts here.
- Very specific: line 64
When triaging a flaky test, check waiting-no-fixed-timeouts and isolation-independent-tests first.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
E2E Testing (Playwright)
Guidelines for writing stable, fast end-to-end tests with Playwright. Contains 9 rules across 5 categories, prioritized by impact on flakiness and maintainability.
When to Apply
Reference these guidelines when:
- Writing a new Playwright test for a user flow
- Choosing locators for elements on a page
- Diagnosing a flaky or intermittently failing E2E test
- Structuring a growing suite with Page Objects
- Setting up or tuning Playwright in CI (sharding, retries, tracing)
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
| 1 | Locator Strategy | CRITICAL | locators- |
| 2 | Waiting & Assertions | CRITICAL | waiting- |
| 3 | Test Isolation & Data | HIGH | isolation- |
| 4 | Page Object Model & Structure | MEDIUM | pom- |
| 5 | CI & Reliability | MEDIUM | ci- |
Quick Reference
1. Locator Strategy (CRITICAL)
locators-role-based- Prefer getByRole/getByLabel/getByTextlocators-avoid-css-xpath- Avoid structural CSS/XPath selectors
2. Waiting & Assertions (CRITICAL)
waiting-no-fixed-timeouts- Never use waitForTimeout in committed testswaiting-web-first-assertions- Use expect(locator).toHave*() over manual reads
3. Test Isolation & Data (HIGH)
isolation-independent-tests- Every test independently runnableisolation-seed-via-api- Seed data via API, not UI
4. Page Object Model & Structure (MEDIUM)
pom-page-object-model- Encapsulate locators/actions per page
5. CI & Reliability (MEDIUM)
ci-parallel-sharding- Shard suites across CI machinesci-trace-on-retry- Capture traces only on retry
How to Use This Skill
- Read
rules/_sections.mdfor full category descriptions. - When writing a new test, start from
locators-role-basedandwaiting-web-first-assertions— most flakiness starts here. - When triaging a flaky test, check
waiting-no-fixed-timeoutsandisolation-independent-testsfirst. - As a suite grows past a handful of tests, apply
pom-page-object-modelto keep locator changes centralized.
See rules/_template.md for the format used by every rule file.
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.

