End-to-end tests exercise the full stack — browser → frontend → API → database — simulating real user behaviour. Playwright (Microsoft) is the modern standard: runs Chromium, Firefox, and WebKit. Critical: only E2E-test genuinely critical user journeys (signup, checkout, core feature). Too many E2E tests create a slow, flaky test suite. Page Object Model (POM) abstracts selectors from test logic. Trace viewer and screen recordings aid debugging failures.
Playwright test sharding for fast CI runs.
Each E2E test costs 3-30 seconds. 500 E2E tests = 15-150 minutes of CI. Pick 10-20 truly critical paths (login, core feature, checkout) and cover everything else with unit/integration tests.
Using CSS classes for E2E selectors breaks every time a designer renames a class. data-testid='submit-button' is pure test infrastructure, ignored by production CSS. Never refactored away accidentally.
A test that sometimes passes and sometimes fails trains developers to ignore failures. Track flakiness with Playwright reports, identify flaky selectors, fix root causes. Zero tolerance for flakiness in CI.
Sign in to share your feedback and join the discussion.