06-testing

End-to-End Testing

06-testing/end-to-end-testing

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

PathE2E worth it?
LoginYes
Small utility changeUsually no
Revenue or data integrity pathYes

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.


Further Reading