Bookmarks

E2E — end-to-end test

A test that checks the assembled application as a whole through a user scenario, from the interface to the database and external services.

Also: end-to-end testing, E2E test, E2E testing

checked 9 Nov

All terms

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

LevelWhat it checksSpeed and number
Unit testsindividual functions and classes, with dependencies replacedmilliseconds, thousands of tests
Integration testsseveral components working together, such as a service with a databaseseconds, tens to hundreds
End-to-end testsa whole user scenario through the assembled systemtens 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.

typescript
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 pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • integration test

    An integration test checks the seam between two or three components, while an E2E test checks the user’s whole path through the assembled system.

  • UATuser acceptance testing

    UAT is performed by the people accepting the system; E2E tests automate similar scenarios and act as a safety net before acceptance.

In depth in the references

where the topic is covered in detail