e2e 0.21.1 → 0.21.2
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 +2 -0
- package/dist/.build.json +1 -1
- package/dist/agent/act-validation.js +1 -0
- package/dist/agent/act.js +7 -3
- package/dist/agent/action-dispatcher.js +30 -8
- package/dist/agent/actions.d.ts +2 -0
- package/dist/agent/actions.js +5 -2
- package/dist/agent/error.js +1 -0
- package/dist/agent/executor.d.ts +14 -6
- package/dist/agent/index.js +5 -1
- package/dist/agent/invocation.d.ts +3 -0
- package/dist/agent/model/sdk.d.ts +5 -0
- package/dist/agent/model/sdk.js +18 -1
- package/dist/agent/observation.js +1 -0
- package/dist/agent/primitives.js +14 -3
- package/dist/agent/replay.js +9 -3
- package/dist/agent/step-cache.d.ts +3 -2
- package/dist/agent/step-cache.js +7 -4
- package/dist/agent/tool-loop.js +4 -1
- package/dist/cache/context.js +1 -1
- package/dist/cache/recorder.d.ts +2 -1
- package/dist/cache/recorder.js +11 -2
- package/dist/cache/trace-fields.d.ts +10 -0
- package/dist/cache/trace-fields.js +17 -0
- package/dist/cache/trace.d.ts +9 -1
- package/dist/cache/trace.js +26 -7
- package/dist/cli/feedback.js +2 -1
- package/dist/cli/init/sibling-versions.json +1 -1
- package/dist/collect/select.js +12 -2
- package/dist/config/agent.d.ts +1 -1
- package/dist/config/diagnose.js +9 -3
- package/dist/config/esm-hooks.js +3 -2
- package/dist/config/resolve.js +3 -2
- package/dist/config/typescript.js +52 -2
- package/dist/engine/contract.d.ts +3 -2
- package/dist/engine/manifest.js +2 -2
- package/dist/internal/errors.js +5 -2
- package/dist/internal/source.js +2 -0
- package/dist/internal/unserved-model.d.ts +5 -0
- package/dist/internal/unserved-model.js +22 -0
- package/dist/locator/screen.js +1 -2
- package/dist/oauth/copilot.js +23 -5
- package/dist/oauth/device-code.js +35 -19
- package/dist/oauth/errors.d.ts +3 -0
- package/dist/oauth/errors.js +26 -11
- package/dist/oauth/providers/github-copilot.d.ts +4 -0
- package/dist/oauth/providers/github-copilot.js +64 -16
- package/dist/oauth/providers/openai.d.ts +2 -2
- package/dist/oauth/providers/openai.js +47 -19
- package/dist/oauth/providers/opencode-console.js +36 -15
- package/dist/oauth/providers/xai.js +18 -9
- package/dist/oauth/token-endpoint.d.ts +15 -6
- package/dist/oauth/token-endpoint.js +18 -6
- package/dist/report/code-frame.js +9 -3
- package/dist/report/failure-text.d.ts +10 -2
- package/dist/report/failure-text.js +24 -8
- package/dist/report/list-model.d.ts +13 -0
- package/dist/report/list-steps.d.ts +6 -1
- package/dist/report/list-steps.js +29 -0
- package/dist/report/list.d.ts +1 -0
- package/dist/report/list.js +16 -7
- package/dist/report/live-window.js +2 -1
- package/dist/report/markdown.js +1 -1
- package/dist/run/fixtures.js +2 -0
- package/dist/run/host-trace.d.ts +3 -2
- package/dist/run/host-trace.js +2 -1
- package/dist/run/last-run.d.ts +9 -0
- package/dist/run/last-run.js +28 -0
- package/dist/run/open-session.d.ts +3 -1
- package/dist/run/open-session.js +1 -1
- package/dist/run/runner.js +6 -2
- package/dist/run/sessions.js +3 -3
- package/dist/run/standalone-attempt.d.ts +2 -1
- package/dist/run/standalone-attempt.js +3 -1
- package/dist/run/steps.d.ts +3 -1
- package/dist/run/units.d.ts +8 -0
- package/dist/run/units.js +14 -0
- package/dist/run/worker-models.d.ts +2 -0
- package/dist/run/worker-models.js +7 -0
- package/dist/types.d.ts +2 -2
- package/docs/authentication.mdx +26 -23
- package/docs/browser.mdx +7 -4
- package/docs/bug-bash.mdx +2 -2
- package/docs/cache.mdx +6 -1
- package/docs/ci/bitrise.mdx +1 -1
- package/docs/ci/codemagic.mdx +2 -2
- package/docs/ci/eas-workflows.mdx +1 -1
- package/docs/coding-agents.mdx +7 -35
- package/docs/debugging.mdx +24 -36
- package/docs/executors.mdx +1 -1
- package/docs/github.mdx +2 -1
- package/docs/integrations/eas.mdx +1 -1
- package/docs/integrations/index.mdx +6 -0
- package/docs/integrations/lightpanda.mdx +192 -0
- package/docs/integrations/testmu.mdx +152 -0
- package/docs/mcp.mdx +123 -0
- package/docs/migrate/detox.mdx +1 -1
- package/docs/migrate/maestro.mdx +101 -105
- package/docs/migrate/playwright.mdx +65 -70
- package/docs/mobile.mdx +18 -3
- package/docs/models.mdx +4 -2
- package/docs/quickstart.mdx +7 -0
- package/docs/reference/agent.mdx +369 -277
- package/docs/reference/app.mdx +141 -32
- package/docs/reference/cli.mdx +674 -558
- package/docs/reference/config.mdx +1406 -752
- package/docs/reference/engine.mdx +1062 -256
- package/docs/reference/environment.mdx +156 -84
- package/docs/reference/errors.mdx +106 -72
- package/docs/reference/expect.mdx +752 -372
- package/docs/reference/mcp.mdx +366 -141
- package/docs/reference/mobile.mdx +844 -403
- package/docs/reference/reporters.mdx +312 -106
- package/docs/reference/runner.mdx +373 -174
- package/docs/reference/screen.mdx +931 -398
- package/docs/reference/security.mdx +106 -40
- package/docs/reference/test.mdx +626 -273
- package/docs/reference/web.mdx +956 -533
- package/docs/security.mdx +6 -5
- package/docs/snippets/model-provider.jsx +763 -0
- package/docs/snippets/setup-prompt-card.jsx +22 -0
- package/docs/snippets/show-more.jsx +22 -0
- package/docs/snippets/video-card.jsx +34 -0
- package/docs/snippets/video.jsx +25 -0
- package/docs/subscriptions.mdx +10 -3
- package/docs/telemetry.mdx +39 -39
- package/package.json +3 -2
- package/schema/report-v1.schema.json +6 -0
- package/skills/e2e/references/agent.md +8 -3
- package/skills/e2e/references/debugging.md +1 -1
- package/skills/e2e/references/mcp.md +1 -1
- package/skills/e2e/references/setup.md +12 -3
- package/skills/e2e/references/writing-tests.md +1 -1
package/docs/reference/app.mdx
CHANGED
|
@@ -6,10 +6,147 @@ icon: "cube"
|
|
|
6
6
|
"twitter:image": "https://e2e.tester.army/docs/images/og/reference/app.png?v=0b63e99aab"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
`app`
|
|
10
|
-
|
|
9
|
+
The `app` fixture opens, restarts, and resets the app under test, and takes
|
|
10
|
+
screenshots. It is on every target. A method the engine can't perform fails
|
|
11
11
|
with `UNSUPPORTED_CAPABILITY`.
|
|
12
12
|
|
|
13
|
+
```ts title="tests/billing.e2e.ts"
|
|
14
|
+
import { expect, test } from 'e2e';
|
|
15
|
+
|
|
16
|
+
test('billing page', async ({ app, screen }) => {
|
|
17
|
+
await app.open('/settings/billing');
|
|
18
|
+
await expect(screen.getByRole('heading', { name: 'Billing' })).toBeVisible();
|
|
19
|
+
await app.screenshot('billing');
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Reference
|
|
24
|
+
|
|
25
|
+
| Member | Returns |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| [`baseUrl`](#baseurl) | `string \| undefined` |
|
|
28
|
+
| [`open`](#open) | `Promise<void>` |
|
|
29
|
+
| [`restart`](#restart) | `Promise<void>` |
|
|
30
|
+
| [`clearState`](#clearstate) | `Promise<void>` |
|
|
31
|
+
| [`back`](#back) | `Promise<void>` |
|
|
32
|
+
| [`screenshot`](#screenshot) | `Promise<string>` |
|
|
33
|
+
|
|
34
|
+
`open`, `restart`, and `clearState` are bounded by `timeout`. `back` and
|
|
35
|
+
`screenshot` are bounded by `actionTimeout`. Both come from the
|
|
36
|
+
[config](/reference/config): `timeout` defaults to 120000 ms and
|
|
37
|
+
`actionTimeout` to 30000 ms. The remaining test timeout caps both. `app`
|
|
38
|
+
methods take no per-call timeout option.
|
|
39
|
+
|
|
40
|
+
### `baseUrl`
|
|
41
|
+
|
|
42
|
+
The resolved base URL of the target's app.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const health = await fetch(`${app.baseUrl}/api/health`);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- When `app.url` declares port `0`, `baseUrl` carries the port the run
|
|
49
|
+
allocated.
|
|
50
|
+
- On a target that declares no `app.url`, it is `undefined`.
|
|
51
|
+
|
|
52
|
+
### `open`
|
|
53
|
+
|
|
54
|
+
Opens the app: the declared URL, a path relative to it, or any absolute
|
|
55
|
+
`http(s)` URL.
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
await app.open(); // the target's app.url
|
|
59
|
+
await app.open('/settings/billing'); // a path relative to app.url
|
|
60
|
+
await app.open('https://example.com/login'); // any http(s) URL
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
On a device target, which has no URL, `open()` launches the pinned app fresh
|
|
64
|
+
and takes no path.
|
|
65
|
+
|
|
66
|
+
| Throws | When |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `APP_URL_REQUIRED` | A path, on a target that declares no `app.url`. |
|
|
69
|
+
| `POLICY_DENIED` | A URL whose scheme is not `http:` or `https:`. `about:blank` is allowed. |
|
|
70
|
+
| `APP_UNREACHABLE` | The app URL could not be reached. |
|
|
71
|
+
| `ACTION_FAILED` | The operation failed or timed out. |
|
|
72
|
+
| `UNSUPPORTED_CAPABILITY` | No `session.open` on a target with a URL, or no `session.restart` on one without. |
|
|
73
|
+
|
|
74
|
+
### `restart`
|
|
75
|
+
|
|
76
|
+
Recreates the execution context and keeps persisted state. Then it reopens
|
|
77
|
+
the app at its base URL when the target declares one.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
await app.restart();
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Throws | When |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `ACTION_FAILED`, `ENGINE_FAILURE` | The operation or the engine failed. |
|
|
86
|
+
| `UNSUPPORTED_CAPABILITY` | No `session.restart`. |
|
|
87
|
+
|
|
88
|
+
### `clearState`
|
|
89
|
+
|
|
90
|
+
Clears persisted client state and recreates the execution context. Then it
|
|
91
|
+
reopens the app at its base URL when the target declares one.
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
test.beforeEach(async ({ app }) => {
|
|
95
|
+
await app.clearState();
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
| Throws | When |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| `ACTION_FAILED`, `ENGINE_FAILURE` | The operation or the engine failed. |
|
|
102
|
+
| `UNSUPPORTED_CAPABILITY` | No `session.reset`. |
|
|
103
|
+
|
|
104
|
+
<Warning>
|
|
105
|
+
`clearState` inside a serial group destroys the shared state the group
|
|
106
|
+
depends on. Use it in `beforeEach` of an ordinary group instead.
|
|
107
|
+
</Warning>
|
|
108
|
+
|
|
109
|
+
### `back`
|
|
110
|
+
|
|
111
|
+
Navigates back once.
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
await app.back();
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| Throws | When |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `APP_NOT_OPEN` | `app.open()` has not run, or the engine reported invalid state. |
|
|
120
|
+
| `ACTION_FAILED` | The operation failed or timed out. |
|
|
121
|
+
| `UNSUPPORTED_CAPABILITY` | No `session.back`. |
|
|
122
|
+
|
|
123
|
+
### `screenshot`
|
|
124
|
+
|
|
125
|
+
Captures a redacted evidence screenshot and returns its path.
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
const shot = await app.screenshot('after-checkout');
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
- The file is an attempt artifact under `screenshots/`. The returned path is
|
|
132
|
+
relative to the attempt's artifact directory. The report records the path
|
|
133
|
+
relative to the artifact root.
|
|
134
|
+
- `label` names the step and joins the file name.
|
|
135
|
+
|
|
136
|
+
| Throws | When |
|
|
137
|
+
| --- | --- |
|
|
138
|
+
| `POLICY_DENIED` | A `Secret` was filled earlier in the session. |
|
|
139
|
+
| `UNSUPPORTED_CAPABILITY` | The engine takes no screenshots. |
|
|
140
|
+
| `ENGINE_FAILURE` | The capture failed. |
|
|
141
|
+
|
|
142
|
+
<Note>
|
|
143
|
+
Once a `Secret` has been filled, pixels are withheld for the rest of the
|
|
144
|
+
session, including later tests in a serial group. A denied screenshot creates
|
|
145
|
+
no artifact.
|
|
146
|
+
</Note>
|
|
147
|
+
|
|
148
|
+
## Types
|
|
149
|
+
|
|
13
150
|
```ts
|
|
14
151
|
export interface App {
|
|
15
152
|
/**
|
|
@@ -41,35 +178,7 @@ export interface App {
|
|
|
41
178
|
}
|
|
42
179
|
```
|
|
43
180
|
|
|
44
|
-
|
|
45
|
-
timeout. They do not accept per-call timeout options.
|
|
46
|
-
|
|
47
|
-
| Method | Timeout | Throws |
|
|
48
|
-
| --- | --- | --- |
|
|
49
|
-
| `open(path?)` | `config.timeout`, 120000 ms | `APP_URL_REQUIRED` for a path when the target declares no `app.url`, `POLICY_DENIED` for a URL whose scheme is not `http:` or `https:` (`about:blank` aside), `APP_UNREACHABLE`, `ACTION_FAILED`, `UNSUPPORTED_CAPABILITY` without `session.open` on a target with a URL or without `session.restart` on one without (a device launches its pinned app) |
|
|
50
|
-
| `restart()` | `config.timeout`, 120000 ms | `ACTION_FAILED`, `ENGINE_FAILURE`, `UNSUPPORTED_CAPABILITY` without `session.restart` |
|
|
51
|
-
| `clearState()` | `config.timeout`, 120000 ms | `ACTION_FAILED`, `ENGINE_FAILURE`, `UNSUPPORTED_CAPABILITY` without `session.reset` |
|
|
52
|
-
| `back()` | `config.actionTimeout`, 30000 ms | `APP_NOT_OPEN`, `ACTION_FAILED`, `UNSUPPORTED_CAPABILITY` without `session.back` |
|
|
53
|
-
| `screenshot(label?)` | `config.actionTimeout`, 30000 ms | `POLICY_DENIED` after a secret fill, `UNSUPPORTED_CAPABILITY`, `ENGINE_FAILURE` |
|
|
54
|
-
|
|
55
|
-
`screenshot` registers the file as an attempt artifact and returns its path
|
|
56
|
-
relative to the attempt's artifact directory, under `screenshots/`; the report
|
|
57
|
-
records the artifact-root-relative path. `label` names the step and joins the
|
|
58
|
-
file name.
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
await app.open('/settings/billing');
|
|
62
|
-
const shot = await app.screenshot('after-checkout');
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
<Warning>
|
|
66
|
-
`clearState` inside a serial group destroys the shared state the group
|
|
67
|
-
depends on. Use it in `beforeEach` of an ordinary group instead.
|
|
68
|
-
</Warning>
|
|
69
|
-
|
|
70
|
-
Once a `Secret` has been filled, pixels are withheld for the rest of the
|
|
71
|
-
session, including later tests in a serial group. `app.screenshot()` then
|
|
72
|
-
fails with `POLICY_DENIED` and creates no artifact.
|
|
181
|
+
## Related
|
|
73
182
|
|
|
74
|
-
Browser-only operations live on the [`browser`](/reference/web) fixture
|
|
183
|
+
Browser-only operations live on the [`browser`](/reference/web) fixture, and
|
|
75
184
|
device operations on [`device`](/reference/mobile).
|