skip to content

[ compare · web testing frameworks ]

e2e vs playwright

Playwright and e2e both run end-to-end tests in a real browser from TypeScript or JavaScript. Playwright runs the locators and actions you wrote, in four languages. e2e adds goals an agent completes beside the same kind of locators, and runs the same test on iOS and Android.

[ at a glance ]

what each tool is.

  • made by, license

    [ e2e ]

    e2e, apache-2.0

    [ playwright ]

    microsoft, apache-2.0

  • platforms

    [ e2e ]

    Chromium, Firefox, and WebKit through Playwright. iOS simulators, Android emulators, and connected phones through agent-device.

    [ playwright ]

    Chromium, Firefox, WebKit. Mobile browsers are emulated.

  • languages

    [ e2e ]

    TypeScript, JavaScript

    [ playwright ]

    TypeScript, JavaScript, Python, Java, .NET

  • test steps

    [ e2e ]

    Locators and assertions, plus agent goals and agent assertions in the same test

    [ playwright ]

    Locators, actions, and web-first assertions

  • finding elements

    [ e2e ]

    Role, label, text, and test id queries on screen. A string must match the whole name. An action needs exactly one match.

    [ playwright ]

    The same queries on page. A string matches part of the name, ignoring case. An action needs one match, and isVisible() takes the first.

  • when ai is used

    [ e2e ]

    At run time, when a step needs it. Verified goals replay without model calls. Locator steps never call a model.

    [ playwright ]

    While you write tests, through Playwright agents and MCP. The run itself is deterministic.

  • what a run costs

    [ e2e ]

    CI minutes, plus model calls when a goal has no recording yet or an agent judges a check. The model is your own subscription, key, or local model.

    [ playwright ]

    CI minutes

  • tooling

    [ e2e ]

    CLI, an e2e mcp session for coding agents, a trace.md page per failed test, a markdown summary, a video per attempt

    [ playwright ]

    Trace viewer, UI mode, codegen, VS Code extension, HTML report

[ the same test ]

the same test,written both ways.

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

test('checkout', async ({ page }) => {
  await page.goto('/cart');
  await page.getByRole('button', { name: 'Checkout' }).click();
  await page.getByLabel('Card number').fill('4242424242424242');
  await page.getByLabel('Expiry').fill('12/30');
  await page.getByLabel('CVC').fill('123');
  await page.getByRole('button', { name: 'Pay' }).click();
  await expect(page.getByRole('heading')).toHaveText('Order confirmed');
});
e2e
import { test } from '@e2e-dev/web';
import { expect } from 'e2e';

test('checkout', async ({ app, agent, screen }) => {
  await app.open('/cart');
  await agent.act('pay with the test card 4242 4242 4242 4242, expiry 12/30, CVC 123');
  await expect(screen.getByRole('heading')).toHaveText('Order confirmed');
});

The agent does the checkout steps and adapts when the form changes. The navigation and the final assertion stay exact. A fully scripted version also works, with one screen.getBy* line for each page.getBy* line.

[ differences ]

the five main differences.

  • writing a test

    In Playwright, every step is code. A step is a locator, an action, or an assertion, and Playwright waits for the element underneath.

    e2e keeps the same queries on screen, but stricter. A string must match the whole name, and an action needs exactly one match.

    e2e also adds agent.act, a goal in plain language. The goal returns when it is done and throws when it fails. An exact assertion after it checks the result. Scripted steps and goals live in one file.

  • when ai is used

    Playwright's agents work while you write tests. npx playwright init-agents sets up a planner, a generator, and a healer. The planner writes a test plan, the generator writes spec files, and the healer reruns failing tests and repairs them, or skips a test when it believes the feature is broken. The run itself never calls a model.

    In e2e, the first run of a goal uses the model: the agent works out the clicks from the screen. Once a later assertion passes, the runner saves those clicks as a recording. Every run after that replays the recording, with no model call.

    If the UI changes and a recorded click no longer applies, the agent takes over for that goal and the runner saves a new recording. In CI, --strict-cache turns that into a failure instead, so a replayed goal never calls a model there. A test with only locator steps never calls a model at all.

  • native mobile apps

    Playwright emulates mobile browsers: viewport, user agent, touch, geolocation, and locale. It does not drive native apps.

    e2e's mobile engine runs the same agent, screen, and expect on iOS simulators, Android emulators, and connected phones. The examples cover Expo, SwiftUI, Jetpack Compose, Kotlin Multiplatform, Flutter, and .NET MAUI. toHaveScreenshot compares a browser, an iOS simulator, and an Android emulator from one test.

  • tooling and debugging

    Playwright ships the trace viewer, UI mode, codegen, a VS Code extension, and an HTML report.

    e2e writes a trace.md page for each failed test, a markdown summary of the run, and a video per attempt. A person or a coding agent can read all three.

    e2e mcp opens a live session where a coding agent writes test lines as it walks the flow. open_session {test} runs a failing test and stops on the screen where it failed. e2e explore runs the agent from a goal and reports what it finds. There is no graphical viewer.

  • what else each tool covers

    Playwright also covers component testing, API testing through request, network mocking with HAR files, clock control, and four languages.

    e2e tests are TypeScript or JavaScript. API tests use fetch and toMatchSchema, mocks go through browser.route, and there are no component tests. The migration guide marks every Playwright API as the same, renamed, different by design, or missing, with a workaround where one exists.

01 / 05

[ side by side ]

feature by feature.

Playwright leads on breadth: more languages, more tooling, and tests beyond UI flows. e2e leads where one suite must cover native mobile, where the UI changes often, and where a check is a question in plain language rather than a selector.

  • platforms

    [ e2e ]

    [ e2e ]

    Chromium, Firefox, WebKit, plus iOS simulators, Android emulators, and phones, with one API

    [ playwright ]

    Chromium, Firefox, WebKit; mobile browsers emulated; no native apps

  • writing a test

    [ e2e ]

    [ e2e ]

    One agent.act goal in plain language, checked by an exact assertion, or one screen line per step

    [ playwright ]

    Each step is a locator and an action in code

  • when the ui changes

    [ e2e ]

    [ e2e ]

    The agent finishes the goal from the changed screen; the runner saves a new recording after a passing check

    [ playwright ]

    The test fails; the healer agent rewrites the spec when you run it

  • ai assertions

    [ e2e ]

    [ e2e ]

    agent.assert, agent.waitFor, and agent.extract with a schema; vision for drawn content

    [ playwright ]

    Locator, value, screenshot, and aria-snapshot matchers; no model-judged check

  • screenshot comparison

    [ e2e ]

    [ e2e ]

    toHaveScreenshot on web, iOS simulators, and Android emulators, with masks and thresholds

    [ playwright ]

    toHaveScreenshot on web, with masks and thresholds

  • exploratory testing

    [ e2e ]

    [ e2e ]

    e2e explore runs from a goal and reports findings; a bug bash turns findings into failing repro tests

    [ playwright ]

    Codegen records what you click; the planner agent explores the app and writes a test plan

  • passwords and secrets

    [ e2e ]

    [ e2e ]

    Secret values never reach the model and are redacted from reports

    [ playwright ]

    Storage state files; credentials come from environment variables you read in the test

  • browsers

    [ even ]

    [ e2e ]

    Chromium, Firefox, WebKit, through Playwright

    [ playwright ]

    Chromium, Firefox, WebKit

  • coding agents

    [ even ]

    [ e2e ]

    e2e skill, an e2e mcp session that writes and checks test lines, plugins for Claude Code, Codex, and Cursor

    [ playwright ]

    Playwright MCP, test agents (planner, generator, healer), agent CLI

  • languages

    [ playwright ]

    [ e2e ]

    TypeScript and JavaScript

    [ playwright ]

    TypeScript, JavaScript, Python, Java, .NET

  • api and component tests

    [ playwright ]

    [ e2e ]

    API tests with fetch and schema matchers, route mocking; no component tests

    [ playwright ]

    API tests, component tests, network mocking, HAR, clock

  • debugging

    [ playwright ]

    [ e2e ]

    trace.md per failed test, markdown summary, video, an MCP session that stops on the failing screen

    [ playwright ]

    Trace viewer, UI mode, HTML report, VS Code extension

[ which one ]

which one to pick.

pick by the job in front of you: first the jobs where e2e is the better choice, then the jobs where playwright is the better choice.

  • The same flows on the web and on native iOS and Android

    [ e2e ]

    One suite, one API, and one runner cover both.

  • Long flows that change often

    [ e2e ]

    The agent completes the goal and the assertions stay exact, so a moved button does not fail the test.

  • A coding agent that writes and fixes tests

    [ e2e ]

    It works against a live session of the app and reads failures as markdown.

  • Passwords and tokens in tests

    [ e2e ]

    Secret values never reach the model or the reports.

  • A suite in Python, Java, or .NET

    [ playwright ]

    One language across unit, component, and end-to-end tests.

  • Recording a test by clicking through the app

    [ playwright ]

    Codegen writes the spec as you click. e2e has no recorder; its agent writes test lines from a goal in an e2e mcp session instead.

  • Component tests, HAR replay, or clock control

    [ playwright ]

    APIs the migration guide marks as missing in e2e.

  • A team that works in the trace viewer and UI mode every day

    [ playwright ]

    e2e has no graphical viewer.

[ switching ]

run both, move one test at a time.

  1. [step 1]

    Run npx e2e init. It writes e2e.config.ts and an example test. @e2e-dev/web brings its own pinned playwright-core, so your @playwright/test version stays yours. Keep *.spec.ts and *.e2e.ts apart.

  2. [step 2]

    Port playwright.config.ts with the config tables in the migration guide. Then pick a spec whose steps change often.

  3. [step 3]

    Rewrite it as a .e2e.ts file and run npx e2e run <file>. Delete the Playwright spec once you trust the new one. The agent prompt at the top of the guide does the port with Claude Code, Codex, or Cursor, and the migrate-to-e2e skill tracks a migration across sessions.

The migration guide maps every API. Rolling e2e out across a larger team? Book a call and the e2e team sets it up with you.

[ faq ]

questions.

what people on playwright ask before they add e2e.

[001]does e2e use playwright?

Yes, on the web. The web engine drives Chromium, Firefox, and WebKit through a pinned playwright-core. e2e adds the runner, the strict screen queries, agent steps, the replay cache, and the redaction layer on top.

[002]what's the difference between e2e and playwright?

Playwright runs the locators and actions you wrote, deterministically, in four languages. e2e runs the same kind of locators in TypeScript or JavaScript, adds goals an agent completes and checks it judges, replays verified goals without a model, and runs the same test on iOS and Android.

[003]do i need an api key to run e2e?

Only for agent steps. Tests with locators and assertions run without a model. Agent steps use a ChatGPT, Copilot, OpenCode, or SuperGrok subscription, an API key, or a local model.

[004]will a test with agent steps give the same result every run?

A verified goal replays as recorded actions with no model call. When the UI changes, the agent finishes the goal and the runner saves the new recording. With --strict-cache in CI, a stale recording fails instead.

[005]how do playwright's agents compare with e2e's?

Playwright's planner, generator, and healer write and repair spec files before a run. e2e's agent acts during a run when a recording no longer matches, and the e2e mcp session lets a coding agent write test lines against the live app.

[006]can i keep my playwright locators and page objects?

The getBy* queries carry over to screen with stricter defaults, and browser.locator takes CSS and XPath. A page object takes screen and browser and ships as a fixture. The migration guide maps each API.

ask anything else

facts checked 30 october 2026 against playwright.dev (v1.64.1) and the e2e docs. something out of date? open an issue on github.

[ get started ]

your verificationlayerstarts withjust one command

npx e2e@latest init