playwright-tests
Installation
SKILL.md
Quick Reference
The Golden Rules
- Use role-based locators - Never CSS classes unless absolutely necessary
- Assert absence broadly, presence specifically - Wide net for "not there", scoped for "is there"
- Never use timeouts or networkidle - Wait for visible effects only
- Improve accessibility while testing - Tests drive better markup
- Wait for user-visible changes - Not implementation details like network requests
- Set up portable contracts through the UI - Never inject application state through cookies, storage, databases, or framework internals
Anti-Patterns to Avoid
❌ page.waitForTimeout(1000) - Arbitrary waits (flaky)
❌ page.waitForLoadState('networkidle') - Unreliable
❌ page.waitForResponse(...) - Implementation detail
❌ page.locator('.css-class') - Fragile selectors
❌ Adding test IDs when accessibility markup would work
❌ Hardcoding dynamic store data names (e.g., collection titles from sortKey: UPDATED_AT queries)