@e2edev/e2e 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/agent/act-validation.d.ts +7 -4
- package/dist/agent/act-validation.d.ts.map +1 -1
- package/dist/agent/act-validation.js +18 -3
- package/dist/agent/act-validation.js.map +1 -1
- package/dist/agent/act.d.ts +2 -2
- package/dist/agent/act.d.ts.map +1 -1
- package/dist/agent/act.js +228 -51
- package/dist/agent/act.js.map +1 -1
- package/dist/agent/default-agent.d.ts +1 -1
- package/dist/agent/default-agent.d.ts.map +1 -1
- package/dist/agent/default-agent.js +19 -84
- package/dist/agent/default-agent.js.map +1 -1
- package/dist/agent/executor.d.ts +7 -0
- package/dist/agent/executor.d.ts.map +1 -1
- package/dist/agent/executor.js.map +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +14 -6
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/invocation.d.ts +1 -8
- package/dist/agent/invocation.d.ts.map +1 -1
- package/dist/agent/invocation.js +7 -51
- package/dist/agent/invocation.js.map +1 -1
- package/dist/agent/ledger.d.ts.map +1 -1
- package/dist/agent/ledger.js +10 -1
- package/dist/agent/ledger.js.map +1 -1
- package/dist/agent/loop-guards.d.ts +21 -0
- package/dist/agent/loop-guards.d.ts.map +1 -1
- package/dist/agent/loop-guards.js +48 -0
- package/dist/agent/loop-guards.js.map +1 -1
- package/dist/agent/model/sdk.d.ts +18 -0
- package/dist/agent/model/sdk.d.ts.map +1 -1
- package/dist/agent/model/sdk.js +9 -3
- package/dist/agent/model/sdk.js.map +1 -1
- package/dist/agent/observation-budget.d.ts +27 -0
- package/dist/agent/observation-budget.d.ts.map +1 -0
- package/dist/agent/observation-budget.js +43 -0
- package/dist/agent/observation-budget.js.map +1 -0
- package/dist/agent/observation.d.ts +40 -7
- package/dist/agent/observation.d.ts.map +1 -1
- package/dist/agent/observation.js +56 -11
- package/dist/agent/observation.js.map +1 -1
- package/dist/agent/phases.d.ts +1 -1
- package/dist/agent/phases.d.ts.map +1 -1
- package/dist/agent/phases.js +11 -13
- package/dist/agent/phases.js.map +1 -1
- package/dist/agent/primitives.d.ts +14 -2
- package/dist/agent/primitives.d.ts.map +1 -1
- package/dist/agent/primitives.js +98 -54
- package/dist/agent/primitives.js.map +1 -1
- package/dist/agent/screen-update.d.ts +47 -0
- package/dist/agent/screen-update.d.ts.map +1 -0
- package/dist/agent/screen-update.js +222 -0
- package/dist/agent/screen-update.js.map +1 -0
- package/dist/agent/step-cache.d.ts +38 -10
- package/dist/agent/step-cache.d.ts.map +1 -1
- package/dist/agent/step-cache.js +86 -45
- package/dist/agent/step-cache.js.map +1 -1
- package/dist/agent/tool-loop.d.ts.map +1 -1
- package/dist/agent/tool-loop.js +27 -4
- package/dist/agent/tool-loop.js.map +1 -1
- package/dist/cache/decide.d.ts +4 -3
- package/dist/cache/decide.d.ts.map +1 -1
- package/dist/cache/decide.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/engines.d.ts +2 -3
- package/dist/cli/init/engines.d.ts.map +1 -1
- package/dist/cli/init/engines.js +3 -4
- package/dist/cli/init/engines.js.map +1 -1
- package/dist/cli/signals.d.ts +3 -3
- package/dist/cli/signals.js +3 -3
- package/dist/config/agent.d.ts +6 -2
- package/dist/config/agent.d.ts.map +1 -1
- package/dist/config/agent.js +6 -2
- package/dist/config/agent.js.map +1 -1
- package/dist/config/app.d.ts +4 -4
- package/dist/config/app.d.ts.map +1 -1
- package/dist/config/load.d.ts +2 -2
- package/dist/config/load.js +2 -2
- package/dist/config/resolve.d.ts +21 -6
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +165 -54
- package/dist/config/resolve.js.map +1 -1
- package/dist/engine/contract.d.ts +6 -1
- package/dist/engine/contract.d.ts.map +1 -1
- package/dist/engine/contract.js.map +1 -1
- package/dist/engine/index.d.ts +69 -6
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +25 -5
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +6 -0
- package/dist/engine/session.js.map +1 -1
- package/dist/engine/surface.d.ts +6 -2
- package/dist/engine/surface.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/options.d.ts +9 -0
- package/dist/internal/options.d.ts.map +1 -0
- package/dist/internal/options.js +27 -0
- package/dist/internal/options.js.map +1 -0
- package/dist/locator/expression.js +1 -1
- package/dist/locator/expression.js.map +1 -1
- package/dist/locator/screen.d.ts.map +1 -1
- package/dist/locator/screen.js +4 -2
- package/dist/locator/screen.js.map +1 -1
- package/dist/report/build.d.ts +2 -1
- package/dist/report/build.d.ts.map +1 -1
- package/dist/report/build.js +2 -0
- package/dist/report/build.js.map +1 -1
- package/dist/report/json.d.ts +4 -0
- package/dist/report/json.d.ts.map +1 -0
- package/dist/report/json.js +8 -0
- package/dist/report/json.js.map +1 -0
- package/dist/report/junit.d.ts +7 -0
- package/dist/report/junit.d.ts.map +1 -1
- package/dist/report/junit.js +17 -0
- package/dist/report/junit.js.map +1 -1
- package/dist/report/list-model.d.ts +8 -5
- package/dist/report/list-model.d.ts.map +1 -1
- package/dist/report/list.d.ts +19 -4
- package/dist/report/list.d.ts.map +1 -1
- package/dist/report/list.js +67 -19
- package/dist/report/list.js.map +1 -1
- package/dist/report/running-tree.d.ts +5 -4
- package/dist/report/running-tree.d.ts.map +1 -1
- package/dist/report/running-tree.js +8 -7
- package/dist/report/running-tree.js.map +1 -1
- package/dist/run/artifacts.d.ts.map +1 -1
- package/dist/run/artifacts.js +20 -2
- package/dist/run/artifacts.js.map +1 -1
- package/dist/run/events.d.ts +14 -9
- package/dist/run/events.d.ts.map +1 -1
- package/dist/run/events.js +7 -7
- package/dist/run/events.js.map +1 -1
- package/dist/run/execute.d.ts +24 -5
- package/dist/run/execute.d.ts.map +1 -1
- package/dist/run/execute.js +67 -25
- package/dist/run/execute.js.map +1 -1
- package/dist/run/fixtures.d.ts +6 -1
- package/dist/run/fixtures.d.ts.map +1 -1
- package/dist/run/fixtures.js +0 -1
- package/dist/run/fixtures.js.map +1 -1
- package/dist/run/in-process.d.ts +1 -1
- package/dist/run/in-process.d.ts.map +1 -1
- package/dist/run/in-process.js +6 -3
- package/dist/run/in-process.js.map +1 -1
- package/dist/run/managed-process.d.ts.map +1 -1
- package/dist/run/managed-process.js +6 -2
- package/dist/run/managed-process.js.map +1 -1
- package/dist/run/records.d.ts +14 -1
- package/dist/run/records.d.ts.map +1 -1
- package/dist/run/runner.d.ts +17 -9
- package/dist/run/runner.d.ts.map +1 -1
- package/dist/run/runner.js +180 -101
- package/dist/run/runner.js.map +1 -1
- package/dist/run/scheduler.d.ts +4 -6
- package/dist/run/scheduler.d.ts.map +1 -1
- package/dist/run/scheduler.js +51 -23
- package/dist/run/scheduler.js.map +1 -1
- package/dist/run/serial.d.ts +2 -4
- package/dist/run/serial.d.ts.map +1 -1
- package/dist/run/serial.js +4 -2
- package/dist/run/serial.js.map +1 -1
- package/dist/run/steps.d.ts +25 -0
- package/dist/run/steps.d.ts.map +1 -1
- package/dist/run/steps.js +12 -0
- package/dist/run/steps.js.map +1 -1
- package/dist/run/unit-runner.d.ts +7 -2
- package/dist/run/unit-runner.d.ts.map +1 -1
- package/dist/run/units.d.ts +10 -0
- package/dist/run/units.d.ts.map +1 -1
- package/dist/run/units.js +11 -0
- package/dist/run/units.js.map +1 -1
- package/dist/run/worker/entry.js +1 -0
- package/dist/run/worker/entry.js.map +1 -1
- package/dist/run/worker/handle.d.ts +1 -1
- package/dist/run/worker/handle.d.ts.map +1 -1
- package/dist/run/worker/handle.js +1 -1
- package/dist/run/worker/handle.js.map +1 -1
- package/dist/run/worker/protocol.d.ts +2 -0
- package/dist/run/worker/protocol.d.ts.map +1 -1
- package/dist/run/worker/protocol.js.map +1 -1
- package/dist/run/worker/session.d.ts +2 -0
- package/dist/run/worker/session.d.ts.map +1 -1
- package/dist/run/worker/session.js +1 -0
- package/dist/run/worker/session.js.map +1 -1
- package/dist/telemetry/telemetry.d.ts +2 -3
- package/dist/telemetry/telemetry.d.ts.map +1 -1
- package/dist/telemetry/telemetry.js +2 -3
- package/dist/telemetry/telemetry.js.map +1 -1
- package/dist/types.d.ts +159 -37
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -6
- package/skills/e2e/SKILL.md +0 -2
- package/skills/e2e/references/agent.md +20 -12
- package/skills/e2e/references/debugging.md +3 -1
- package/skills/e2e/references/running.md +4 -3
- package/skills/e2e/references/setup.md +13 -10
- package/skills/e2e/references/writing-tests.md +6 -5
- package/dist/internal/trace.d.ts +0 -18
- package/dist/internal/trace.d.ts.map +0 -1
- package/dist/internal/trace.js +0 -46
- package/dist/internal/trace.js.map +0 -1
- package/dist/run/public.d.ts +0 -19
- package/dist/run/public.d.ts.map +0 -1
- package/dist/run/public.js +0 -11
- package/dist/run/public.js.map +0 -1
|
@@ -51,17 +51,20 @@ E2E_MODEL=anthropic/claude-sonnet-4.5 E2E_MODEL_API_KEY=... npx --no-install e2e
|
|
|
51
51
|
import { credentials } from '@e2edev/e2e';
|
|
52
52
|
|
|
53
53
|
await agent.act('add a todo named "Buy milk" and mark it done');
|
|
54
|
-
await agent.act('invite {email} as an editor', { email: 'ada@example.test' });
|
|
54
|
+
await agent.act('invite {email} as an editor', { params: { email: 'ada@example.test' } });
|
|
55
55
|
|
|
56
56
|
const member = credentials.user('member');
|
|
57
57
|
await agent.act('sign in with the given credentials', {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
params: {
|
|
59
|
+
username: member.username,
|
|
60
|
+
password: member.password, // a Secret: the model sees its name, the runner fills the field
|
|
61
|
+
},
|
|
60
62
|
});
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
`act(instruction,
|
|
64
|
-
|
|
65
|
+
`act(instruction, options?)` plans and performs a multi-action flow and ends
|
|
66
|
+
in a verdict. Passed resolves with what the step did: `summary`, `modelCalls`,
|
|
67
|
+
`actions`, and `cache` (how the trace cache took part). Failed or blocked
|
|
65
68
|
throws an `AgentError` whose `code` says why: `ACTION_FAILED` for a plain
|
|
66
69
|
failure, `STEP_BUDGET_EXHAUSTED` or `STEP_TIMEOUT` when the budget or the
|
|
67
70
|
clock ran out, and a blocked code (`AUTH_CREDENTIAL_UNAVAILABLE`,
|
|
@@ -69,10 +72,11 @@ clock ran out, and a blocked code (`AUTH_CREDENTIAL_UNAVAILABLE`,
|
|
|
69
72
|
`AUTOMATION_UNSUPPORTED`) when something outside the product prevented a
|
|
70
73
|
verdict.
|
|
71
74
|
|
|
72
|
-
Options: `
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
Options: `params` (the values the instruction refers to; a `Secret` is filled
|
|
76
|
+
by the runner), `timeout` (default the test timeout), `maxSteps` (default 25
|
|
77
|
+
actions), `maxModelCalls` (default 25). Per-call budgets can only lower the
|
|
78
|
+
configured limits. `act` takes no `schema` and no `vision`: structured output
|
|
79
|
+
is `extract({ schema })`, and `vision` belongs to the judgments.
|
|
76
80
|
|
|
77
81
|
## assert, waitFor, extract: one question
|
|
78
82
|
|
|
@@ -82,7 +86,7 @@ import { z } from 'zod';
|
|
|
82
86
|
await agent.assert('the dashboard shows a trial badge'); // one look, one judgment
|
|
83
87
|
|
|
84
88
|
await agent.waitFor('the export finished and a download link appeared', { // polls
|
|
85
|
-
|
|
89
|
+
interval: 500,
|
|
86
90
|
timeout: 120_000,
|
|
87
91
|
});
|
|
88
92
|
|
|
@@ -95,7 +99,7 @@ expect(data.titles).toContain('Buy milk');
|
|
|
95
99
|
- `assert` does not poll. A false judgment is `ASSERTION_FAILED` with the
|
|
96
100
|
model's explanation and a screenshot in the report. Malformed output gets
|
|
97
101
|
one repair round, then `MODEL_OUTPUT_INVALID`.
|
|
98
|
-
- `waitFor` observes every `
|
|
102
|
+
- `waitFor` observes every `interval` (default 3 s) and spends a judgment
|
|
99
103
|
only when the screen changed; `STEP_TIMEOUT` after `timeout` (default
|
|
100
104
|
30 s).
|
|
101
105
|
- `extract` accepts any Standard Schema validator (zod works). Invalid output
|
|
@@ -136,7 +140,11 @@ the end state may not), and it is what lets the trace cache record the step.
|
|
|
136
140
|
## What the model sees
|
|
137
141
|
|
|
138
142
|
A redacted snapshot of the screen (roles, names, text, states), a summary of
|
|
139
|
-
prior steps, and your context.
|
|
143
|
+
prior steps, and your context. The first screen of a step arrives whole;
|
|
144
|
+
every action result after it reports what changed, keyed by node ids that
|
|
145
|
+
stay stable while an element exists, or the whole screen again when most of
|
|
146
|
+
it changed, and is read after the action's effect landed. Never raw HTML,
|
|
147
|
+
cookies, headers, environment
|
|
140
148
|
values, or a `Secret`'s value; password fields arrive masked. Pixels only
|
|
141
149
|
with `vision`, and only while no secret has been filled. Nothing the model
|
|
142
150
|
returns runs as code or selectors: the runner validates and authorizes every
|
|
@@ -16,7 +16,8 @@ jq '.run.results[] | select(.status != "passed") | .attempts[-1]
|
|
|
16
16
|
|
|
17
17
|
3. Artifacts named there live under `.e2e/artifacts/`: screenshots, a
|
|
18
18
|
Playwright `trace.zip` per attempt (`npx playwright show-trace <file>`),
|
|
19
|
-
downloads,
|
|
19
|
+
downloads, with `--video` a `video/video.webm` per attempt, and with
|
|
20
|
+
`--debug` the transcript of every agent step.
|
|
20
21
|
|
|
21
22
|
## Error codes and what to do
|
|
22
23
|
|
|
@@ -54,6 +55,7 @@ jq '.run.results[] | select(.status != "passed") | .attempts[-1]
|
|
|
54
55
|
| `--no-cache` | Rule out a stale `agent.act` replay |
|
|
55
56
|
| `--debug` | Read each agent step's duration, model calls, cost, and transcript |
|
|
56
57
|
| `--ai-trace`, then `npx unbox-ai runs .e2e/ai-trace.json` | See exactly what the model was shown and called |
|
|
58
|
+
| `--video` | Watch the failed attempt; `step.startedAt` minus the video artifact's `startedAt` is the step's offset into it |
|
|
57
59
|
| `command.log: '.e2e/logs/app.log'` | Read the app's own output when it never becomes ready or errors mid-test |
|
|
58
60
|
| `await app.screenshot('before-submit')` | Attach evidence at a chosen point |
|
|
59
61
|
| `CI=1 npx --no-install e2e run` | Reproduce CI-only behaviour: `ONLY_IN_CI`, read-only cache, `reuseExisting` ignored |
|
|
@@ -27,6 +27,7 @@ npx --no-install e2e telemetry [disable|enable] # anonymous usage telemetry: sta
|
|
|
27
27
|
| `--pass-with-no-tests` | Exit 0 when nothing matches instead of `NO_TESTS`. |
|
|
28
28
|
| `--debug` | Phase timings and an agent step table on stderr; step transcripts saved as artifacts. |
|
|
29
29
|
| `--ai-trace` | Record every model call to `.e2e/ai-trace.json`. |
|
|
30
|
+
| `--video` | Record every attempt (WebM on a browser engine, MP4 on a device engine) under its artifact directory; the failure recap names the file. Fails with `UNSUPPORTED_ARTIFACT` when the engine cannot record. |
|
|
30
31
|
|
|
31
32
|
```bash
|
|
32
33
|
npx --no-install e2e run tests/signup.e2e.ts
|
|
@@ -77,9 +78,9 @@ recorded flow is stale — `--no-cache` only skips the cache for one run.
|
|
|
77
78
|
- `junit`: `.e2e/junit.xml` beside the report, for CI test summaries.
|
|
78
79
|
Combine it with the terminal output: `--reporter list,junit`.
|
|
79
80
|
- `json`: the report document on stdout.
|
|
80
|
-
- Artifacts (screenshots, Playwright traces, `--
|
|
81
|
-
downloads) live under `.e2e/artifacts/`; every path is
|
|
82
|
-
report.
|
|
81
|
+
- Artifacts (screenshots, Playwright traces, `--video` recordings, `--debug`
|
|
82
|
+
transcripts, downloads) live under `.e2e/artifacts/`; every path is
|
|
83
|
+
recorded in the report.
|
|
83
84
|
|
|
84
85
|
## Exit codes
|
|
85
86
|
|
|
@@ -62,8 +62,6 @@ export default {
|
|
|
62
62
|
tests: 'tests/**/*.e2e.ts',
|
|
63
63
|
targets: [
|
|
64
64
|
{
|
|
65
|
-
name: 'web',
|
|
66
|
-
platform: 'web',
|
|
67
65
|
engine: playwright({
|
|
68
66
|
url: 'http://127.0.0.1:3000',
|
|
69
67
|
command: { executable: 'pnpm', args: ['dev'], log: '.e2e/logs/app.log' },
|
|
@@ -80,19 +78,19 @@ export default {
|
|
|
80
78
|
|
|
81
79
|
| Key | Default | Notes |
|
|
82
80
|
| --- | --- | --- |
|
|
83
|
-
| `targets` | required | Non-empty. Each target: `
|
|
81
|
+
| `targets` | required | Non-empty. Each target: `platform` (`web`, `ios`, `android`, or any label), `engine`, and an optional `name` (defaults to the platform; used by `--target` and in reports). |
|
|
84
82
|
| `tests` | `'tests/**/*.e2e.ts'` | A glob or an array of globs, `/` separators. |
|
|
85
83
|
| `timeout` | `120000` | Per test attempt, in ms. Also the default `agent.act` deadline. |
|
|
86
84
|
| `actionTimeout` | `30000` | Every locator action and engine operation, including each observation inside an agent step. Raise it for slow model providers. |
|
|
87
85
|
| `assertionTimeout` | `5000` | `expect` polling window. |
|
|
88
86
|
| `retries` | `0`, `1` in CI | 0 to 10. |
|
|
89
|
-
| `workers` | half the cores, `1` in CI | Test files run in parallel across workers
|
|
90
|
-
| `reporters` | `['list']` | `list`, `json`, `junit
|
|
87
|
+
| `workers` | half the cores, `1` in CI | Test files run in parallel across workers, at most the `workers` the engine declares per target (a device target: one per device). |
|
|
88
|
+
| `reporters` | `['list']` | `list`, `json`, `junit`, and reporter objects (`{ name, onEvent?, onRunFinished? }`) that receive the finished run. `json` excludes `list`; `--reporter` keeps the objects. |
|
|
91
89
|
| `cache` | `'read-write'`, `'read-only'` in CI | The trace cache for `agent.act`; `'off'` disables it. |
|
|
92
90
|
| `agent` | unset | `createAgent(...)`, an options block `{ model, context, visionModel, maxSteps, maxModelCalls, vision, providerOptions }`, or a custom `StepExecutor`. Omitted, the built-in agent runs with `E2E_MODEL`. A model passed to `createAgent({ model })` is the one model for `act` and the judgments, over `E2E_MODEL`. |
|
|
93
91
|
| `credentials` | `{}` | Named `{ username, password, allowedOrigins? }` entries; `password` may be a function returning the value. |
|
|
94
92
|
| `screen.testIdAttribute` | `'data-testid'` | Attribute read by `getByTestId`. |
|
|
95
|
-
| `artifacts` | `['screenshot', 'trace']` | Kinds to keep, or `{ kinds, store }
|
|
93
|
+
| `artifacts` | `['screenshot', 'trace']` | Kinds to keep (`screenshot`, `trace`, and the opt-in `video`), or `{ kinds, store, video }`; `video: { retain: 'on-failure' }` keeps only the recordings of attempts that did not pass. |
|
|
96
94
|
| `projectId` | the package name | Report and cache identity. |
|
|
97
95
|
|
|
98
96
|
## The app under test
|
|
@@ -119,8 +117,8 @@ Two browsers are two targets sharing one app declaration:
|
|
|
119
117
|
const app = { url: 'http://127.0.0.1:3000' };
|
|
120
118
|
export default {
|
|
121
119
|
targets: [
|
|
122
|
-
{ name: 'chromium',
|
|
123
|
-
{ name: 'mobile-webkit',
|
|
120
|
+
{ name: 'chromium', engine: playwright(app) },
|
|
121
|
+
{ name: 'mobile-webkit', engine: playwright({ ...app, browser: 'webkit', viewport: { width: 390, height: 844 } }) },
|
|
124
122
|
],
|
|
125
123
|
} satisfies E2EConfig;
|
|
126
124
|
```
|
|
@@ -209,7 +207,7 @@ import { agentDeviceTools } from '@e2edev/agent-device/tools';
|
|
|
209
207
|
const iphone = agentDevice({ platform: 'ios', app: 'com.example.app' });
|
|
210
208
|
|
|
211
209
|
export default {
|
|
212
|
-
targets: [{
|
|
210
|
+
targets: [{ engine: iphone }],
|
|
213
211
|
workers: 1,
|
|
214
212
|
agent: createAgent({ tools: agentDeviceTools(iphone) }),
|
|
215
213
|
} satisfies E2EConfig;
|
|
@@ -218,7 +216,12 @@ export default {
|
|
|
218
216
|
- `app` is a bundle id, package name, or display name opened fresh per
|
|
219
217
|
attempt. `appPath` installs a `.app` or `.apk` once per worker; without
|
|
220
218
|
`app`, the installed bundle is the one opened.
|
|
221
|
-
-
|
|
219
|
+
- One worker per device. With no `device`, every booted simulator or
|
|
220
|
+
emulator of the platform is the pool, as many as `workers` allows, so
|
|
221
|
+
booting four simulators runs the files four at a time with no config. A
|
|
222
|
+
single `device` runs one worker whatever `workers` says; a list,
|
|
223
|
+
`device: ['iPhone 17', 'iPhone 17 Pro']`, is an explicit pool. Devices boot
|
|
224
|
+
in `prepare`, before the run's clock starts.
|
|
222
225
|
- Cancelled device commands keep running; the next attempt waits for them.
|
|
223
226
|
Raw screenshot files are removed when capture finishes, including after
|
|
224
227
|
cancellation.
|
|
@@ -93,7 +93,6 @@ Fixtures are lazy; destructure them in the callback.
|
|
|
93
93
|
| `back()` | One history step back. |
|
|
94
94
|
| `restart()` | Recreates the context and keeps persisted state, including a restored session. |
|
|
95
95
|
| `clearState()` | Clears cookies and storage, then relaunches. Not inside a serial group. |
|
|
96
|
-
| `deepLink(url)` | Opens an allowed deep or universal link. |
|
|
97
96
|
| `screenshot(label?)` | Saves a redacted screenshot as an artifact and returns its path. |
|
|
98
97
|
|
|
99
98
|
## Locators
|
|
@@ -104,7 +103,7 @@ subtree.
|
|
|
104
103
|
|
|
105
104
|
| Query | Matches |
|
|
106
105
|
| --- | --- |
|
|
107
|
-
| `getByRole(role, { name?, exact?, checked?, disabled?, selected?, expanded?,
|
|
106
|
+
| `getByRole(role, { name?, exact?, checked?, disabled?, selected?, expanded?, visible? })` | Semantic role, optionally by accessible name and state. First choice. |
|
|
108
107
|
| `getByLabel(text, { exact?, visible? })` | Form controls by label. |
|
|
109
108
|
| `getByPlaceholder(text)` | Inputs by placeholder. |
|
|
110
109
|
| `getByText(text, { exact?, visible? })` | Visible text. |
|
|
@@ -118,7 +117,9 @@ Roles: `button`, `link`, `textbox`, `searchbox`, `combobox`, `listbox`,
|
|
|
118
117
|
`contentinfo`, `complementary`, `region`. The union is closed; anything else
|
|
119
118
|
is a type error.
|
|
120
119
|
|
|
121
|
-
Text matching is exact by default after whitespace normalization
|
|
120
|
+
Text matching is exact by default after whitespace normalization, and
|
|
121
|
+
`getByText` returns the innermost match: a container that echoes its child's
|
|
122
|
+
text (an iOS Text host view around its StaticText) does not count twice.
|
|
122
123
|
`exact: false` is a case-insensitive substring match; a `RegExp` matches as
|
|
123
124
|
written.
|
|
124
125
|
|
|
@@ -146,9 +147,9 @@ await screen.scrollUntilVisible(screen.getByRole('button', { name: 'Accept' }));
|
|
|
146
147
|
Each action resolves one node, waits for it to be actionable within
|
|
147
148
|
`config.actionTimeout` (30 s, or `{ timeout }`), and performs one operation.
|
|
148
149
|
|
|
149
|
-
`tap()` (alias `click()`), `doubleTap()`, `longPress({
|
|
150
|
+
`tap()` (alias `click()`), `doubleTap()`, `longPress({ duration? })`,
|
|
150
151
|
`fill(value | Secret)`, `clear()`, `press(key)`, `check()`, `uncheck()`,
|
|
151
|
-
`selectOption(label | { label } | { index })`, `focus()`, `hover()`,
|
|
152
|
+
`selectOption(label | { label } | { value } | { index })`, `focus()`, `hover()`,
|
|
152
153
|
`setInputFiles(paths)` (relative to the project root), `dragTo(locator)`,
|
|
153
154
|
`scrollIntoView()`, `swipe({ direction, momentum? })`.
|
|
154
155
|
|
package/dist/internal/trace.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Live agent tracing for iterating on agentic tests: `E2E_DEBUG=agent` streams
|
|
3
|
-
* every invocation phase, model selection, and locate-candidate outcome to
|
|
4
|
-
* stderr as it happens, from whichever process runs the attempt. This is a
|
|
5
|
-
* debugging aid, not telemetry: the report stays the canonical record.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Writes one bounded, sanitized trace line when agent tracing is on. Takes a
|
|
9
|
-
* thunk so call sites in polling loops pay nothing while tracing is off.
|
|
10
|
-
*/
|
|
11
|
-
export declare function agentTrace(message: () => string): void;
|
|
12
|
-
/**
|
|
13
|
-
* Dumps one full observation as the model will receive it. The text is
|
|
14
|
-
* already redacted and size-bounded by the observation pipeline, so the dump
|
|
15
|
-
* needs no further truncation to stay safe.
|
|
16
|
-
*/
|
|
17
|
-
export declare function observationTrace(header: () => string, text: string): void;
|
|
18
|
-
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/internal/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6BH;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,MAAM,GAAG,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAGzE"}
|
package/dist/internal/trace.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Live agent tracing for iterating on agentic tests: `E2E_DEBUG=agent` streams
|
|
3
|
-
* every invocation phase, model selection, and locate-candidate outcome to
|
|
4
|
-
* stderr as it happens, from whichever process runs the attempt. This is a
|
|
5
|
-
* debugging aid, not telemetry: the report stays the canonical record.
|
|
6
|
-
*/
|
|
7
|
-
import { sanitizeText, truncateUtf8 } from './errors.js';
|
|
8
|
-
/**
|
|
9
|
-
* Parsed on first use, not at import, so tests and embedders can set
|
|
10
|
-
* `E2E_DEBUG` after this module loads but before the first trace call.
|
|
11
|
-
*/
|
|
12
|
-
let cachedFlags;
|
|
13
|
-
function flags() {
|
|
14
|
-
cachedFlags ??= new Set((process.env['E2E_DEBUG'] ?? '')
|
|
15
|
-
.split(',')
|
|
16
|
-
.map((flag) => flag.trim())
|
|
17
|
-
.filter((flag) => flag !== ''));
|
|
18
|
-
return cachedFlags;
|
|
19
|
-
}
|
|
20
|
-
function agentTraceEnabled() {
|
|
21
|
-
return flags().has('agent') || flags().has('all');
|
|
22
|
-
}
|
|
23
|
-
/** `E2E_DEBUG=observations` additionally dumps every observation the model sees. */
|
|
24
|
-
function observationTraceEnabled() {
|
|
25
|
-
return flags().has('observations') || flags().has('all');
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Writes one bounded, sanitized trace line when agent tracing is on. Takes a
|
|
29
|
-
* thunk so call sites in polling loops pay nothing while tracing is off.
|
|
30
|
-
*/
|
|
31
|
-
export function agentTrace(message) {
|
|
32
|
-
if (!agentTraceEnabled())
|
|
33
|
-
return;
|
|
34
|
-
process.stderr.write(`[e2e agent] ${truncateUtf8(sanitizeText(message()), 2_000)}\n`);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Dumps one full observation as the model will receive it. The text is
|
|
38
|
-
* already redacted and size-bounded by the observation pipeline, so the dump
|
|
39
|
-
* needs no further truncation to stay safe.
|
|
40
|
-
*/
|
|
41
|
-
export function observationTrace(header, text) {
|
|
42
|
-
if (!observationTraceEnabled())
|
|
43
|
-
return;
|
|
44
|
-
process.stderr.write(`[e2e observation] ${header()}\n${text}\n[e2e observation] end\n`);
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=trace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../src/internal/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD;;;GAGG;AACH,IAAI,WAA4C,CAAC;AAEjD,SAAS,KAAK;IACZ,WAAW,KAAK,IAAI,GAAG,CACrB,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SAC7B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CACjC,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO,KAAK,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,oFAAoF;AACpF,SAAS,uBAAuB;IAC9B,OAAO,KAAK,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,KAAK,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAAqB;IAC9C,IAAI,CAAC,iBAAiB,EAAE;QAAE,OAAO;IACjC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,YAAY,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;AACxF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAoB,EAAE,IAAY;IACjE,IAAI,CAAC,uBAAuB,EAAE;QAAE,OAAO;IACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,MAAM,EAAE,KAAK,IAAI,2BAA2B,CAAC,CAAC;AAC1F,CAAC"}
|
package/dist/run/public.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Programmatic host surface (`@e2edev/e2e/run`): run the runner in-process and stream
|
|
3
|
-
* structured events, without shelling out to the CLI. This is how an
|
|
4
|
-
* embedding host — a hosted platform, a CI wrapper, an IDE — drives runs.
|
|
5
|
-
*
|
|
6
|
-
* The CLI is a thin consumer of exactly this surface; nothing here is
|
|
7
|
-
* CLI-only. The surface is host tooling, not part of sdk-0.1: it can grow in
|
|
8
|
-
* minors, and `report.json` (report-1) stays the canonical record of a run.
|
|
9
|
-
*/
|
|
10
|
-
export { run } from './runner.ts';
|
|
11
|
-
export type { RunOptions, RunOutcome } from './runner.ts';
|
|
12
|
-
export type { RunEvent, RunEventFact, RunEventHeader, RunEventOf, RunEventResult, RunEventSink, RunExitCode, RunStatus, SetupStep, } from './events.ts';
|
|
13
|
-
export type { ArtifactProducer, ArtifactRecord, AttemptRecord, ResultRecord, ResultStatus, RunError, SerialAttemptRecord, SerialGroupRecord, SerialMemberRecord, } from './records.ts';
|
|
14
|
-
export type { StepAgentDetails, StepCacheInfo, StepEvent, StepKind, StepMetrics, StepModelInfo, StepProgress, StepRecord, } from './steps.ts';
|
|
15
|
-
export type { Report1Document } from '../report/build.ts';
|
|
16
|
-
export type { ErrorCategory, ErrorPhase, SerializedError } from '../internal/errors.ts';
|
|
17
|
-
export type { TestIdentity } from '../collect/collect.ts';
|
|
18
|
-
export type { SkipInfo } from '../collect/select.ts';
|
|
19
|
-
//# sourceMappingURL=public.d.ts.map
|
package/dist/run/public.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/run/public.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EACT,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxF,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/run/public.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Programmatic host surface (`@e2edev/e2e/run`): run the runner in-process and stream
|
|
3
|
-
* structured events, without shelling out to the CLI. This is how an
|
|
4
|
-
* embedding host — a hosted platform, a CI wrapper, an IDE — drives runs.
|
|
5
|
-
*
|
|
6
|
-
* The CLI is a thin consumer of exactly this surface; nothing here is
|
|
7
|
-
* CLI-only. The surface is host tooling, not part of sdk-0.1: it can grow in
|
|
8
|
-
* minors, and `report.json` (report-1) stays the canonical record of a run.
|
|
9
|
-
*/
|
|
10
|
-
export { run } from './runner.js';
|
|
11
|
-
//# sourceMappingURL=public.js.map
|
package/dist/run/public.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/run/public.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
|