Dev tools

End to End Testing: What It Is and How to Start

End to end testing explained: what E2E testing is, an example test, E2E vs integration testing, the best tools and how to avoid flaky tests.

By OmniAI Editorial · Nov 22, 2026 · 10 min read

End to end testing (E2E testing) checks a whole application the way a real user would: it opens the app, clicks through a complete workflow such as signing up, adding an item to a cart and paying, and verifies that every layer, from the user interface through the APIs and services to the database, works together. Unit tests check small pieces in isolation; end to end tests catch the problems that only appear when everything runs together. They're the most realistic tests and also the slowest and most fragile, so teams keep a small number for their most important user journeys.

This guide explains what is E2E testing, shows an end to end testing example with real code, compares end to end testing vs integration testing and unit testing, reviews the best end to end testing tools, and walks through how to start without drowning in slow, flaky tests.

What Is E2E Testing?

E2E testing verifies an entire user journey through a running system. A typical end to end test:

  1. Starts the application in an environment close to production, with a real browser or mobile app.
  2. Performs the steps a user would: navigating, typing, clicking, uploading.
  3. Lets requests flow through the real frontend, backend services, database and sometimes third-party services or their test versions.
  4. Checks the visible result and, where useful, the data left behind.

Because it touches everything, an end to end test can catch failures no other test sees: a frontend sending a field the backend no longer accepts, a misconfigured environment variable, a database migration that broke a query, or a button covered by a cookie banner.

Types of End to End Testing

  • Horizontal E2E testing follows a user journey across the whole application, often across several systems: sign up, receive the confirmation email, log in, buy something.
  • Vertical E2E testing checks one feature through every technical layer, from the UI down to the database and back.
  • UI-driven tests run in a real browser or device and interact like a user.
  • API-level end to end tests call public APIs in sequence to test a full business flow without a browser. They're faster and less brittle, at the cost of not checking the interface.

End to End Testing Example

Here's an end to end testing example for a login flow, written with Playwright, following the patterns in its documentation:

import { test, expect } from '@playwright/test';

test('user can log in and see the dashboard', async ({ page }) => {
  await page.goto('https://staging.example.com/login');
  await page.getByLabel('Email').fill('[email protected]');
  await page.getByLabel('Password').fill(process.env.DEMO_PASSWORD!);
  await page.getByRole('button', { name: 'Sign in' }).click();
  await expect(page).toHaveURL(/dashboard/);
  await expect(page.getByRole('heading', { name: 'Welcome back' })).toBeVisible();
});

What makes this a good E2E test:

  • It follows one real user goal, logging in, from start to finish.
  • It finds elements the way users do, by labels and accessible roles, not fragile CSS paths.
  • It uses web-first assertions. Playwright's expect assertions retry until the condition is met or a timeout passes, and actions auto-wait for elements to be ready, which removes the need for fixed sleeps, a major cause of flaky tests.
  • It keeps secrets out of the code by reading the password from an environment variable.

A fuller suite for an online store might cover: sign up, log in, search and add to cart, checkout with a test payment card, password reset, and an admin refunding an order. That's six to ten tests for the paths that would cost the most if they broke.

A pyramid in three horizontal bands: a wide grey base, a narrower light middle band and a small orange tip.
The test pyramid: many unit tests, fewer integration tests, a few end to end tests.

End to End Testing vs Integration Testing vs Unit Testing

Unit testsIntegration testsEnd to end tests
What they checkOne function or class in isolationTwo or more components working together, such as a service and its databaseA full user journey through the whole system
DependenciesMocked or fakedSome real (database, queue), others mockedReal, or close to real
SpeedMillisecondsSecondsSeconds to minutes per test
ReliabilityVery stableMostly stableMost prone to flakiness
When a test failsPoints to the exact functionPoints to an interface or componentShows something is broken, not always where
Cost to maintainLowMediumHigh
How manyManySomeFew
Who usually writes themDevelopersDevelopersDevelopers and QA engineers

End to end testing vs integration testing: integration tests check that specific pieces fit together, for example that the orders service writes correctly to its database or that two services agree on an API contract. End to end tests check that a whole user goal works through all the pieces at once. Integration tests are narrower and faster; end to end tests are broader and more realistic.

End to end testing vs system testing and UAT: system testing checks the complete system against its requirements, often by a QA team, and overlaps heavily with E2E testing. User acceptance testing (UAT) is done by business users or customers to confirm the software meets their needs; it's about acceptance, not automation, though automated E2E tests can cover the same journeys.

The Test Pyramid

The test pyramid, popularized by Mike Cohn, recommends many fast unit tests at the base, fewer integration tests in the middle and a small number of end to end tests at the top. A widely cited Google Testing Blog post, "Just Say No to More End-to-End Tests," suggested a rough 70/20/10 split between unit, integration and end to end tests, while noting that the exact mix varies by team and that the pyramid shape is what matters.

The reason is cost. End to end tests are slow, so a large suite delays every code change; they're flaky, so failures get ignored; and when they fail, they rarely say where the bug is. A small, focused E2E suite on top of solid unit and integration tests gives most of the safety with a fraction of the pain.

Some teams prefer a "testing trophy" shape with more integration tests, especially for frontends; the principle is the same: don't rely on end to end tests for coverage you can get faster and more precisely lower down.

A light person shape, then ink arrows to a light browser window, a grey box and a grey database cylinder, with an orange check mark below the cylinder.
An end to end test follows one user journey through every layer.

Best End to End Testing Tools

ToolPlatformsLanguagesStrengthsConsider when
PlaywrightChromium, Firefox and WebKit browsersTypeScript/JavaScript, Python, Java, .NETAuto-waiting, parallel runs, tracing, multiple browsers, freeDefault choice for new web projects
CypressChromium-family browsers, Firefox, WebKit (experimental)JavaScript/TypeScriptExcellent developer experience and interactive runnerFrontend teams working mainly in JavaScript
Selenium WebDriverAll major browsersJava, Python, C#, JavaScript, Ruby and moreMature standard, huge ecosystem, Grid for scaleExisting Selenium suites, many languages
WebdriverIOBrowsers and mobile via AppiumJavaScript/TypeScriptFlexible, works with WebDriver and DevTools protocolsJavaScript teams testing web and mobile
AppiumiOS and AndroidManyCross-platform native and hybrid mobile appsMobile E2E testing
DetoxReact NativeJavaScriptFast, gray-box testing of React Native appsReact Native teams
Postman and API test frameworksAPIsJavaScript and othersAPI-level end to end flows without a browserBackend and API journeys

All of the browser tools above are free and open source; commercial platforms add hosted browsers, device clouds, dashboards and, increasingly, AI features that generate or repair tests. Our comparison of Playwright vs Selenium goes deeper on choosing between the main frameworks.

How to Start With End to End Testing

  1. List your critical user journeys. Ask which failures would cost the most: sign up, log in, checkout, core feature. Start with three to five.
  2. Pick one tool that fits your stack; Playwright is a strong default for web apps.
  3. Set up a stable test environment with seeded test data, test payment credentials and feature flags you control.
  4. Write tests that read like user stories, using accessible roles and labels to find elements.
  5. Make each test independent: create its own data and clean up, so tests can run in any order and in parallel.
  6. Run them in CI on every pull request for the critical few, and the full suite on a schedule or before releases.
  7. Record traces, screenshots and videos on failure, so debugging doesn't require rerunning locally.
  8. Track flakiness and fix or quarantine flaky tests quickly; a suite people don't trust is worse than none.

How to Avoid Flaky End to End Tests

Flaky tests pass and fail without code changes. Common causes and fixes:

CauseFix
Fixed waits (sleep) that are too short or too longUse auto-waiting actions and retrying assertions
Selectors tied to layout or CSS classesSelect by role, label or dedicated test IDs
Shared test data between testsCreate fresh data per test, or isolate accounts
Animations and loading spinnersWait for the final state, disable animations in test mode
Third-party services (payments, email)Use sandbox modes or test doubles at the boundary
Time and time zonesFreeze or control the clock in tests
Order-dependent testsMake each test independent so it runs alone
Environment driftRebuild test environments from code

End to End Testing With AI

AI is changing E2E testing in two ways. Tools can now generate test steps from plain-language descriptions, suggest assertions, and repair selectors when the interface changes. And applications with AI features need their own end to end checks: the same prompt can produce different outputs, so tests assert on structure, safety rules or scores from evaluators rather than exact text. Our guide to LLM evaluation covers how to test AI outputs, and our guide to writing unit tests with AI covers the lower layers of the pyramid.

Common Mistakes

  • Trying to test everything end to end. Push edge cases down to unit and integration tests.
  • Testing through the UI what an API test could cover faster.
  • Ignoring flaky tests. Once people rerun failures by habit, the suite stops protecting anything.
  • Depending on production data or real third-party services.
  • No ownership. Tests that nobody maintains rot with every UI change.
  • Running the whole suite on every commit when it takes an hour. Split into a fast critical set and a scheduled full run.

FAQ

What is E2E testing in simple terms?

It's testing the whole application the way a user would, clicking through a complete task like signing up or buying something, to make sure all parts of the system work together.

What is the difference between end to end testing and integration testing?

Integration testing checks that a few components work together correctly, such as a service and its database. End to end testing checks an entire user journey across all components, usually through the real user interface.

Is end to end testing automated or manual?

Both exist. Manual E2E testing is common for exploratory checks, but most teams automate their critical journeys with tools like Playwright, Cypress or Selenium so they run on every change.

How many end to end tests should I have?

Fewer than unit or integration tests. Cover your most important user journeys, often a handful to a few dozen tests, and test details and edge cases at lower levels.

What is the best end to end testing tool?

For new web projects, Playwright is a strong default thanks to auto-waiting and multi-browser support. Cypress suits JavaScript-focused frontend teams, Selenium suits existing suites and many languages, and Appium covers native mobile apps.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog