End-to-End Testing
Overview
End-to-end tests verify that the user can complete a full workflow through the real application path.
Why It Matters
They protect the most important journeys, like sign-in, checkout, or feature completion.
Core Concepts
- Test the full user flow.
- Use realistic environments where possible.
- Keep the number of E2E tests focused.
Mental Models
E2E tests are expensive, so reserve them for journeys that truly matter.
Best Practices
- Cover critical paths only.
- Make failures easy to diagnose.
- Keep selectors stable.
Common Mistakes
- Testing everything end to end.
- Writing fragile UI selectors.
- Letting the suite become too slow.
Trade-offs
E2E tests offer the most realistic confidence, but they are the slowest and most fragile test type.
Decision Framework
| Path | E2E worth it? |
|---|---|
| Login | Yes |
| Small utility change | Usually no |
| Revenue or data integrity path | Yes |
Examples
- Log in, edit settings, and verify the saved result.
Checklists
- Is this a critical user flow?
- Is the test stable and readable?
- Can the failure be debugged quickly?
Senior Engineer Notes
Senior engineers use E2E tests sparingly and intentionally. They are for confidence in the journey, not for replacing all other tests.