golden-rules

1. **`getByRole()` over CSS/XPath** — resilient to markup changes, mirrors assistive technology

Content Preview
# Golden Rules

1. **`getByRole()` over CSS/XPath** — resilient to markup changes, mirrors assistive technology
2. **Never `page.waitForTimeout()`** — use `expect(locator).toBeVisible()` or `page.waitForURL()`
3. **Web-first assertions** — `expect(locator)` auto-retries; `expect(await locator.textContent())` does not
4. **Isolate every test** — no shared state, no execution-order dependencies
5. **`baseURL` in config** — zero hardcoded URLs in tests
6. **Retries: `2` in CI, `0` locally** — surfa
How to Use

Recommended: Install to project (local)

mkdir -p .claude/skills
curl -o .claude/skills/golden-rules.md \
  https://raw.githubusercontent.com/alirezarezvani/claude-skills/main/engineering-team/playwright-pro/reference/golden-rules.md

Skill is scoped to this project only. Add .claude/skills/ to your .gitignoreif you don't want to commit it.

Alternative: Clone full repo

git clone https://github.com/alirezarezvani/claude-skills

Then reference at engineering-team/playwright-pro/reference/golden-rules.md

Related Skills