Content Preview
# Playwright Anti-Patterns Reference
## 1. Using `waitForTimeout()`
**Bad:**
```typescript
await page.click('.submit');
await page.waitForTimeout(3000);
await expect(page.locator('.result')).toBeVisible();
```
**Good:**
```typescript
await page.getByRole('button', { name: 'Submit' }).click();
await expect(page.getByTestId('result')).toBeVisible();
```
**Why:** Arbitrary waits slow tests and cause flakiness. Web-first assertions auto-retry.
## 2. Non-Web-First Assertions
**Bad:**
```typescrHow to Use
Recommended: Install to project (local)
mkdir -p .claude/skills
curl -o .claude/skills/anti-patterns.md \
https://raw.githubusercontent.com/alirezarezvani/claude-skills/main/engineering-team/playwright-pro/skills/review/anti-patterns.mdSkill 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-skillsThen reference at engineering-team/playwright-pro/skills/review/anti-patterns.md
Related Skills
Testing Anti-Patterns
Never test mock behavior. Never add test-only methods to production classes. Understand dependencies before mocking.
testing-anti-patternstesting antipatterns
by Jesse Vincent (community) · obra-superpowers-skills
cs-senior-engineer
Senior Engineer agent for architecture decisions, code review, DevOps, and API design. Orchestrates engineering and engineering-team skills for technical implementation work. Spawn when users need system design, code quality review, CI/CD pipeline setup, or infrastructure decisions.
agentsseniorengineeragent
by alirezarezvani · alirezarezvani-claude-skills
cs-engineering-lead
Engineering Team Lead agent for coordinating QA, security, data engineering, ML, and frontend/backend teams. Orchestrates engineering-team skills for team-level technical decisions. Spawn when users need team coordination, tech stack evaluation, incident response, or cross-functional engineering work.
agentsengineeringleadagent
by alirezarezvani · alirezarezvani-claude-skills
api_antipatterns
Common API Anti-Patterns and How to Avoid Them
engineeringapiantipatterns
by alirezarezvani · alirezarezvani-claude-skills