skip to content

[ 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.

[ 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 handles checkout. navigation and the final assertion stay exact. you can also write each step with a locator.

[ differences ]

the five main differences.

  • writing a test

    Playwright tests describe each step with a locator, action, or assertion. e2e supports the same style through screen, with whole-name matching and one match per action.

    for longer flows, use agent.act to describe the goal. follow it with an exact assertion to check the result.

  • when ai is used

    Playwright's planner, generator, and healer write and repair test files before a run. the tests themselves run without a model.

    e2e calls a model during agent steps. cached goals replay recorded actions; stale recordings can return control to the agent. --strict-cache fails stale recordings instead, but new goals still need a model.

  • native mobile apps

    Playwright emulates mobile browsers, including touch, viewport, and location. it does not drive native apps.

    e2e uses the same agent, screen, and expect api on browsers, iOS simulators, Android emulators, and connected phones. screenshot comparisons cover browsers and simulators or emulators.

  • tooling and debugging

    Playwright includes a trace viewer, ui mode, codegen, a VS Code extension, and html reports.

    e2e writes markdown traces and videos. e2e mcp lets a coding agent work against the live app or stop at a failed step. there is no graphical viewer.

  • what else each tool covers

    Playwright supports component tests, api requests, har replay, clock control, and four languages.

    e2e tests use TypeScript or JavaScript, fetch for api requests, and browser.route for mocks. there are no component tests. the migration guide lists api differences and workarounds.

01 / 05

[ side by side ]

feature by feature.

Playwright offers more languages and debugging tools. e2e adds runtime agent goals and native mobile support.

  • 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 screen steps, 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, 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 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.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 ]

    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.

[ switching ]

run both, move one test at a time.

  1. [step 1]

    run npx e2e init beside your existing suite.

  2. [step 2]

    follow the migration guide to port one test and its config.

  3. [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.

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 init