E2E Testing in the Browser

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The reference material consulted while preparing these pages is listed in the section bibliography.

End-to-end (E2E) browser testing drives a real browser, or at least a real browser engine, against a running application the way a user would: it types, clicks, navigates and then checks what is on the screen. A single test exercises the whole stack — UI, network, backend, database and third-party integrations — so it gives the most confidence per test and costs the most in speed and maintenance. This section is the tool-focused reference for the three dominant tools, Playwright, Cypress and Selenium, and for the newest way to drive a browser: an AI agent that reads the page and acts on it, with or without a test script.

All version statements in this section were checked on 25 October 2026 against the tools' official documentation and package registries. The baseline is:

  • Playwright 1.64 (Node.js and TypeScript), with the Python, Java and .NET bindings exercised at 1.63. Node.js 22, 24 or 26 is required.

  • Cypress 16.2, which uses cy.env() and Cypress.expose() instead of the removed Cypress.env().

  • Selenium 4.51, with Selenium Manager resolving drivers automatically.

  • W3C WebDriver BiDi, Working Draft of 8 October 2026, and the Model Context Protocol revision 2026-07-28.

  • Chrome DevTools MCP 1.x and Claude’s computer_toolset_20260801 computer-use toolset for the agent pages.

Every page states its own baseline and check date, repeats nothing that the linked reference sections already teach, and says in plain prose when an example could not be executed for a given page and why.

Where E2E tests sit

The test pyramid puts many fast, isolated tests at the bottom and few slow, broad tests at the top. E2E browser tests are the top: they should cover the critical journeys a user cannot do without, not every branch of the logic.

flowchart TB E2E["E2E browser tests: few, slow, highest confidence"] INT["Integration and API tests: some, moderate speed"] UNIT["Unit tests: many, fast, precise failures"] E2E --> INT --> UNIT

Pages such as Test Design & Page Objects explain what to put at the top of the pyramid and how to keep those tests independent and readable.

Who this section is for

It is written for developers and testers who can already write a web application and want automated confidence in it: front-end and full-stack developers choosing a first tool, teams migrating between tools, QA engineers who need cross-browser and visual checks in CI, and anyone who wants to put an AI agent in front of a browser safely. It assumes HTTP, HTML and one programming language; every other concept has its own page.

The Bookshelf example

Every example runs against Bookshelf, a small original demo application: a catalogue with search and pagination, a book detail page with a cover image, reader and admin sign-in, an "add review" form with an optimistic user interface, test-only seed and reset endpoints, light and dark themes and a responsive layout. Elements carry data-testid attributes. Playwright and Cypress examples are TypeScript; Selenium examples are Java with JUnit 5 and Python with pytest, plus other bindings where their behaviour differs. See Example Application & Test Layout for the routes, roles, seed API and project layouts.

Section map

Foundations
Playwright
Cypress
Selenium
Cross-cutting concepts
AI agents in the browser
Closing

Framework-specific E2E examples

Each framework’s own testing page keeps its lightweight E2E examples. This section is the tool-focused reference and does not repeat them:

Comparing programming languages and comparing backend and web frameworks are covered by separate planned reference sections (the language comparison tracked as #196 and the backend and web framework comparison tracked as #263); this section stays on the browser-testing tools themselves.

Bibliography

Every source used to prepare this section is listed here, each linked to its official documentation. Individual pages list the subset they derive from under their own == References heading. No books are used.

Playwright

Cypress

Selenium