Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/android-unreadable-snapshot-poll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@e2e-dev/mobile': patch
---

Locators and `expect` now keep waiting while Android reports insufficient foreground app content (an app still loading after a cold start) instead of failing at once. A wait that runs out on an unreadable screen fails with that reason.
6 changes: 6 additions & 0 deletions .changeset/bump-agent-device-0-21-28.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@e2e-dev/mobile": patch
"@e2e-dev/limrun": patch
---

Bump agent-device to 0.21.28.
5 changes: 5 additions & 0 deletions .changeset/connect-cdp-endpoint-required.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@e2e-dev/web": patch
---

`web({ connect })` is `INVALID_CONFIG` at config load when `cdpEndpoint` is missing or not a function, instead of failing every attempt with `ENGINE_FAILURE: connection failed: resolve is not a function` (with `reconnectEndpoint`) or worker init with `browser connect failed: source.resolve is not a function` (without it).
5 changes: 5 additions & 0 deletions .changeset/lightpanda-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@e2e-dev/lightpanda": patch
---

New package: `lightpanda()`, a browser provider that starts a `lightpanda serve` per worker slot on a free port and stops it when the run ends.
6 changes: 6 additions & 0 deletions .changeset/scroll-strides-back-to-back.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"e2e": patch
"@e2e-dev/web": patch
---

`scrollUntilVisible` no longer pauses 100 ms between swipes. On web, a swipe resolves once the scroll it caused is on screen, so the next read sees the scrolled page.
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ suites that consume the built packages the way a user would.
engine's provider seam (`BrowserProvider` for web, `DeviceProvider` for
mobile) and imports the engine's types only; the engines never know it
exists.
- `packages/lightpanda` - the published `@e2e-dev/lightpanda` package: a
`BrowserProvider` that starts a local `lightpanda serve` per worker slot
and stops it with the run; no vendor SDK, the binary is the dependency.
- `packages/eas` - the published `@e2e-dev/eas` package: EAS Simulators
hosted iOS simulators and Android emulators for the mobile engine
(`DeviceProvider`). Expo publishes no SDK for the sessions API, so it calls
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,5 +288,5 @@ build against, and what a third-party engine builds against too. A change to
that contract bumps all three packages together in one release, with a
changeset for each, so an engine and a runner from the same release always
match. Engines declare a peer range on `e2e` that points one way only
(engine to runner, `>=x <1`), and each integration (`@e2e-dev/kernel`, `@e2e-dev/eas`, `@e2e-dev/smol`, `@e2e-dev/testmu`) does
(engine to runner, `>=x <1`), and each integration (`@e2e-dev/kernel`, `@e2e-dev/lightpanda`, `@e2e-dev/eas`, `@e2e-dev/smol`, `@e2e-dev/testmu`) does
the same on the engines it plugs into; do not make it mutual or narrow it.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ and Flutter, each a standalone project with a passing suite.
| [`@e2e-dev/mobile`](https://www.npmjs.com/package/@e2e-dev/mobile) | iOS and Android engine: simulators and emulators through agent-device. |
| [`@e2e-dev/github`](https://www.npmjs.com/package/@e2e-dev/github) | Reporter that posts results as a pull request comment. |
| [`@e2e-dev/kernel`](https://www.npmjs.com/package/@e2e-dev/kernel) | Kernel hosted browsers for the web engine. |
| [`@e2e-dev/lightpanda`](https://www.npmjs.com/package/@e2e-dev/lightpanda) | Lightpanda, the open-source headless browser, started per run for the web engine. |
| [`@e2e-dev/limrun`](https://www.npmjs.com/package/@e2e-dev/limrun) | Limrun hosted iOS simulators and Android emulators for mobile tests. |
| [`@e2e-dev/eas`](https://www.npmjs.com/package/@e2e-dev/eas) | EAS Simulators hosted iOS simulators and Android emulators for the mobile engine. |
| [`@e2e-dev/smol`](https://www.npmjs.com/package/@e2e-dev/smol) | smol machines browsers for the web engine: by default, each attempt branches a warm Chromium microVM. |
Expand Down
5 changes: 5 additions & 0 deletions apps/testbed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ here.
swipes (`pointer`), viewport and node scrolling (`scroll`), the `browser`
fixture's own verbs (`browser`), and the per-action speed floor (`speed`).
`tests/helpers.ts` holds the shared `failure`, `boxOf`, and `centerOf`.
- `e2e.lightpanda.config.ts` and `e2e.lightpanda-agent.config.ts`: the
local suite and the agent suite on `@e2e-dev/lightpanda`, which starts
[Lightpanda](https://lightpanda.io) from `LIGHTPANDA_PATH` (or `PATH`),
run by hand to see which features its nightly covers; the docs page
`integrations/lightpanda` lists the result.
- `e2e.agent.config.ts` + `tests-agent/` — opt-in agentic suite against the
playground: `agent.act` flows, assisted polling, judgments,
schema-validated extraction with zod, and the pixel tools on the canvas
Expand Down
23 changes: 23 additions & 0 deletions apps/testbed/e2e.lightpanda-agent.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { E2EConfig } from 'e2e';
import { web } from '@e2e-dev/web';
import { lightpanda } from '@e2e-dev/lightpanda';
import agentConfig from './e2e.agent.config.ts';

/**
* The agent suite on Lightpanda, run manually with a model key:
*
* AI_GATEWAY_API_KEY=... pnpm --filter @e2e-dev/testbed test:lightpanda:agent
*
* The failures to expect are the drawn, dragged, and below-the-fold flows
* the Lightpanda integration page lists.
*/
export default {
...agentConfig,
projectId: 'dev.e2e.testbed-agent-lightpanda',
targets: agentConfig.targets.map((target) => ({
...target,
name: 'lightpanda',
engine: web({ browser: lightpanda({ loadResources: ['iframe'] }) }),
app: { ...target.app, url: 'http://127.0.0.1:4273', command: { ...target.app.command, env: { PORT: '4273' } } },
})),
} satisfies E2EConfig;
15 changes: 15 additions & 0 deletions apps/testbed/e2e.lightpanda.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { E2EConfig } from 'e2e';
import { web } from '@e2e-dev/web';
import { lightpanda } from '@e2e-dev/lightpanda';
import base from './e2e.config.ts';

/**
* The local suite on Lightpanda, run by hand to see which features its
* nightly covers:
*
* pnpm --filter @e2e-dev/testbed test:lightpanda
*/
export default {
...base,
targets: base.targets.map((target) => ({ ...target, name: 'lightpanda', engine: web({ browser: lightpanda({ loadResources: ['iframe'] }) }) })),
} satisfies E2EConfig;
3 changes: 3 additions & 0 deletions apps/testbed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"typecheck": "tsc --noEmit",
"test": "tsc --noEmit && node node_modules/e2e/dist/cli/bin.js run",
"test:headed": "node node_modules/e2e/dist/cli/bin.js run --headed",
"test:lightpanda": "node node_modules/e2e/dist/cli/bin.js run --config e2e.lightpanda.config.ts",
"test:lightpanda:agent": "node node_modules/e2e/dist/cli/bin.js run --config e2e.lightpanda-agent.config.ts",
"app": "node app/server.mjs",
"test:agent": "node node_modules/e2e/dist/cli/bin.js run --config e2e.agent.config.ts",
"test:dogfood": "node node_modules/e2e/dist/cli/bin.js run --config e2e.dogfood.config.ts",
Expand All @@ -17,6 +19,7 @@
"explore:bench": "node scripts/explore-bench.mjs"
},
"dependencies": {
"@e2e-dev/lightpanda": "workspace:*",
"@e2e-dev/web": "workspace:*",
"e2e": "workspace:*"
},
Expand Down
11 changes: 7 additions & 4 deletions docs/browser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ bunx @e2e-dev/web install webkit --with-deps
```
</CodeGroup>

`connect` attaches to a remote Chromium over CDP instead of launching one.
`connect` attaches to a remote Chromium over CDP instead of launching one,
or to another browser that speaks CDP, such as a running
[Lightpanda](/integrations/lightpanda).
To set sizes, see [Viewports](/web#viewports).

## Hosted browsers
Expand All @@ -215,14 +217,15 @@ when the run no longer uses it.
| --- | --- |
| [Kernel](/integrations/kernel) | `kernel()` from `@e2e-dev/kernel` |
| [smol machines](/integrations/smol) microVMs on your own computer | `smol()` from `@e2e-dev/smol` |
| [Lightpanda](/integrations/lightpanda), the open-source headless browser, on your own machine | `lightpanda()` from `@e2e-dev/lightpanda` |
| Any other service | Your own provider, a few dozen lines in your project |

When the service shows the window in a live view, add `viewport: null` so
the page [fills the window](/web#fill-the-window).

A provider implies Chromium, the only browser CDP attach works on, and
can't be combined with `connect`. A target with nothing to run leases
nothing.
A provider implies a browser the engine drives as Chromium over CDP,
Chromium itself or Lightpanda, and can't be combined with `connect`. A
target with nothing to run leases nothing.

### Write a provider

Expand Down
4 changes: 2 additions & 2 deletions docs/bug-bash.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Bug bash the checkout and account settings on this branch.
environment, the intended design, or the seed data.
6. Writes a repro test that asserts the expected behavior for each
remaining finding. It can start one subagent per area, each with its own
[`e2e mcp` session](/reference/mcp#several-sessions) to check locators.
[`e2e mcp` session](/mcp) to check locators.
7. Runs each repro test. The finding is a bug only when the test fails with
`ASSERTION_FAILED`.
8. Reports, in this order: confirmed bugs, production risks that it cannot
Expand Down Expand Up @@ -124,7 +124,7 @@ regression test.
<Card title="Exploring without a test" icon="compass" href="/explore">
What one `e2e explore` run does, its budgets, and its report.
</Card>
<Card title="MCP server" icon="plug" href="/reference/mcp">
<Card title="MCP server" icon="plug" href="/mcp">
Live sessions for coding agents, several at once.
</Card>
</CardGroup>
37 changes: 4 additions & 33 deletions docs/coding-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,39 +87,10 @@ codex plugin marketplace upgrade e2e

## Let the agent use the app

`e2e mcp` lets the coding agent open the app and use it. Each agent,
subagents included, opens its own session, so several can use the app at
the same time. The `locate` tool checks a `screen.*` locator against the
current app and returns the test code when exactly one element matches.

`init` registers the server in `.mcp.json` for Claude Code and
`.cursor/mcp.json` for Cursor. To register it with Claude Code by hand:

<CodeGroup>
```bash npm
claude mcp add --scope project e2e -- npx e2e mcp
```

```bash pnpm
claude mcp add --scope project e2e -- pnpm exec e2e mcp
```

```bash bun
claude mcp add --scope project e2e -- bunx e2e mcp
```
</CodeGroup>

For Codex, add the server to the project's `.codex/config.toml`, trust the
project, and start a new session:

```toml
[mcp_servers.e2e]
command = "npx"
args = ["e2e", "mcp"]
```

The server does not run tests. See the [MCP server reference](/reference/mcp)
for its tools, session rules, and flags.
`e2e mcp` gives the agent a live session on your app. It checks each
locator against the screen before it writes the test, and checks its own UI
changes. `init` registers the server. See [MCP server](/mcp) for setup and
prompts.

## How an agent writes and runs a test

Expand Down
4 changes: 3 additions & 1 deletion docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@
"index",
"quickstart",
"core-concepts",
"coding-agents"
"coding-agents",
"mcp"
]
},
{
Expand Down Expand Up @@ -180,6 +181,7 @@
"pages": [
"integrations/index",
"integrations/kernel",
"integrations/lightpanda",
"integrations/eas",
"integrations/smol",
"integrations/limrun",
Expand Down
1 change: 1 addition & 0 deletions docs/images/icons/lightpanda.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading