
e2e
e2e is an end-to-end testing framework for web and mobile apps. Describe a goal in natural language and an agent drives the app to reach it. Check the result with locators and assertions in the same test.
// tests/checkout.e2e.ts
import { test, expect } from 'e2e';
test('a member upgrades to Pro', async ({ app, agent, screen }) => {
await app.open('/settings/billing');
await agent.act('upgrade the workspace to the Pro plan');
await agent.assert('the invoice preview shows a prorated amount');
await expect(screen.getByRole('status')).toContainText('Pro');
});
Bring your own subscription, API key, or local model.
A release gate in CI
A suite that gates a release must give the same result every time it runs
on a commit. e2e can run that suite with no model call:
- Your coding agent writes tests with exact locators and assertions. They
need no model and no key. On the web, they run in Chromium, Firefox, and
WebKit through Playwright.
- An
agent.act step that a later assertion verifies records its actions.
Commit the recordings in .e2e/cache/ and CI replays them with no model
call. With npx e2e run --strict-cache, a recording that no longer
matches the app fails the step, and no model takes over. A step that was
never recorded, or whose recording has a gap, still runs live.
expect(locator) calls no model. With the built-in agent, agent.assert,
agent.waitFor, and agent.extract call the model on every run.
See Caching for what replays and when.
Quick start
npx e2e init
init asks for an engine, web or mobile, and a model provider, then writes a
config and an example test. The
quickstart covers the rest.
To see a finished setup in your stack, open
examples/:
Vite, Next.js, Astro, Angular, Expo, SwiftUI, Jetpack Compose, Kotlin Multiplatform,
Flutter, and .NET MAUI, each a standalone project with a passing suite.
MCP server
npx e2e mcp is a Model Context Protocol
server over stdio. It gives a coding agent such as Claude Code, Codex, or
Cursor a live session on your app, on web, iOS, or Android: the agent sees
the screen, acts on it, gets back the test line that repeats each action, and
runs your suite. The server needs no model.
{
"mcpServers": {
"e2e": { "command": "npx", "args": ["e2e", "mcp"] }
}
}
See the MCP server docs for setup and
every tool.
Packages
Core