From pw
Reviews Playwright test files for 20 anti-patterns, best practices, and coverage gaps. Scores 1-10 per file, generates reports, and offers fixes for critical issues.
npx claudepluginhub arogyareddy/alirezarezvani-claude-skills --plugin pwThis skill uses the workspace's default tool permissions.
Systematically review Playwright test files for anti-patterns, missed best practices, and coverage gaps.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Systematically review Playwright test files for anti-patterns, missed best practices, and coverage gaps.
$ARGUMENTS can be:
testDirplaywright.config.ts for project settings*.spec.ts / *.spec.js files in scopeLoad anti-patterns.md from this skill directory. Check for all 20 anti-patterns.
Critical (must fix):
waitForTimeout() usageexpect(await ...))baseURLawait on Playwright callsWarning (should fix):
8. Tests longer than 50 lines (consider splitting)
9. Magic strings without named constants
10. Missing error/edge case tests
11. page.evaluate() for things locators can do
12. Nested test.describe() more than 2 levels deep
13. Generic test names ("should work", "test 1")
Info (consider):
14. No page objects for pages with 5+ locators
15. Inline test data instead of factory/fixture
16. Missing accessibility assertions
17. No visual regression tests for UI-heavy pages
18. Console error assertions not checked
19. Network idle waits instead of specific assertions
20. Missing test.describe() grouping
Rate 1-10 based on:
For each file:
## <filename> — Score: X/10
### Critical
- Line 15: `waitForTimeout(2000)` → use `expect(locator).toBeVisible()`
- Line 28: CSS selector `.btn-submit` → `getByRole('button', { name: "submit" })`
### Warning
- Line 42: Test name "test login" → "should redirect to dashboard after login"
### Suggestions
- Consider adding error case: what happens with invalid credentials?
If reviewing an entire test suite:
/batch for very large suitesFor each critical issue, provide the corrected code. Ask user: "Apply these fixes? [Yes/No]"
If yes, apply all fixes using Edit tool.