Product Introduction
- Definition: e2e is an open-source, TypeScript-based end-to-end (E2E) testing framework designed for web and mobile applications. It uniquely integrates deterministic testing with AI-powered agentic testing, allowing developers to write tests that combine precise code-based instructions with high-level, natural language goals executed by AI agents.
- Core Value Proposition: It exists to solve the high cost and inefficiency of purely AI-driven testing by intelligently caching and replaying an AI agent's verified actions. This reduces redundant AI model calls, slashes token usage and associated costs, and provides a stable, hybrid testing framework where developers maintain full control over their AI models, prompts, and testing infrastructure.
Main Features
- Action Replay & Caching: This is the core innovation. When an AI agent successfully performs an action (e.g., clicks a button, fills a form), e2e caches the exact sequence of low-level instructions (like DOM selectors and interaction events). On subsequent test runs, if the application's state and the test goal are unchanged, the framework replays these cached actions without calling the AI model, executing them deterministically. This drastically reduces latency and cost.
- Hybrid Deterministic/Agentic API: The framework provides a unified API where developers can write traditional, code-based assertions using locators (e.g.,
expect(screen.getByRole('status')).toContainText('Pro')) alongside agentic instructions (e.g.,agent.act('upgrade the workspace to the Pro plan')). This allows for precision where the UI is stable and AI flexibility where logic is complex or UI is dynamic. - Fully Configurable AI Stack: e2e offers unparalleled configurability. Developers can choose their AI model provider (OpenAI, Claude, Gemini, etc.), connect via their preferred gateway (Vercel AI Gateway, OpenRouter, direct API), define custom system prompts for the testing agent, and select the execution engine (web via
@e2e-dev/web, mobile via@e2e-dev/mobile, or a custom engine). This "bring your own" philosophy prevents vendor lock-in. - Multi-Platform Testing: It supports testing across web browsers, iOS simulators, and Android emulators from a single, shared testing API. The mobile support is powered by
agent-device, allowing the same test logic and agentic capabilities to be used for native mobile app testing. - CI/CD & Debugging Ready: It includes a dedicated CI mode that optimizes for reliability (automatic retries, read-only cache) and cost-efficiency. Failed tests generate comprehensive reports with screenshots, execution traces, and logs. The
--headedand--debugflags allow for live debugging of test runs.
Problems Solved
- Pain Point: The exorbitant and repetitive cost of using large language models (LLMs) for end-to-end testing, where the AI "reasons" from scratch on every test run, consuming tokens for identical actions.
- Pain Point: The brittleness of purely scripted E2E tests that break with minor UI changes, versus the flakiness and unpredictability of purely agentic tests that lack deterministic control.
- Target Audience: Senior developers and QA engineers in product teams who integrate AI testing into mature CI/CD pipelines. DevOps engineers concerned with infrastructure control and testing costs. Teams building applications with dynamic or frequently changing UIs where maintaining traditional tests is burdensome.
- Use Cases: Automating complex user journeys that are easy for a human to describe but tedious to script (e.g., "go through the checkout flow using a saved address and a promo code"). Creating resilient test suites for applications undergoing rapid UI iteration. Adding AI-powered validation steps (e.g.,
agent.assert('the invoice preview shows a prorated amount')) to existing Playwright or Cypress test suites via migration.
Unique Advantages
- Differentiation: Unlike traditional frameworks (Playwright, Cypress), e2e incorporates AI to handle ambiguous instructions. Unlike pure AI testing tools, it uses caching to become faster and cheaper over time and allows mixing in deterministic code for stability. It is more developer-centric and configurable than closed-platform AI testing services.
- Key Innovation: The action replay cache is its defining technological advantage. It transforms the AI agent from a perpetual, costly interpreter into a one-time "teacher" for the test suite. Once the agent demonstrates a correct action sequence, the framework memorizes and repeats it with machine precision, blending the exploratory power of AI with the reliability of automated scripts.
Frequently Asked Questions (FAQ)
- How does e2e testing framework reduce AI token usage costs? e2e reduces costs by implementing an intelligent action replay system. After an AI agent successfully completes a task, the framework caches the specific interaction steps. Future test runs replay these cached actions directly without invoking the AI model, eliminating token consumption for repeated reasoning on unchanged application flows.
- Can I use e2e with my existing Playwright or Cypress test suites? Yes, e2e provides migration guides for Playwright, Cypress, and other frameworks. Its API for locators and deterministic assertions is conceptually similar, allowing you to incrementally replace brittle or complex scripted sections with agentic steps (
agent.act) while preserving stable, coded assertions. - Is e2e suitable for testing native mobile applications on iOS and Android? Yes, e2e has first-class support for mobile testing. Using the
@e2e-dev/mobilepackage and theagent-devicedriver, you can run the same hybrid (deterministic + agentic) tests on iOS simulators and Android emulators, controlling the native UI with the same AI action caching benefits. - Where are my AI API keys and secrets stored when using the e2e framework? Secrets are managed securely through environment variables. Your configuration file references named credentials (e.g.,
process.env.OPENROUTER_API_KEY), and the runner injects these values at execution time. This prevents sensitive keys from being stored in your test code, configuration files, or cached action transcripts. - What happens when a cached agent action fails because the user interface changed? If a replay fails (e.g., a cached selector no longer finds an element), the e2e framework will automatically fall back to the AI agent. The agent will analyze the current screen, determine the new correct action to achieve the goal, execute it, and then update the cache with the new successful action sequence for future runs.