E2E Tests and Visual Regression Tests: The Full User Path
- date
- category
- Testing
- reading
- 3 min / 524 words
The easiest test to believe is the one that looks like real system use.
Open the page.
Log the user in.
Add a product.
Pay.
Check confirmation.
That is an E2E test, an end-to-end test.
What kind of test this is
E2E test checks a complete path through the system.
In a web application that usually means:
browser
frontend
backend
database
external integrations or controlled fakes
The point is not to check every case.
The point is to confirm that a critical path really composes into a working system.
Examples:
login
purchase
account creation
password reset
post publication
onboarding flow
Why E2E cannot be everything
E2E is expensive.
It is slower than lower layers.
It has more possible causes of failure.
It depends on data, environment, time, browser, network, animations, and integrations.
If E2E tries to replace unit tests, component tests, and integration tests, it starts catching everything.
validation bug
selector bug
migration bug
session bug
configuration bug
dependency timeout
One red test then does not say what broke.
It only says the path did not pass.
That is why E2E should protect a small number of the most important flows.
Acceptance tests
Acceptance test describes behavior from the perspective of requirements.
It can be E2E, but it does not have to be.
Its question is:
does the system satisfy the acceptance condition?
For example:
a user with an active subscription can download an invoice
a user without permissions cannot see the admin panel
an order after payment moves to paid
If an acceptance test runs through the browser and crosses the whole system, it is also E2E.
If it works at the API or domain module level, it can still be an acceptance test, but it is not E2E.
Visual regression tests
Visual regression test compares appearance.
Most often it takes a screenshot and compares it with an approved image.
It catches bugs normal assertions do not see:
clipped text
shifted layout
missing button
wrong contrast
responsive regression
A visual regression test does not say logic works.
It says appearance changed or did not change.
It is a great tool for components, design systems, landing pages, dashboards, and PDFs.
But like a snapshot, it requires reading the diff.
Automatically accepting the image change without looking at the difference kills the point of the test.
Tool from the stack
For E2E and visual regression tests I would choose Playwright.
It fits React applications well because it tests the system through a real browser while still giving control over context, storage, requests, and screenshots.
For visual regression I would use Playwright screenshot assertions.
For E2E in the pipeline I would keep a small set of critical paths:
login
checkout
permissions
publication
password reset
Cypress is also reasonable, but in this stack I would choose Playwright for multi-browser coverage, parallelism, and stronger tracing tools.
How to limit flaky E2E
A good E2E test needs a stable world.
controlled data
deterministic login
no dependency on test order
waiting for state, not sleep
fake for external payments
data cleanup after the test
The worst E2E test waits 5000 ms and hopes the environment catches up.
A flaky E2E test is dangerous because the team quickly learns to ignore it.
And an ignored red test is worse than no test, because it creates a false ritual of control.
When E2E is right
E2E makes sense where a broken flow would be expensive:
registration
payment
publication
permissions
checkout
account recovery
It does not make sense to use E2E for every field validation, every mapper branch, and every error message.
Those should move lower.
E2E is the final confirmation that the layers really work together.
The next test type answers a different question: whether a bug that passed once can return the same way. Those are regression tests and smoke tests.