[ 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.
npx e2e@latest init[ at a glance ]
what each tool is.
| dimension | [ e2e ] | [ playwright ] |
|---|---|---|
| made by, license | e2e, apache-2.0 | microsoft, apache-2.0 |
| platforms | Chromium, Firefox, and WebKit through Playwright. iOS simulators, Android emulators, and connected phones through agent-device. | Chromium, Firefox, WebKit. Mobile browsers are emulated. |
| languages | TypeScript, JavaScript | TypeScript, JavaScript, Python, Java, .NET |
| test steps | Locators and assertions, plus agent goals and agent assertions in the same test | Locators, actions, and web-first assertions |
| finding elements | Role, label, text, and test id queries on screen. A string must match the whole name. An action needs exactly one match. | 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 | At run time, when a step needs it. Verified goals replay without model calls. Locator steps never call a model. | While you write tests, through Playwright agents and MCP. The run itself is deterministic. |
| what a run costs | 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. | CI minutes |
| tooling | CLI, an e2e mcp session for coding agents, a trace.md page per failed test, a markdown summary, a video per attempt | Trace viewer, UI mode, codegen, VS Code extension, HTML report |
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, andisVisible()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 mcpsession for coding agents, atrace.mdpage 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.
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');
});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.
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.
| dimension | [ e2e ] | [ playwright ] | leads |
|---|---|---|---|
| platforms | Chromium, Firefox, WebKit, plus iOS simulators, Android emulators, and phones, with one API | Chromium, Firefox, WebKit; mobile browsers emulated; no native apps | [ e2e ] |
| writing a test | One agent.act goal in plain language, checked by an exact assertion, or one screen line per step | Each step is a locator and an action in code | [ e2e ] |
| when the ui changes | The agent finishes the goal from the changed screen; the runner saves a new recording after a passing check | The test fails; the healer agent rewrites the spec when you run it | [ e2e ] |
| ai assertions | agent.assert, agent.waitFor, and agent.extract with a schema; vision for drawn content | Locator, value, screenshot, and aria-snapshot matchers; no model-judged check | [ e2e ] |
| screenshot comparison | toHaveScreenshot on web, iOS simulators, and Android emulators, with masks and thresholds | toHaveScreenshot on web, with masks and thresholds | [ e2e ] |
| exploratory testing | e2e explore runs from a goal and reports findings; a bug bash turns findings into failing repro tests | Codegen records what you click; the planner agent explores the app and writes a test plan | [ e2e ] |
| passwords and secrets | Secret values never reach the model and are redacted from reports | Storage state files; credentials come from environment variables you read in the test | [ e2e ] |
| browsers | Chromium, Firefox, WebKit, through Playwright | Chromium, Firefox, WebKit | [ even ] |
| coding agents | e2e skill, an e2e mcp session that writes and checks test lines, plugins for Claude Code, Codex, and Cursor | Playwright MCP, test agents (planner, generator, healer), agent CLI | [ even ] |
| languages | TypeScript and JavaScript | TypeScript, JavaScript, Python, Java, .NET | [ playwright ] |
| api and component tests | API tests with fetch and schema matchers, route mocking; no component tests | API tests, component tests, network mocking, HAR, clock | [ playwright ] |
| debugging | trace.md per failed test, markdown summary, video, an MCP session that stops on the failing screen | Trace viewer, UI mode, HTML report, VS Code extension | [ playwright ] |
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.actgoal in plain language, checked by an exact assertion, or onescreenline 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, andagent.extractwith a schema;visionfor drawn content[ playwright ]
Locator, value, screenshot, and aria-snapshot matchers; no model-judged check
screenshot comparison
[ e2e ][ e2e ]
toHaveScreenshoton web, iOS simulators, and Android emulators, with masks and thresholds[ playwright ]
toHaveScreenshoton web, with masks and thresholdsexploratory testing
[ e2e ][ e2e ]
e2e exploreruns 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 ]
Secretvalues 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 mcpsession 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.mdper 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 job | pick | why |
|---|---|---|
| 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. |
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 ]Secretvalues 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 mcpsession 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.
[step 1]
Run
npx e2e init. It writese2e.config.tsand an example test.@e2e-dev/webbrings its own pinnedplaywright-core, so your@playwright/testversion stays yours. Keep*.spec.tsand*.e2e.tsapart.[step 2]
Port
playwright.config.tswith the config tables in the migration guide. Then pick a spec whose steps change often.[step 3]
Rewrite it as a
.e2e.tsfile and runnpx 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 themigrate-to-e2eskill 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.
facts checked 30 october 2026 against playwright.dev (v1.64.1) and the e2e docs. something out of date? open an issue on github.
