e2e (Website)
The e2e framework reduces AI testing costs by caching agentic steps and replaying them deterministically, combining flexibility with standard testing practices.
Deep dive
- e2e allows developers to mix deterministic assertions with LLM-driven actions.
- Agent actions are cached: once an agent successfully completes a sequence of steps, those actions are replayed deterministically in future runs.
- This drastically reduces token consumption for unchanged test paths.
- The framework supports custom AI models via the Vercel AI Gateway, OpenRouter, or direct API keys.
- It provides first-class support for both web and mobile testing (iOS/Android simulators).
- The architecture separates the 'agent' (which decides steps) from the 'engine' (which executes them), allowing for easier debugging and migration from existing frameworks like Playwright or Cypress.
Decoder
- Agentic testing: A testing methodology where an AI model uses its reasoning capabilities to navigate an application UI and interact with elements dynamically, rather than using rigid CSS selectors.
- Deterministic testing: Traditional testing where every step (e.g., click specific button, expect text) is pre-scripted and expected to yield the exact same result every time.
Original article
Open Source AI testing framework
Customizable TypeScript testing framework for web, mobile apps and more.
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');
});
Why e2e
Most AI tests start from scratch. Every single time.
e2e remembers your agent's actions and replays them when possible, without calling the model again.
Less repeated reasoning. Fewer tokens. Lower costs.
Your testing stack. Your call.
Pick every layer. The config writes itself.
import type { E2EConfig } from 'e2e';
import { web } from '@e2e-dev/web';
import { gateway } from 'ai';
export default {
targets: [{ engine: web(), app: { url: '' } }],
agents: {
default: {
model: gateway(''),
system: '',
},
},
} satisfies E2EConfig;
Connect on your terms.
Use your preferred gateway and keep control of how your AI connects.
Your favorite AI? Bring it along.
Choose the model that works for you. Your testing framework shouldn't decide for you.
Your agent. Your rules.
Give your agent a purpose. Define how it should approach testing, what to look for, and what matters to you.
Your app. Your environment.
Test on the web, go mobile, or bring your own engine. One framework, built to adapt.
AI where it helps. Code where it counts.
Don't make AI think twice.
Replay compatible cached actions without unnecessary model calls.
Goals, not scripts.
Describe your testing goals in plain language. Let your agent handle the actions.
Exact when it matters.
Combine AI-driven actions with precise locators and deterministic assertions.
Your AI. Your choice.
Choose your preferred AI model and customize your testing agent.
One API. Multiple environments.
Test web and mobile applications through one shared API.
Bring your own engine.
Extend the framework with your own execution backend.
Questions, answered.
Which AI models can I use?
Any AI SDK model works. Sign in with the ChatGPT, GitHub Copilot, or SuperGrok subscription you already pay for, bring a Vercel AI Gateway or OpenRouter key, or point the runner at a local server. The config selects the model; e2e adds no markup.
Can the model see my secrets?
Secrets stay in environment variables: the config references named credentials and the runner fills them at run time, so values never live in your test code or transcripts.
Does it test mobile apps?
Yes. @e2e-dev/mobile drives iOS simulators and Android emulators through agent-device, with the same tests, fixtures, and assertions you write for the web.
Does it run in CI?
Yes. CI mode switches on automatically: one retry, a read-only trace cache, and agent steps replay verified actions without model calls when nothing changed. Pass your model key as a secret and run it like any other test job.
Can I migrate from another framework?
Yes: the docs include migration guides for Playwright, Cypress, Selenium, Detox, and Maestro. Locators and assertions map closely, and agent steps replace the most brittle parts first.
What happens when a run fails?
You get a report with the exact failing step, a screenshot, a trace, and logs under .e2e. Re-run with --headed or --debug to watch it live; every error code maps to a fix in the docs.
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi