mirror of
https://github.com/tester-army/e2e.git
synced 2026-12-03 04:45:58 +08:00
86 lines
3.4 KiB
Plaintext
86 lines
3.4 KiB
Plaintext
---
|
|
title: Introduction
|
|
description: Open source AI testing for web and mobile apps. Spend less time on tests and more time building.
|
|
---
|
|
|
|
import { VideoCard } from './snippets/video-card.jsx';
|
|
|
|
e2e is a next-generation testing framework for web and mobile
|
|
apps, built to keep up with the speed we ship software today.
|
|
|
|
You choose how agentic each test is: fully deterministic with
|
|
[locators](/locators) and
|
|
[assertions](/reference/expect#locator-matchers), fully driven by an agent
|
|
from [goals](/goals) in natural language, or a mix of
|
|
both in the same test.
|
|
|
|
<VideoCard
|
|
id="NEawZb6Hssw"
|
|
title="Watch e2e explained in 2 minutes"
|
|
subtitle="Learn how to chain agent goals with deterministic locator checks, run the same tests on web, iOS, and Android, and set up a project in a minute."
|
|
/>
|
|
|
|
```ts title="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');
|
|
});
|
|
```
|
|
|
|
## Why e2e
|
|
|
|
Testing should not slow down how fast you ship or how sure you are of what
|
|
you shipped.
|
|
|
|
- **Time back.** Write a goal instead of a script of selectors and waits.
|
|
When the UI changes, the agent adapts, so you spend less time writing and
|
|
fixing tests and more time building.
|
|
- **Less risk.** Cover more of the flows your users depend on, on web and
|
|
mobile, and catch regressions before they reach production.
|
|
- **Cheap runs.** Verified `agent.act` steps [replay from a cache](/cache)
|
|
with no model calls. Test more flows without the token bill or a slow CI.
|
|
|
|
## How it works
|
|
|
|
- **Targets.** Each test runs once per target, such as Chromium or an iPhone
|
|
simulator. The [web engine](/starting-your-app) drives browsers through
|
|
Playwright, the [mobile engine](/mobile) drives iOS simulators and Android
|
|
emulators through agent-device, and you can
|
|
[write your own](/writing-an-engine).
|
|
- **Agent steps.** `agent.act` completes a goal. `agent.assert`,
|
|
`agent.waitFor`, and `agent.extract` judge the screen. Use your own
|
|
[subscription](/subscriptions), [API key, or local model](/models). Tests
|
|
without agent steps need no model.
|
|
- **Cache.** An `act` step that a later check verifies is recorded. The next
|
|
run replays it and hands back to the agent when the app changed. `assert`,
|
|
`waitFor`, and `extract` always call the model.
|
|
- **Reports.** The runner [redacts registered secrets](/security) from model
|
|
input and records steps, failures, and artifacts in a
|
|
[report](/debugging) you or your coding agent can read.
|
|
|
|
## Get started
|
|
|
|
<CardGroup cols={2}>
|
|
<Card title="Quickstart" icon="rocket" href="/quickstart">
|
|
One prompt for your coding agent, or set up by hand.
|
|
</Card>
|
|
<Card title="Example projects" icon="folder-open" href="/example-projects">
|
|
Run a standalone app with Vite, Next.js, Expo, or SwiftUI.
|
|
</Card>
|
|
<Card title="Goals" icon="pen-to-square" href="/goals">
|
|
Write test steps as goals in natural language.
|
|
</Card>
|
|
<Card title="Coding agents" icon="robot" href="/coding-agents">
|
|
Let your coding agent write, run, and debug tests.
|
|
</Card>
|
|
<Card title="Mobile" icon="mobile-screen" href="/mobile">
|
|
Run tests on iOS simulators and Android emulators.
|
|
</Card>
|
|
</CardGroup>
|