An E2E test runs the system fully assembled, close to how a person uses it: it opens the interface or sends a request, walks through a “sign-up, order, payment” scenario and checks the result. These are the slowest and most expensive tests in a project, so few are written, only for key paths.
Place in the testing pyramid
| Level | What it checks | Speed and number |
|---|---|---|
| Unit tests | individual functions and classes, with dependencies replaced | milliseconds, thousands of tests |
| Integration tests | several components working together, such as a service with a database | seconds, tens to hundreds |
| End-to-end tests | a whole user scenario through the assembled system | tens of seconds to minutes, a handful |
What an E2E test looks like
An end-to-end test does not have to go through the interface: a scenario can also be run through the application’s public API, which is more reliable. For web interfaces, the typical tool is Playwright: it opens a real browser (Chromium, Firefox, WebKit), clicks elements and waits for a visible result; the tests run locally and in CI.
test('sign-up and order', async ({ page }) => { await page.goto('/register'); await page.getByLabel('Email').fill('user@example.com'); await page.getByRole('button', { name: 'Create account' }).click(); await expect(page.getByText('Welcome')).toBeVisible();});Keeping the cost down
- Check only the key user paths, such as search, cart and payment for an online shop.
- Keep test data known: before it runs, the scenario creates its own user and order.
- Do not put everything into E2E: edge cases and logic are left to unit and integration tests.
- Treat a red test as a signal, not the truth: browser tests often fail because of delays and animations, so rerun them before reworking the code.
Sources
the term is written from these pagesVerified 9 Nov