common-pitfalls

**Symptom:** Slow, flaky tests.

Content Preview
# Common Pitfalls (Top 10)

## 1. waitForTimeout

**Symptom:** Slow, flaky tests.

```typescript
// BAD
await page.waitForTimeout(3000);

// GOOD
await expect(page.getByTestId('result')).toBeVisible();
```

## 2. Non-Web-First Assertions

**Symptom:** Assertions fail on dynamic content.

```typescript
// BAD — checks once, no retry
const text = await page.textContent('.msg');
expect(text).toBe('Done');

// GOOD — retries until timeout
await expect(page.getByText('Done')).toBeVisible();
```

## 3
How to Use

Recommended: Install to project (local)

mkdir -p .claude/skills
curl -o .claude/skills/common-pitfalls.md \
  https://raw.githubusercontent.com/alirezarezvani/claude-skills/main/engineering-team/playwright-pro/reference/common-pitfalls.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/common-pitfalls.md

Related Skills