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.
Files changed (133) hide show
  1. package/README.md +2 -0
  2. package/dist/.build.json +1 -1
  3. package/dist/agent/act-validation.js +1 -0
  4. package/dist/agent/act.js +7 -3
  5. package/dist/agent/action-dispatcher.js +30 -8
  6. package/dist/agent/actions.d.ts +2 -0
  7. package/dist/agent/actions.js +5 -2
  8. package/dist/agent/error.js +1 -0
  9. package/dist/agent/executor.d.ts +14 -6
  10. package/dist/agent/index.js +5 -1
  11. package/dist/agent/invocation.d.ts +3 -0
  12. package/dist/agent/model/sdk.d.ts +5 -0
  13. package/dist/agent/model/sdk.js +18 -1
  14. package/dist/agent/observation.js +1 -0
  15. package/dist/agent/primitives.js +14 -3
  16. package/dist/agent/replay.js +9 -3
  17. package/dist/agent/step-cache.d.ts +3 -2
  18. package/dist/agent/step-cache.js +7 -4
  19. package/dist/agent/tool-loop.js +4 -1
  20. package/dist/cache/context.js +1 -1
  21. package/dist/cache/recorder.d.ts +2 -1
  22. package/dist/cache/recorder.js +11 -2
  23. package/dist/cache/trace-fields.d.ts +10 -0
  24. package/dist/cache/trace-fields.js +17 -0
  25. package/dist/cache/trace.d.ts +9 -1
  26. package/dist/cache/trace.js +26 -7
  27. package/dist/cli/feedback.js +2 -1
  28. package/dist/cli/init/sibling-versions.json +1 -1
  29. package/dist/collect/select.js +12 -2
  30. package/dist/config/agent.d.ts +1 -1
  31. package/dist/config/diagnose.js +9 -3
  32. package/dist/config/esm-hooks.js +3 -2
  33. package/dist/config/resolve.js +3 -2
  34. package/dist/config/typescript.js +52 -2
  35. package/dist/engine/contract.d.ts +3 -2
  36. package/dist/engine/manifest.js +2 -2
  37. package/dist/internal/errors.js +5 -2
  38. package/dist/internal/source.js +2 -0
  39. package/dist/internal/unserved-model.d.ts +5 -0
  40. package/dist/internal/unserved-model.js +22 -0
  41. package/dist/locator/screen.js +1 -2
  42. package/dist/oauth/copilot.js +23 -5
  43. package/dist/oauth/device-code.js +35 -19
  44. package/dist/oauth/errors.d.ts +3 -0
  45. package/dist/oauth/errors.js +26 -11
  46. package/dist/oauth/providers/github-copilot.d.ts +4 -0
  47. package/dist/oauth/providers/github-copilot.js +64 -16
  48. package/dist/oauth/providers/openai.d.ts +2 -2
  49. package/dist/oauth/providers/openai.js +47 -19
  50. package/dist/oauth/providers/opencode-console.js +36 -15
  51. package/dist/oauth/providers/xai.js +18 -9
  52. package/dist/oauth/token-endpoint.d.ts +15 -6
  53. package/dist/oauth/token-endpoint.js +18 -6
  54. package/dist/report/code-frame.js +9 -3
  55. package/dist/report/failure-text.d.ts +10 -2
  56. package/dist/report/failure-text.js +24 -8
  57. package/dist/report/list-model.d.ts +13 -0
  58. package/dist/report/list-steps.d.ts +6 -1
  59. package/dist/report/list-steps.js +29 -0
  60. package/dist/report/list.d.ts +1 -0
  61. package/dist/report/list.js +16 -7
  62. package/dist/report/live-window.js +2 -1
  63. package/dist/report/markdown.js +1 -1
  64. package/dist/run/fixtures.js +2 -0
  65. package/dist/run/host-trace.d.ts +3 -2
  66. package/dist/run/host-trace.js +2 -1
  67. package/dist/run/last-run.d.ts +9 -0
  68. package/dist/run/last-run.js +28 -0
  69. package/dist/run/open-session.d.ts +3 -1
  70. package/dist/run/open-session.js +1 -1
  71. package/dist/run/runner.js +6 -2
  72. package/dist/run/sessions.js +3 -3
  73. package/dist/run/standalone-attempt.d.ts +2 -1
  74. package/dist/run/standalone-attempt.js +3 -1
  75. package/dist/run/steps.d.ts +3 -1
  76. package/dist/run/units.d.ts +8 -0
  77. package/dist/run/units.js +14 -0
  78. package/dist/run/worker-models.d.ts +2 -0
  79. package/dist/run/worker-models.js +7 -0
  80. package/dist/types.d.ts +2 -2
  81. package/docs/authentication.mdx +26 -23
  82. package/docs/browser.mdx +7 -4
  83. package/docs/bug-bash.mdx +2 -2
  84. package/docs/cache.mdx +6 -1
  85. package/docs/ci/bitrise.mdx +1 -1
  86. package/docs/ci/codemagic.mdx +2 -2
  87. package/docs/ci/eas-workflows.mdx +1 -1
  88. package/docs/coding-agents.mdx +7 -35
  89. package/docs/debugging.mdx +24 -36
  90. package/docs/executors.mdx +1 -1
  91. package/docs/github.mdx +2 -1
  92. package/docs/integrations/eas.mdx +1 -1
  93. package/docs/integrations/index.mdx +6 -0
  94. package/docs/integrations/lightpanda.mdx +192 -0
  95. package/docs/integrations/testmu.mdx +152 -0
  96. package/docs/mcp.mdx +123 -0
  97. package/docs/migrate/detox.mdx +1 -1
  98. package/docs/migrate/maestro.mdx +101 -105
  99. package/docs/migrate/playwright.mdx +65 -70
  100. package/docs/mobile.mdx +18 -3
  101. package/docs/models.mdx +4 -2
  102. package/docs/quickstart.mdx +7 -0
  103. package/docs/reference/agent.mdx +369 -277
  104. package/docs/reference/app.mdx +141 -32
  105. package/docs/reference/cli.mdx +674 -558
  106. package/docs/reference/config.mdx +1406 -752
  107. package/docs/reference/engine.mdx +1062 -256
  108. package/docs/reference/environment.mdx +156 -84
  109. package/docs/reference/errors.mdx +106 -72
  110. package/docs/reference/expect.mdx +752 -372
  111. package/docs/reference/mcp.mdx +366 -141
  112. package/docs/reference/mobile.mdx +844 -403
  113. package/docs/reference/reporters.mdx +312 -106
  114. package/docs/reference/runner.mdx +373 -174
  115. package/docs/reference/screen.mdx +931 -398
  116. package/docs/reference/security.mdx +106 -40
  117. package/docs/reference/test.mdx +626 -273
  118. package/docs/reference/web.mdx +956 -533
  119. package/docs/security.mdx +6 -5
  120. package/docs/snippets/model-provider.jsx +763 -0
  121. package/docs/snippets/setup-prompt-card.jsx +22 -0
  122. package/docs/snippets/show-more.jsx +22 -0
  123. package/docs/snippets/video-card.jsx +34 -0
  124. package/docs/snippets/video.jsx +25 -0
  125. package/docs/subscriptions.mdx +10 -3
  126. package/docs/telemetry.mdx +39 -39
  127. package/package.json +3 -2
  128. package/schema/report-v1.schema.json +6 -0
  129. package/skills/e2e/references/agent.md +8 -3
  130. package/skills/e2e/references/debugging.md +1 -1
  131. package/skills/e2e/references/mcp.md +1 -1
  132. package/skills/e2e/references/setup.md +12 -3
  133. package/skills/e2e/references/writing-tests.md +1 -1
@@ -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` controls the app's lifecycle and captures screenshots. Each method
10
- requires the corresponding engine capability; unsupported operations fail
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
- `app` methods use the configured timeouts below, capped by the remaining test
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).