GuidesEnd-to-end testing
Thinking about end-to-end testing for the web
How to build an end-to-end testing strategy for a web app that gives your team real confidence as you ship, with Playwright tests that catch real failures.
End-to-end tests drive real browsers against your running application. They catch failures across the whole stack and act as clear representations of user behavior that your team can review.
Here is a real failing test on a pull request for BikeBook, an example bike-booking web application. This replay demonstrates the value of end-to-end tests:
- They exercise real user behaviors across the whole stack.
- They catch real application failures before code merges.
- They produce reviewable artifacts for passing and failing runs alike.
Why end-to-end tests matter more now
Implementation code has become cheap to write and rewrite, especially as teams rely on coding agents to ship changes faster. Unit tests are usually generated right alongside that code, rarely written or reviewed by hand, so a passing unit test suite does not provide the same level of confidence it used to.
Unit tests also live inside the boundaries of your implementation. They mock out the browser, HTTP requests, form serialization, and database queries, which means they can stay green while a broken form field, a missing server check, or a hydration race fails for real users. And when you refactor internals, those tests often have to be rewritten along with the code they were meant to check.
End-to-end tests work differently. They evolve separately from your implementation and express what a user should actually be able to do in a browser. You can change frameworks, reorganize components, or rewrite an endpoint, and the suite keeps verifying the same product contract while staying dependable, reliable, and reviewable.
Core pillars of an end-to-end testing strategy


What to test
The role of an end-to-end testing suite is to reflect the way your users actually use your application, as closely as possible. Think about how people use your product day to day, rank the flows that matter most, write down the steps they take on a piece of paper, and translate those flows into repeatable, deterministic tests that convince you your users can still use your app regardless of what changes you are making.
We use Playwright, the most popular open-source framework for end-to-end testing, to express that intent as code. Code is a reviewable artifact that both engineers and coding agents work well with; your job is to make sure your user intentions are expressed accurately by that code. To make it even easier to connect user intentions written as text to deterministic, reviewable Playwright code, we recommend using playwright-intent to express your tests.
When to test
If you want to understand how your application is changing before your users do, it is important to run your suite before deploying to users.
Run end-to-end tests as close as possible to where you are making changes. Most often that means running the suite on pull requests before code merges, and it is also common to run it on main while shipping something new.
How to maintain your suite
An end-to-end suite is a tool that lets you quickly and reliably exercise your application. You get far more out of that tool when you check in on and tune its performance and reliability as your suite grows:
- Make test data repeatable. Clicking through sign-up forms works for your first few tests. As the suite grows, identify the preconditions your flows share (in BikeBook, a signed-in user and an office bike fleet) and create them programmatically so tests stay fast and isolated.
- Actively work with flakiness. End-to-end test suites have a reputation for being flaky, but in most cases the problem is not just the test. Many flakes point to real issues in your application, which is why they cannot be ignored. While building BikeBook, investigating intermittent failures surfaced a stale booking banner that stayed on screen after cancellation, a date input that dropped dates typed before hydration, and a role check that let any team member send invites. Actively working through flakes improves both your test suite and your application, and with coding agents helping inspect failures and fix root causes, keeping reliability high is straightforward.
What getting there looks like
Ideally, your test suite grows organically alongside your application. Starting with a few of the most important flows and expanding as you build is much easier than trying to retrofit a hundred tests onto an existing app all at once.
- Setup in the UI
- Setup via API
- Flow under test
0% of test time is setup · illustrative timings
Each guide in this section puts one of the pillars above into practice:
- 0 to 1 test (Set up a Playwright suite): nail when to test first by getting one real user flow running on Endform on every pull request.
- 1 to 10 tests (Your first 10 tests): apply what to test across your core product domains, and take the first step towards repeatable test data by creating users programmatically.
- 10 to 100 tests (From 10 to 100 tests): put how to maintain your suite into practice by expanding scenario data beyond auth, holding pass rates near 99% with a weekly flake check, and keeping parallel runs fast.
As your suite grows, the companion guides cover keeping parallel runs fast in Speed up your suite, keeping noise out in Zero flaky tests, and reviewing changes visually in Replays.
Start where you are
Go from zero to one real user-flow test running on Endform on every pull request.
Your first 10 testsCover your core product domains in 10 tests and remove repeated UI sign-up with programmatic users.
From 10 to 100 testsExpand programmatic scenario data, survive the flake cliff, and keep 100 parallel tests as fast as 10.
Last updated