End-to-end and browser tests
Drive the app the way a person does, through a few journeys that matter. Find elements by role and label, wait for state, and never sleep.
- Required 4
- Recommended 2
Required
Cover only the critical journeys
RequiredWrite end-to-end tests for the few journeys that must never break, such as sign-up, checkout and booking. Leave the details to faster tests.
Find elements the way people do
RequiredFind elements by their role, label or visible text. Never by CSS classes or page structure that change with the design.
Wait for the page to be ready instead of sleeping
RequiredIn every asynchronous test, wait for a condition, such as a heading appearing or a queue emptying. Never pause for a fixed time.
Run browser tests against the production build
RequiredRun end-to-end tests against the same build you deploy, with production settings, not against a development server.
Recommended
Test in more than one browser and size
RecommendedRun the critical journeys in at least two browser engines, at phone and desktop width.
Smoke test every deploy
RecommendedRight after each deploy, run a few fast, read-only tests against the live address. Roll back when one fails.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers testing playbook: https://agentwranglers.se/playbook/testing/end-to-end-and-browser-tests.