E2E Testing Flow
For features that need end-to-end test coverage, use the E2E testing workflow. This creates comprehensive, reliable Playwright test suites for critical user journeys.
Command Sequenceโ
1๏ธโฃ /tsh-research <JIRA_ID or task description>
โณ ๐ Review research doc โ understand feature scope and user journeys
โณ โ
Identify critical paths that need E2E coverage
2๏ธโฃ /tsh-plan <JIRA_ID or task description>
โณ ๐ Review plan โ confirm test scenarios and acceptance criteria
โณ โ
Ensure E2E testing is included in the plan
3๏ธโฃ /tsh-implement-e2e <JIRA_ID or task description>
โณ ๐ Implements Page Objects, test files, and fixtures
โณ โ
Run tests locally, verify they pass
โณ ๐ Iterate on flaky or failing tests
What /tsh-implement-e2e Doesโ
- Agent: E2E Engineer
- Analyzes the application, designs test scenarios, and implements Page Objects.
- Uses Playwright MCP for real-time browser interaction and test verification.
- Follows BDD-style scenarios with proper Arrange-Act-Assert structure.
- Maps acceptance criteria to test scenarios.
- Verifies tests pass consistently (3+ consecutive passes) in headless mode before committing.
What It Producesโ
- Page Objects โ Reusable page abstractions with accessibility-first locators.
- Test files โ Comprehensive test suites following the
should [behavior] when [condition]naming pattern. - Fixtures โ Test data and setup utilities.
- Execution report โ Summary of coverage, results, and any issues found.
Testing Standardsโ
The E2E Engineer agent enforces these standards:
| Standard | Approach |
|---|---|
| Locators | Use getByRole, getByLabel, getByText. Avoid CSS selectors. Use getByTestId only as fallback. |
| Synchronization | Built-in auto-waiting assertions. No waitForTimeout(). No waitForLoadState('networkidle'). |
| Test data | Dynamic data for every run (timestamps/UUIDs). Tests must not depend on state from other tests. |
| Security | Never hardcode credentials. Use environment variables. |
| Naming | should [behavior] when [condition] pattern. |
Important
The /tsh-implement-e2e command generates tests using Playwright MCP for real-time browser interaction. Always run the generated tests locally, review test scenarios for completeness, and verify they cover the critical user journeys identified during research.