Playwright Testing Protocol
When the user requests browser automation or E2E tests:
- Analyze the user flow or feature to be tested.
- Define test scenarios covering happy paths and edge cases.
- Generate Playwright test code with:
- Proper selectors (prefer
data-testidattributes) - Assertions for visual and functional validation
- Error handling and retry logic
- Proper selectors (prefer
- Execute tests and capture screenshots/videos on failure.
- Report results with clear pass/fail status and debugging artifacts.
Best Practices:
- Use page object models for complex flows
- Implement proper wait strategies (avoid hard waits)
- Test across multiple browsers when critical
- Capture network requests for API validation