/e2e Command
This command invokes the e2e-runner agent to generate, maintain, and execute end-to-end tests using Playwright.What This Command Does
- Generate Test Journeys - Create Playwright tests for user flows
- Run E2E Tests - Execute tests across browsers
- Capture Artifacts - Screenshots, videos, traces on failures
- Upload Results - HTML reports and JUnit XML
- Identify Flaky Tests - Quarantine unstable tests
When to Use
Use/e2e when:
- Testing critical user journeys (login, trading, payments)
- Verifying multi-step flows work end-to-end
- Testing UI interactions and navigation
- Validating integration between frontend and backend
- Preparing for production deployment
Command Syntax
Description of the user flow to test end-to-end
Examples
Basic Usage
Generated Test Example
Test Artifacts
On All Tests:- HTML Report with timeline and results
- JUnit XML for CI integration
- Screenshot of the failing state
- Video recording of the test
- Trace file for debugging (step-by-step replay)
- Network logs
- Console logs
Viewing Artifacts
Browser Configuration
Tests run on multiple browsers by default:- ✅ Chromium (Desktop Chrome)
- ✅ Firefox (Desktop)
- ✅ WebKit (Desktop Safari)
- ✅ Mobile Chrome (optional)
Best Practices
DO:- ✅ Use Page Object Model for maintainability
- ✅ Use data-testid attributes for selectors
- ✅ Wait for API responses, not arbitrary timeouts
- ✅ Test critical user journeys end-to-end
- ✅ Run tests before merging to main
- ✅ Review artifacts when tests fail
- ❌ Use brittle selectors (CSS classes can change)
- ❌ Test implementation details
- ❌ Run tests against production
- ❌ Ignore flaky tests
- ❌ Skip artifact review on failures
- ❌ Test every edge case with E2E (use unit tests)
CI/CD Integration
Quick Commands
Related
- Agent:
~/.claude/agents/e2e-runner.md - Commands:
/tdd,/verify,/code-review