🦀 ClawHub
Playwright Test Helper
by @charlie-morrison
Help write, debug, and optimize Playwright E2E tests — generate page objects, fix flaky selectors, improve test reliability, and speed up test execution.
TERMINAL
clawhub install playwright-test-helper📖 About This Skill
name: playwright-test-helper description: Help write, debug, and optimize Playwright E2E tests — generate page objects, fix flaky selectors, improve test reliability, and speed up test execution. metadata: tags: ["playwright", "testing", "e2e", "automation", "quality"]
Playwright Test Helper
Help write, debug, and optimize Playwright end-to-end tests. Generate page object models, fix flaky selectors, improve test reliability, debug failing tests, and speed up test execution. Use when E2E tests are slow, flaky, or hard to maintain.
Usage
"Help me write Playwright tests for the login flow"
"Fix flaky Playwright tests"
"Generate page objects from my app"
"Speed up my Playwright test suite"
"Debug why this Playwright test fails in CI"
How It Works
1. Project Analysis
cat playwright.config.ts 2>/dev/null || cat playwright.config.js 2>/dev/null
find . -name "*.spec.ts" -o -name "*.test.ts" | grep -i "e2e\|playwright" | head -20
2. Test Generation
From page analysis, generate:
@axe-core/playwright3. Flaky Test Diagnosis
Common flakiness causes and fixes:
await, race conditions → use waitFor, expect().toBeVisible()waitForResponse4. Performance Optimization
fullyParallel: true)5. Best Practices
expect(locator).toBeVisible())page.waitForTimeout() — use proper waitsOutput
## Playwright Test AnalysisTest files: 23 | Total tests: 89 | Avg duration: 4.2s
🔴 Flaky Tests (4)
1. checkout.spec.ts:45 — "processes payment"
Flaky because: click('Submit') before button enabled
Fix: await expect(submitBtn).toBeEnabled(); await submitBtn.click()2. search.spec.ts:12 — "shows results"
Flaky because: page.waitForTimeout(2000) for API
Fix: await page.waitForResponse('/api/search')
⚡ Speed Improvements
Enable fullyParallel: ~45% time reduction
Add storageState for 15 auth-dependent tests: save 30s
Mock /api/analytics for all tests: remove 800ms/test 📊 Projected: 6m 15s → 2m 20s (63% faster)
💡 Examples
"Help me write Playwright tests for the login flow"
"Fix flaky Playwright tests"
"Generate page objects from my app"
"Speed up my Playwright test suite"
"Debug why this Playwright test fails in CI"