E2

E2E Testing

Test real user flows through the full application stack

Details

Language / Topic
kotlin-jsKotlin/JS
Category
Testing

Rules

balanced
- Write E2E tests for critical user journeys: signup, login, checkout, core workflows.
- Run E2E tests before deploying or merging major features — they catch what unit tests miss.
- Keep E2E tests stable by using data-testid attributes or accessible roles, not brittle CSS selectors.
- Test the happy path of every critical user flow. Add negative cases for important error scenarios.
- Use page object or component object patterns to encapsulate UI interactions and reduce test duplication.
- Set up isolated test data for each test run — never depend on production or shared staging data.
- Add retry logic for flaky network-dependent steps, but investigate and fix flakiness rather than masking it.
- Run E2E tests in CI on every PR. Block merges on E2E failures for critical paths.