e2e-testing

Installation
SKILL.md

End-to-End (E2E) Testing

E2E tests validate complete user journeys through the real UI, backend and data store. They are the most realistic and the most expensive tests: keep few, make them critical, make them reliable.

Which journeys deserve an E2E test

  • Money/conversion: search → cart → checkout → payment sandbox → confirmation (payment-ecommerce-testing).
  • Identity: sign-up, sign-in, OAuth redirect, password reset, logout, session expiry.
  • Core data mutation: create → edit → save → reload and verify persistence → delete.
  • Error recovery: validation errors, network failure banner, retry, empty states.
  • Permissions: the same journey per role (admin vs member vs read-only). Everything else belongs at API/component level (test-architect). Target a suite you can run in < 15 min with sharding.

Golden rules

  1. User-facing locators first: getByRole, getByLabel, getByText; then getByTestId; avoid brittle CSS/XPath (div > span:nth-child(3)) and styling classes.
  2. Auto-wait, never sleep. Assert on conditions: await expect(page.getByRole('alert')).toBeVisible().
  3. Independent tests. Each test sets up its own data via API and starts from a clean context; log in via stored auth state, not the UI, every time.
  4. Control the world: stub or sandbox third parties, freeze time when relevant, seed deterministic data (test-environment-management).
  5. Evidence on failure: trace, video, screenshot, console and network logs, retained as CI artifacts.
  6. One journey per test, with meaningful assertions at each milestone (not 40 clicks then one assert).
Installs
5
GitHub Stars
4
First Seen
Oct 23, 2026