E2E (end-to-end testing)
E2E tests (end-to-end) are automated tests that verify an application as a coherent whole by simulating real user behaviour. Instead of checking individual functions in isolation, an E2E test reproduces a complete scenario — for example registering an account, adding a product to the cart and completing checkout — passing through every layer of the system: the interface, server logic, the database and external integrations.
How E2E tests work
An E2E test typically runs in a real or headless browser driven by an automation tool. The test script clicks buttons, fills in forms and reads page content exactly as a human would, then asserts that the application responded correctly. In the classic testing pyramid, E2E tests sit at the very top — there are fewest of them, because they:
- run slower than unit tests and integration tests, since they exercise the entire stack,
- can be flaky — sensitive to network latency and interface asynchronicity,
- require an environment that closely mirrors production.
Popular tools include Playwright, Cypress and Selenium. A good practice is to cover the critical business paths with E2E tests and push logic details down to cheaper, lower-level tests.
E2E testing in practice
E2E tests protect an application's most important flows against regression. They run inside a CI/CD pipeline before each deployment to catch cases where a new change has broken login, payments or order placement. Combined with a TDD approach and a suite of regression tests, they form a safety net that lets a team ship changes faster and with greater confidence that users won't hit a critical bug.
Powiązane pojęcia
Najczęstsze pytania
How do E2E tests differ from unit tests?
A unit test checks a single function or class in isolation, very fast and with no external dependencies. An E2E test boots the whole application and walks through a real user scenario via the interface, engaging the frontend, backend, database and integrations. E2E gives the highest confidence the system works, but is slower and more prone to flaky failures.
