[ compare · web testing frameworks ]
e2e vs playwright
Playwright runs scripted browser tests. e2e adds agent goals beside exact checks, with one api for web, iOS, and Android.
npx e2e 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 handles checkout. navigation and the final assertion stay exact. you can also write each step with a locator.
[ differences ]
the five main differences.
01 / 05
[ side by side ]
feature by feature.
Playwright offers more languages and debugging tools. e2e adds runtime agent goals and native mobile support.
| 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 | exact screen steps, agent goals, or both | locators and actions in code | [ e2e ] |
| when the ui changes | stale goals can return to the agent; exact assertions still check the result | update the test yourself or run the healer agent | [ 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 stay out of model prompts and reports | storage state; credentials read from environment variables | [ e2e ] |
| browsers | Chromium, Firefox, WebKit, through Playwright | Chromium, Firefox, WebKit | [ even ] |
| coding agents | e2e skill, live mcp sessions, editor plugins | Playwright mcp, planner, generator, healer, and 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 ]
exact
screensteps, agent goals, or both[ playwright ]
locators and actions in code
when the ui changes
[ e2e ][ e2e ]
stale goals can return to the agent; exact assertions still check the result
[ playwright ]
update the test yourself or run the healer agent
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 stay out of model prompts and reports[ playwright ]
storage state; credentials read from environment variables
browsers
[ even ][ e2e ]
Chromium, Firefox, WebKit, through Playwright
[ playwright ]
Chromium, Firefox, WebKit
coding agents
[ even ][ e2e ]
e2e skill, live mcp sessions, editor plugins
[ playwright ]
Playwright mcp, planner, generator, healer, and 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 ] | use agent goals for changing steps and exact assertions for the outcome. locator-only steps still need updates when their selectors change. |
| 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 ]use agent goals for changing steps and exact assertions for the outcome. locator-only steps still need updates when their selectors change.
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 initbeside your existing suite.[step 2]
follow the migration guide to port one test and its config.
[step 3]
run
npx e2e run <file>. keep the Playwright test until you trust the replacement.
the migration guide covers setup, api differences, and unsupported features. need help? book a call with the e2e team.
[ faq ]
questions.
what people on playwright ask before they add e2e.
[001]does e2e use playwright?
yes. the web engine uses a pinned playwright-core. e2e adds its runner, strict screen queries, agent steps, replay cache, and secret redaction.
[002]what's the difference between e2e and playwright?
Playwright runs scripted browser tests. e2e adds agent goals beside exact checks and uses the same api for web and native mobile.
[003]do i need an api key to run e2e?
only agent steps need a model. use a supported subscription, an api key, or a local model. locator-only tests need none.
[004]will a test with agent steps give the same result every run?
cached goals replay without a model while the recording applies. stale recordings can hand control to the agent; --strict-cache fails instead. new goals and model-judged checks still call a model.
[005]how do playwright's agents compare with e2e's?
Playwright agents plan, generate, and repair test files before a run. e2e's runtime agent completes goals during a run when no usable recording applies.
[006]can i keep my playwright locators and page objects?
yes, with changes. move getBy* queries to screen and check the stricter defaults. use browser.locator for css or xpath, and wrap page objects as fixtures.
facts checked 30 october 2026 against Playwright.dev (v1.64.1) and the e2e docs. something out of date? open an issue on github.
