What is end-to-end testing?
Definition
End-to-end testing checks a complete user journey through the real, assembled system: the interface, the backend services, the database and the integrations between them. An end-to-end test acts like a user, for example signing up or placing an order, and passes only if every layer along that path does its part.
How does an end-to-end test work?
In end-to-end testing, each test plays a user and follows one journey all the way through: from the first page, through every service the request touches, to the data that ends up stored. A typical run looks like this:
- Start a realistic environment. The real front end, backend, database and queues, wired the way production is. ISTQB notes that system integration testing "requires suitable test environments preferably similar to the operational environment" (ISTQB Foundation Level syllabus v4.0.1, dated September 2024).
- Prepare data. Create the user, product or account the journey needs, ideally through an API rather than through the UI.
- Drive the interface. Open pages, fill fields and click buttons the way a customer would.
- Assert what the user sees. A confirmation, a total, an error message.
- Assert the outcome behind the page. The order exists with the right status, the email was queued, the payment was captured.
- Leave nothing behind. Each test gets its own data and session, so the next one starts clean.
Step 5 is the one most suites skip, and the example below shows why it matters.
How is end-to-end testing different from integration, system and UI testing?
The terms overlap, and teams use them loosely. The ISTQB syllabus does not list end-to-end as a test level of its own. It describes system testing as "often including functional testing of end-to-end tasks", and places "complex, high-level, end-to-end tests" at the top of the test pyramid.
| What it covers | Talks to real dependencies? | Typical speed | |
|---|---|---|---|
| Unit test | One function or class | No, uses test doubles | Milliseconds |
| Integration test | Two or more components, such as a service and its database | Some | Seconds |
| Contract test | The messages between one consumer and one provider | No, each side runs alone | Seconds |
| UI test | Screens and interactions, often with a mocked backend | Often not | Seconds |
| End-to-end test | One full user journey across all layers | Yes | Seconds to minutes per journey |
The practical difference is the question each one answers. A UI test asks whether the screen behaves. An end-to-end test asks whether the business transaction worked.
Example: an end-to-end test in CodeceptJS
CodeceptJS is the open-source JavaScript test framework created by SDCLabs founders. A scenario reads like the user journey, and one test can use a browser and an HTTP client side by side. The CodeceptJS docs explain that its REST and GraphQL helpers were first built "to perform API requests for browser tests" (CodeceptJS API testing), which is what step 5 needs.
The app under test is a small Node.js shop: a form posts an order, the server stores it in memory, redirects to a confirmation page, and exposes the stored orders at /api/orders.
// tests/checkout_test.js
Feature('Checkout')
Scenario('customer places an order and it is stored as paid', async ({ I }) => {
// Through the UI, as a customer would
I.amOnPage('/')
I.fillField('Email', 'ana@example.com')
I.fillField('Quantity', '2')
I.click('Place order')
I.see('Order 1 confirmed')
I.see('2 items for ana@example.com')
// Then check the backend state, not only the page
I.sendGetRequest('/api/orders')
I.seeResponseCodeIsSuccessful()
I.seeResponseContainsJson({ email: 'ana@example.com', qty: 2, status: 'paid' })
})
// codecept.conf.js
import { server } from './app.js'
export const config = {
tests: './tests/*_test.js',
output: './output',
noGlobals: true,
helpers: {
Playwright: { url: 'http://localhost:3123', browser: 'chromium', show: false, chromium: { channel: 'chrome' } },
REST: { endpoint: 'http://localhost:3123' },
JSONResponse: {},
},
bootstrap: () => new Promise((ok) => server.listen(3123, ok)),
teardown: () => new Promise((ok) => server.close(ok)),
}
We ran it on 2026-11-19 with CodeceptJS 4.2.5, its Playwright helper driving Chrome 157, on Node.js 22.23.5 (the codeceptjs npm package declares Node.js 22.12.0 or newer). Output of npx codeceptjs run --steps, with local paths removed:
Checkout --
customer places an order and it is stored as paid
I am on page "/"
I fill field "Email", "ana@example.com"
I fill field "Quantity", "2"
I click "Place order"
I see "Order 1 confirmed"
I see "2 items for ana@example.com"
I send get request "/api/orders"
I see response code is successful
I see response contains json {"email":"ana@example.com","qty":2,"status":"paid"}
✔ OK in 806ms
OK | 1 passed // 1s
Then we planted a bug: the server saved new orders as pending instead of paid. The confirmation page still looked perfect. Every UI step passed, and only the backend check failed the run, with exit code 1 (excerpt):
✖ customer places an order and it is stored as paid in 787ms
No elements in array matched {"email":"ana@example.com","qty":2,"status":"paid"}
FAIL | 0 passed, 1 failed // 1s
A suite that stops at I.see('Order 1 confirmed') would have shipped this bug.
Which user journeys deserve an end-to-end test?
End-to-end testing is the most expensive layer to run and to keep alive, so spend it where a failure costs real money or trust:
- sign-up, login and password reset;
- checkout, payment and refunds;
- any journey that crosses three or more services or a third-party system you depend on;
- flows with legal weight, such as consent, data export or account deletion.
Leave the rest to cheaper tests. Field validation rules, permission combinations and price calculations belong in unit and API tests. Our test automation guide explains how to split a suite across levels.
How do you keep end-to-end tests stable?
Most instability comes from the test, not the product. The Playwright best practices guide is written for Playwright Test, but most of it carries over to any browser framework:
- Isolation. Each test runs "with its own local storage, session storage, data, cookies etc.", so one failure cannot cascade into the next.
- Only test what you control. Do not drive third-party pages. Stub them with network routing and "guarantee the response needed".
- Web-first assertions. Assertions that wait until the condition is met, instead of fixed sleeps.
- Traces for CI failures. Record a trace on the first retry of a failed test; Playwright advises against recording traces on every test, as that is "very performance heavy".
In a microservice system, do not try to cover every service pair with full journeys. Pact's documentation makes the case for contract tests: you "find out before you deploy whether or not your applications will work together - there is no need to wait for slow e2e tests" (Pact docs, page last updated April 2022). Keep a few journeys end to end and check the rest of the seams with contracts.
Want journeys like the checkout above, written so product owners can read them? See how CodeceptJS structures scenarios, or ask our QA and test automation team to pick and cover the journeys that matter in your product.
Sources
- Certified Tester Foundation Level Syllabus v4.0.1, ISTQB, 2024-09-15
- API Testing, CodeceptJS docs, 2026-11
- codeceptjs 4.2.5, npm, 2026-11
- Best Practices, Playwright docs (Microsoft), 2026-11
- When to use Pact, Pact docs (Pact Foundation), 2022-04-13
Frequently asked questions
Should end-to-end tests be manual or automated?
Automate the critical journeys, because they need to run on every release and a person clicking through them gets slow and inconsistent. Keep manual, exploratory sessions for new features and for usability, where judgment matters more than repetition.
What are the best end-to-end testing tools?
For web apps, the common open-source choices are Playwright, Cypress, Selenium WebDriver and CodeceptJS (built by SDCLabs founders, it runs on top of Playwright or WebDriver). Pick by the languages your team writes, the browsers you must support and whether non-developers need to read the tests.
How many end-to-end tests should you have?
As few as cover your most valuable journeys. A useful check: if a test fails, would the business want to stop the release? If not, that check probably belongs at the unit or API level.
What is end-to-end testing in microservices?
It is a journey test that crosses several services at once. Because each extra service adds setup and failure points, teams keep a handful of these journeys and verify the individual service connections with contract tests.
Services
Read next
Related terms
Mikhail BodnarchukFounder of Codeception and CodeceptJSBoth are open-source testing frameworks: Codeception for PHP, CodeceptJS for JavaScript.LinkedInGitHub