Skip to main content
The first run needs no model key. With your app’s dev server up, three commands get a browser test green against it. The agent step comes after.
Node.js 22.12 or newer. On Windows, run everything inside WSL.

Run your first test

1

Scaffold

In your app’s directory, with the dev server on http://localhost:3000:
Accept the defaults: Web (Playwright), the Vercel AI Gateway, and the coding-agent skill. init adds @e2edev/e2e, @e2edev/playwright, playwright, and ai to devDependencies, a test:e2e script, and .gitignore entries, and writes the config, an example test, and the skill files. It never overwrites a file that exists.
e2e.config.ts
tests/example.e2e.ts
A target names the engine that drives it, and the engine declares the app: a URL for a browser, a bundle id on a device.
2

Install

3

Run

The first run downloads a browser, once. Then:
No model was called. The runner only checks the model when a test asks for the agent fixture.
Every run writes .e2e/report.json. The exit code says what went wrong: 1 is a test failure, 2 is configuration, 3 is infrastructure.
Always call the CLI as npx --no-install e2e. Bare npx e2e fetches whatever package is called e2e on npm when the runner is not installed locally.

Add an agent step

The scaffold’s example file ends with a commented-out agent test. Give it a goal your app can satisfy, or write a new file next to it:
tests/agent.e2e.ts
One goal per act. Real values travel through params, not through the instruction. The final expect costs no model calls and cannot vary. There are no sleeps anywhere: queries poll, actions wait, assertions retry. This run needs a key. The scaffold’s model is gateway('openai/gpt-5.6-luna') from the Vercel AI Gateway, which reads AI_GATEWAY_API_KEY:
Any AI SDK model instance works in that slot. Choosing a model covers OpenRouter, local servers, and calling a provider directly. Useful flags while you iterate:

Notes

Config and test files are ES modules. e2e loads .ts files as ESM whatever the nearest package.json says, so a CommonJS project keeps its module type. A tsconfig.json is optional; add one for editor completions. For a mobile app, choose Mobile (iOS/Android) in init and follow Testing iOS and Android.

Next

Writing tests

Goals, checks, extraction, and the deterministic APIs.

Starting your app

Let the runner start the dev server and its dependencies.

Signing in

Sign in once with a secret the model never sees.

Continuous integration

The one workflow you need.