End-to-End Test (E2E)
In one line
An E2E test drives a real browser through your application just like a user would, verifying the complete flow works from UI to database and back.
In simple words
An E2E test is the most realistic test you can write. It opens a real browser, navigates to your app, clicks buttons, fills forms, and checks that the right things happen — exactly like a human user would.
Think of it as a robot tester that follows a script: 'go to the login page, type the username, type the password, click login, check that the dashboard appears.' It tests everything: the UI, the backend, the database, the network — the entire end-to-end flow.
E2E tests are powerful but expensive: they're slow (seconds, not milliseconds), brittle (break on minor UI changes), and hard to maintain. Use them sparingly for critical user flows, not for every possible scenario.
Example
// Playwright E2E test
test('user can log in', async ({ page }) => {
await page.goto('https://app.example.com/login');
await page.fill('#username', 'alice');
await page.fill('#password', 'secret');
await page.click('button[type="submit"]');
await expect(page).toHaveURL(/dashboard/);
});This test opens a real browser, navigates to the login page, fills in credentials, and verifies the redirect to dashboard.
Common confusions
Confused with: Integration Test
The difference: E2E tests go through the UI and the entire stack; integration tests check internal module connections without the UI.
Related terms
Related Resources
Related Lessons
- E2E Testing
End-to-end testing overview.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.