← Lessons

quiz vs the machine

Gold1420

Frontend

End To End Testing

Drive a real browser against a running app for full confidence.

5 min read · core · beat Gold to climb

What end to end tests do

An end to end test launches a real browser, navigates to a running build of the app, and drives it like a user across pages. It can hit a real or seeded backend, giving the highest confidence that the whole system works.

The cost

  • Slow browser startup and real navigation take seconds per test.
  • Flaky timing, animations, and network can cause false failures.
  • Expensive to maintain UI changes ripple into many tests.

Keeping them reliable

  • Wait on conditions wait for an element to appear, never a fixed sleep.
  • Seed deterministic data so each run starts from a known state.
  • Isolate tests so they do not depend on order or shared mutations.

Use them sparingly

Reserve end to end tests for the critical paths such as sign up, checkout, or login. Push detailed cases down to faster integration and unit tests.

A small suite of stable end to end tests beats a large flaky one.

Key idea

End to end tests give full confidence on critical paths but are slow and flaky, so keep the suite small.

Check yourself

Answer to earn rating on the learn ladder.

1. How should an end to end test wait for an element?

2. What should end to end tests be reserved for?