Playwright best practices
Skill kimtth/agent-skill-100-lines-or-less/skills/playwright-best-practices
🧿 Minimal but effective AI agent skill definitions in 100 lines or less.
npx -y skills add kimtth/agent-skill-100-lines-or-less --skill playwright-best-practicesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when: write or fix Playwright tests with resilient selectors, fixtures, parallelism, and CI.
SKILL.md
1.1 KB, as published. Nobody here has run it
Goal: end-to-end tests that are stable, isolated, and fast in CI.
Use for:
- flaky or slow Playwright suites
- authoring new browser tests that survive UI changes
- configuring CI runs with retries and reporting
Workflow:
- Select by role, label, or test id; avoid CSS/text coupling.
- Use web-first assertions that auto-wait; never sleep fixed time.
- Isolate state per test with fixtures and fresh contexts.
- Set up auth and data via API, not slow UI steps.
- Run in parallel; keep tests independent and order-free.
- Configure retries, traces, and screenshots on failure for CI.
Patterns:
- getByRole/getByTestId over brittle selectors
- expect(locator).toBeVisible() for auto-waiting
- fixtures for shared setup and teardown
- storageState to reuse authentication
Rules:
- no arbitrary waits; rely on auto-waiting assertions
- each test sets up and cleans its own data
- avoid shared mutable state across tests
- capture traces on failure to debug CI flakes