agentleFS
tuanductrantuanductran/tester-skills/skills/e2e-testing-playwright/SKILL.md

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".

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
  1. Very specific:

    Read rules/_sections.md for full category descriptions.

    line 62
  2. Very specific:

    When writing a new test, start from locators-role-based and waiting-web-first-assertions — most flakiness starts here.

    line 63
  3. Very specific:

    When triaging a flaky test, check waiting-no-fixed-timeouts and isolation-independent-tests first.

    line 64

≈ “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.

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

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

PriorityCategoryImpactPrefix
1Locator StrategyCRITICALlocators-
2Waiting & AssertionsCRITICALwaiting-
3Test Isolation & DataHIGHisolation-
4Page Object Model & StructureMEDIUMpom-
5CI & ReliabilityMEDIUMci-

Quick Reference

1. Locator Strategy (CRITICAL)

  • locators-role-based - Prefer getByRole/getByLabel/getByText
  • locators-avoid-css-xpath - Avoid structural CSS/XPath selectors

2. Waiting & Assertions (CRITICAL)

  • waiting-no-fixed-timeouts - Never use waitForTimeout in committed tests
  • waiting-web-first-assertions - Use expect(locator).toHave*() over manual reads

3. Test Isolation & Data (HIGH)

  • isolation-independent-tests - Every test independently runnable
  • isolation-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 machines
  • ci-trace-on-retry - Capture traces only on retry

How to Use This Skill

  1. Read rules/_sections.md for full category descriptions.
  2. When writing a new test, start from locators-role-based and waiting-web-first-assertions — most flakiness starts here.
  3. When triaging a flaky test, check waiting-no-fixed-timeouts and isolation-independent-tests first.
  4. As a suite grows past a handful of tests, apply pom-page-object-model to keep locator changes centralized.

See rules/_template.md for the format used by every rule file.

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.