@testdriverai/agent 7.11.150-test → 7.11.151-canary

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 (38) hide show
  1. package/ai/skills/testdriver-agent/SKILL.md +15 -15
  2. package/ai/skills/testdriver-aws-setup/SKILL.md +6 -6
  3. package/ai/skills/testdriver-cache/SKILL.md +8 -8
  4. package/ai/skills/testdriver-caching/SKILL.md +10 -9
  5. package/ai/skills/testdriver-captcha/SKILL.md +7 -7
  6. package/ai/skills/testdriver-ci-cd/SKILL.md +10 -10
  7. package/ai/skills/testdriver-claude-mcp-plugin/SKILL.md +37 -0
  8. package/ai/skills/testdriver-client/SKILL.md +3 -166
  9. package/ai/skills/testdriver-customizing-devices/SKILL.md +1 -1
  10. package/ai/skills/testdriver-dashcam/SKILL.md +3 -3
  11. package/ai/skills/testdriver-debugging-with-screenshots/SKILL.md +5 -5
  12. package/ai/skills/testdriver-elements/SKILL.md +5 -5
  13. package/ai/skills/testdriver-errors/SKILL.md +3 -3
  14. package/ai/skills/testdriver-events/SKILL.md +3 -3
  15. package/ai/skills/testdriver-extract/SKILL.md +5 -5
  16. package/ai/skills/testdriver-find/SKILL.md +1 -1
  17. package/ai/skills/testdriver-generating-tests/SKILL.md +6 -6
  18. package/ai/skills/testdriver-hosted/SKILL.md +4 -4
  19. package/ai/skills/testdriver-interacting-with-your-app/SKILL.md +197 -0
  20. package/ai/skills/testdriver-locating-elements/SKILL.md +390 -39
  21. package/ai/skills/testdriver-making-assertions/SKILL.md +4 -4
  22. package/ai/skills/testdriver-options/SKILL.md +319 -0
  23. package/ai/skills/testdriver-parse/SKILL.md +8 -8
  24. package/ai/skills/testdriver-performing-actions/SKILL.md +7 -7
  25. package/ai/skills/testdriver-provision/SKILL.md +7 -7
  26. package/ai/skills/testdriver-quickstart/SKILL.md +15 -441
  27. package/ai/skills/testdriver-quickstart-cli/SKILL.md +436 -0
  28. package/ai/skills/testdriver-quickstart-github/SKILL.md +53 -0
  29. package/ai/skills/testdriver-quickstart-manual/SKILL.md +134 -0
  30. package/ai/skills/testdriver-redraw/SKILL.md +6 -6
  31. package/ai/skills/testdriver-reusable-code/SKILL.md +3 -3
  32. package/ai/skills/testdriver-screenshots/SKILL.md +3 -3
  33. package/ai/skills/testdriver-secrets/SKILL.md +4 -4
  34. package/ai/skills/testdriver-self-hosted/SKILL.md +6 -6
  35. package/ai/skills/testdriver-test-results-json/SKILL.md +4 -4
  36. package/ai/skills/testdriver-variables/SKILL.md +2 -2
  37. package/ai/skills/testdriver-wait/SKILL.md +2 -2
  38. package/package.json +1 -1
@@ -0,0 +1,319 @@
1
+ ---
2
+ name: testdriver:options
3
+ description: Every option you can pass to the TestDriver client, with defaults and examples
4
+ ---
5
+ <!-- Generated from options.mdx. DO NOT EDIT. -->
6
+
7
+ ## Overview
8
+
9
+ You configure the SDK with an options object. You can pass the object in three places:
10
+
11
+ ```javascript
12
+ // 1. Vitest hook (most common)
13
+ const testdriver = TestDriver(context, { os: "windows" });
14
+
15
+ // 2. Constructor
16
+ const testdriver = new TestDriver(apiKey, { os: "windows" });
17
+
18
+ // 3. Global plugin options in vitest.config.mjs
19
+ testdriver({ os: "windows" })
20
+ ```
21
+
22
+ The hook merges the options in this order. A later source replaces an earlier source:
23
+
24
+ 1. Default values
25
+ 2. Environment variables (`TD_OS`, `TD_API_ROOT`, `TD_E2B_TEMPLATE_ID`)
26
+ 3. Global plugin options
27
+ 4. Options that you pass to the hook or the constructor
28
+
29
+ Options that you pass to [`connect()`](/client#connect) replace the constructor values for that connection only.
30
+
31
+ ## Sandbox
32
+
33
+ These options control the virtual machine that runs your test.
34
+
35
+ <ParamField path="os" type="'linux' | 'windows'" default="linux">
36
+ The operating system of the sandbox. You can also set this with the `TD_OS` environment variable.
37
+ </ParamField>
38
+
39
+ <ParamField path="resolution" type="string" default="1366x768">
40
+ The screen resolution of the sandbox. Example: `'1920x1080'`. Custom resolutions are available only on Enterprise plans.
41
+ </ParamField>
42
+
43
+ <ParamField path="newSandbox" type="boolean" default="true">
44
+ Create a new sandbox for this run. Set to `false` to reuse a recent sandbox when one is available.
45
+ </ParamField>
46
+
47
+ <ParamField path="reconnect" type="boolean" default="false">
48
+ Reattach to the last used sandbox. The SDK reads the sandbox id from `.testdriver/last-sandbox`. The SDK writes this file on every successful connect.
49
+
50
+ When `reconnect` is `true`, the SDK skips provision methods (`chrome`, `vscode`, `installer`, and others). The application is already running. The previous sandbox must still be alive. See [`keepAlive`](#keepalive) and the [Run guide](/copilot/running-tests#keeping-machines-alive-between-runs).
51
+ </ParamField>
52
+
53
+ <ParamField path="sandboxId" type="string">
54
+ Reattach to a specific sandbox id. Use this for CI matrices or to pin a chain of tests to a known VM. This option implies `reconnect: true`. The SDK skips provision calls.
55
+ </ParamField>
56
+
57
+ <ParamField path="keepAlive" type="number" default="60000">
58
+ The number of milliseconds to keep the sandbox alive after `disconnect()`. Set to `0` to end the sandbox at once. A longer value lets you reconnect to the same sandbox for debugging.
59
+ </ParamField>
60
+
61
+ <ParamField path="debugOnFailure" type="boolean" default="false">
62
+ Keep the sandbox alive when a test fails. The SDK prints the sandbox id to the console. You can then reconnect with `sandboxId` and debug the failure. This option is available only in the Vitest hook.
63
+ </ParamField>
64
+
65
+ <ParamField path="environment" type="object">
66
+ Additional environment variables to pass to the sandbox.
67
+ </ParamField>
68
+
69
+ ### Example
70
+
71
+ ```javascript
72
+ const testdriver = TestDriver(context, {
73
+ os: "windows",
74
+ resolution: "1920x1080",
75
+ keepAlive: 300000,
76
+ debugOnFailure: true,
77
+ });
78
+ ```
79
+
80
+ ## Preview and recording
81
+
82
+ These options control what you see while the test runs.
83
+
84
+ <ParamField path="preview" type="'browser' | 'ide' | 'none'" default="browser">
85
+ The preview mode for live test visualization.
86
+
87
+ - `"browser"` opens the debugger in your default browser.
88
+ - `"ide"` opens the preview in the IDE panel. This mode needs the TestDriver extension for VS Code or Cursor.
89
+ - `"none"` runs without a visual preview. Use this in CI.
90
+ </ParamField>
91
+
92
+ <ParamField path="headless" type="boolean" default="false">
93
+ **Deprecated.** Use `preview: "none"` instead. `headless: true` maps to `preview: "none"`.
94
+ </ParamField>
95
+
96
+ <ParamField path="dashcam" type="boolean" default="true">
97
+ Record a Dashcam video of the test. See [Dashcam](/dashcam).
98
+ </ParamField>
99
+
100
+ <ParamField path="autoScreenshots" type="boolean" default="false">
101
+ Capture a screenshot before and after each command. The SDK saves the screenshots to `.testdriver/screenshots/<test>/`.
102
+
103
+ The file name format is `<seq>-<action>-<phase>-L<line>-<description>.png`. Example: `001-click-before-L42-submit-button.png`. See [Debugging with screenshots](/debugging-with-screenshots).
104
+ </ParamField>
105
+
106
+ <ParamField path="logging" type="boolean" default="true">
107
+ Write SDK logs to the console. You can change this at runtime with [`setLogging()`](/client#setlogging).
108
+ </ParamField>
109
+
110
+ <ParamField path="analytics" type="boolean" default="true">
111
+ Send usage analytics to TestDriver.
112
+ </ParamField>
113
+
114
+ ### Example
115
+
116
+ ```javascript
117
+ const testdriver = TestDriver(context, {
118
+ preview: process.env.CI ? "none" : "browser",
119
+ autoScreenshots: true,
120
+ });
121
+ ```
122
+
123
+ ## AI and element location
124
+
125
+ These options control how the AI locates elements and checks assertions.
126
+
127
+ <ParamField path="verify" type="boolean" default="false">
128
+ Run a second AI check on every `find()` result. The check confirms that the coordinates match the requested element. This catches incorrect positions. It adds latency to each call.
129
+
130
+ You can replace this value for one call with `find(description, { verify: true })`. See [find](/find).
131
+ </ParamField>
132
+
133
+ <ParamField path="ai" type="object">
134
+ Global AI sampling configuration. These values apply to `find()` verification and to `assert()`. You can replace them for one call with the `ai` option on that call.
135
+
136
+ <Expandable title="properties">
137
+ <ParamField path="temperature" type="number">
138
+ Controls randomness in AI responses. `0` is deterministic and is best for verification. Higher values give more varied responses. The default is `0` for find verification and the model default for assert.
139
+ </ParamField>
140
+
141
+ <ParamField path="top" type="object">
142
+ Nucleus and top-k sampling parameters.
143
+
144
+ <Expandable title="properties">
145
+ <ParamField path="p" type="number">
146
+ Top-P (nucleus sampling). Limits token choices to the smallest set whose total probability is more than P. Lower values give more focused responses. Range: 0 to 1.
147
+ </ParamField>
148
+
149
+ <ParamField path="k" type="number">
150
+ Top-K sampling. Limits token choices to the K most likely tokens. `1` always picks the most likely token. `0` disables the limit.
151
+ </ParamField>
152
+ </Expandable>
153
+ </ParamField>
154
+ </Expandable>
155
+ </ParamField>
156
+
157
+ ### Example
158
+
159
+ ```javascript
160
+ const testdriver = TestDriver(context, {
161
+ verify: true,
162
+ ai: { temperature: 0, top: { p: 0.9, k: 40 } },
163
+ });
164
+ ```
165
+
166
+ ## Caching
167
+
168
+ These options control the element cache. The cache stores the position of an element after the first `find()`. Later runs reuse the position when the screen has not changed. See [Caching](/caching).
169
+
170
+ <ParamField path="cache" type="boolean | object" default="true">
171
+ Enable or disable the cache. Pass an object to set the match thresholds.
172
+
173
+ <Expandable title="advanced config">
174
+ <ParamField path="enabled" type="boolean" default="true">
175
+ Enable or disable the cache.
176
+ </ParamField>
177
+
178
+ <ParamField path="thresholds" type="object">
179
+ Fine-tune the cache matching.
180
+
181
+ <Expandable title="properties">
182
+ <ParamField path="find" type="object">
183
+ Thresholds for `find()` operations.
184
+
185
+ <Expandable title="properties">
186
+ <ParamField path="screen" type="number" default="0.05">
187
+ The pixel diff threshold for the screen comparison (0 to 1). `0.05` allows a 5% difference.
188
+ </ParamField>
189
+
190
+ <ParamField path="element" type="number" default="0.8">
191
+ The OpenCV template match threshold for the element (0 to 1). `0.8` requires an 80% correlation.
192
+ </ParamField>
193
+ </Expandable>
194
+ </ParamField>
195
+
196
+ <ParamField path="assert" type="number" default="0.05">
197
+ The pixel diff threshold for `assert()` operations (0 to 1). `0.05` allows a 5% difference.
198
+ </ParamField>
199
+ </Expandable>
200
+ </ParamField>
201
+ </Expandable>
202
+ </ParamField>
203
+
204
+ <ParamField path="cacheKey" type="string">
205
+ The cache key for element location. When you set a key, the SDK ties the cache to that key. Use a different key for each test to keep the caches separate.
206
+ </ParamField>
207
+
208
+ <ParamField path="cacheThreshold" type="object">
209
+ **Deprecated.** Use `cache.thresholds` instead.
210
+ </ParamField>
211
+
212
+ ### Example
213
+
214
+ ```javascript
215
+ const testdriver = TestDriver(context, {
216
+ cache: {
217
+ enabled: true,
218
+ thresholds: {
219
+ find: { screen: 0.05, element: 0.8 },
220
+ assert: 0.05,
221
+ },
222
+ },
223
+ cacheKey: "login-test",
224
+ });
225
+ ```
226
+
227
+ ## Redraw detection
228
+
229
+ These options control how the SDK waits for the screen to settle after an action. See [Redraw](/redraw).
230
+
231
+ <ParamField path="redraw" type="boolean | object" default="true">
232
+ Enable or disable screen-change detection. Pass an object to set the thresholds.
233
+
234
+ <Expandable title="advanced config">
235
+ <ParamField path="enabled" type="boolean" default="true">
236
+ Enable or disable redraw detection.
237
+ </ParamField>
238
+
239
+ <ParamField path="thresholds" type="object">
240
+ Threshold configuration.
241
+
242
+ <Expandable title="properties">
243
+ <ParamField path="screen" type="number | false" default="0.05">
244
+ The pixel diff threshold (0 to 1). Set to `false` to disable screen redraw detection.
245
+ </ParamField>
246
+
247
+ <ParamField path="network" type="boolean" default="false">
248
+ Wait for network activity to stop.
249
+ </ParamField>
250
+ </Expandable>
251
+ </ParamField>
252
+ </Expandable>
253
+ </ParamField>
254
+
255
+ <ParamField path="redrawThreshold" type="number | object">
256
+ **Deprecated.** Use `redraw` instead.
257
+ </ParamField>
258
+
259
+ ### Example
260
+
261
+ ```javascript
262
+ const testdriver = TestDriver(context, {
263
+ redraw: {
264
+ thresholds: { screen: 0.1, network: true },
265
+ },
266
+ });
267
+ ```
268
+
269
+ ## Self-hosted and infrastructure
270
+
271
+ Most users do not need these options. Use them for self-hosted or custom deployments.
272
+
273
+ <ParamField path="apiRoot" type="string">
274
+ The API endpoint URL. The default depends on the release channel. You can also set this with the `TD_API_ROOT` environment variable.
275
+ </ParamField>
276
+
277
+ <ParamField path="ip" type="string">
278
+ The IP address of a running sandbox. The SDK connects to this address directly.
279
+ </ParamField>
280
+
281
+ <ParamField path="sandboxAmi" type="string">
282
+ A custom AMI id for the sandbox instance (AWS deployments). Example: `'ami-1234'`.
283
+ </ParamField>
284
+
285
+ <ParamField path="sandboxInstance" type="string">
286
+ The EC2 instance type for the sandbox (AWS deployments). Example: `'i3.metal'`.
287
+ </ParamField>
288
+
289
+ <ParamField path="e2bTemplateId" type="string">
290
+ The E2B template id to use when the SDK creates the sandbox. You can also set this with the `TD_E2B_TEMPLATE_ID` environment variable.
291
+ </ParamField>
292
+
293
+ ## Quick reference
294
+
295
+ | Option | Type | Default |
296
+ |---|---|---|
297
+ | `os` | `'linux' \| 'windows'` | `'linux'` |
298
+ | `resolution` | `string` | `'1366x768'` |
299
+ | `newSandbox` | `boolean` | `true` |
300
+ | `reconnect` | `boolean` | `false` |
301
+ | `sandboxId` | `string` | — |
302
+ | `keepAlive` | `number` | `60000` |
303
+ | `debugOnFailure` | `boolean` | `false` |
304
+ | `environment` | `object` | — |
305
+ | `preview` | `'browser' \| 'ide' \| 'none'` | `'browser'` |
306
+ | `dashcam` | `boolean` | `true` |
307
+ | `autoScreenshots` | `boolean` | `false` |
308
+ | `logging` | `boolean` | `true` |
309
+ | `analytics` | `boolean` | `true` |
310
+ | `verify` | `boolean` | `false` |
311
+ | `ai` | `object` | — |
312
+ | `cache` | `boolean \| object` | `true` |
313
+ | `cacheKey` | `string` | — |
314
+ | `redraw` | `boolean \| object` | `true` |
315
+ | `apiRoot` | `string` | channel default |
316
+ | `ip` | `string` | — |
317
+ | `sandboxAmi` | `string` | — |
318
+ | `sandboxInstance` | `string` | — |
319
+ | `e2bTemplateId` | `string` | — |
@@ -6,17 +6,17 @@ description: Detect all UI elements on screen using OmniParser
6
6
 
7
7
  ## Overview
8
8
 
9
- Parse the current screen using OmniParser v2 to detect all visible UI elements. Returns structured data including element types, text content, interactivity levels, and bounding box coordinates.
9
+ Parse the screen with OmniParser v2 to find all visible UI elements. TestDriver returns structured data. This includes element types, text content, interactivity levels, and bounding box coordinates.
10
10
 
11
- This method analyzes the entire screen and returns every detected element. It's useful for:
12
- - Understanding the full UI layout of a screen
13
- - Finding all clickable or interactive elements
14
- - Building custom element-based logic
15
- - Debugging what elements TestDriver can detect
16
- - Accessibility auditing
11
+ This method examines all of the screen and returns each element that it finds. Use it for these:
12
+ - To understand the full UI layout of a screen
13
+ - To find all clickable or interactive elements
14
+ - To build custom element logic
15
+ - To debug which elements TestDriver can find
16
+ - To do an accessibility audit
17
17
 
18
18
  <Note>
19
- **Availability**: `parse()` requires an enterprise or self-hosted plan. It uses OmniParser v2 server-side for element detection.
19
+ **Availability**: `parse()` needs an enterprise plan or a self-hosted plan. It uses OmniParser v2 on the server for element detection.
20
20
  </Note>
21
21
 
22
22
  ## Syntax
@@ -4,13 +4,13 @@ description: Perform actions and handle dynamic, async UI so tests adapt to chan
4
4
  ---
5
5
  <!-- Generated from performing-actions.mdx. DO NOT EDIT. -->
6
6
 
7
- Real apps move, load, and change. Adapt your tests to handle it.
7
+ Real apps move, load, and change. Adapt your tests to these conditions.
8
8
 
9
- Once you've [generated](/generating-tests) and [learned](/caching) your tests and gotten them [running](/copilot/running-tests), the next challenge is the real world: buttons appear after a spinner, pages navigate, animations play, and content streams in over the network. To keep tests reliable, you need to perform the right actions and handle timing so your tests adapt to how the UI actually behaves instead of breaking.
9
+ You [generated](/generating-tests) and [learned](/caching) your tests. Then you got them to [run](/copilot/running-tests). Now the challenge is the real world: buttons show after a spinner, pages navigate, animations play, and content comes in over the network. To keep the tests reliable, do the correct actions and control the timing. Then your tests adapt to the true behavior of the UI. They do not break.
10
10
 
11
11
  ## Performing Actions
12
12
 
13
- TestDriver provides a variety of actions you can perform, like [clicking](/click), [typing](/type), [hovering](/hover), and [scrolling](/scroll). For a full list, see the [API Reference](/click).
13
+ TestDriver gives you many actions. You can [click](/click), [type](/type), [hover](/hover), and [scroll](/scroll). For a full list, read the [API Reference](/click).
14
14
 
15
15
  ```javascript
16
16
  // Clicking
@@ -42,14 +42,14 @@ const orderNumber = await testdriver.extract('the order confirmation number');
42
42
 
43
43
  ### Chaining Actions
44
44
 
45
- TestDriver supports method chaining for cleaner code:
45
+ TestDriver lets you chain methods for cleaner code:
46
46
 
47
47
  ```javascript
48
48
  // Chain find() with actions
49
49
  const button = await testdriver.find('submit button').click();
50
50
  ```
51
51
 
52
- Or save element reference for later use:
52
+ Or keep the element reference for later use:
53
53
 
54
54
  ```javascript
55
55
  const button = await testdriver.find('submit button');
@@ -58,9 +58,9 @@ await button.click();
58
58
 
59
59
  ## Waiting for Dynamic Content
60
60
 
61
- By default, `find()` automatically polls for up to 10 seconds, retrying every 5 seconds until the element is found. This means most elements that appear after short async operations will be found without any extra configuration.
61
+ By default, `find()` polls automatically for a maximum of 10 seconds. It tries again each 5 seconds until it finds the element. Thus TestDriver finds most elements that show after short async operations. You do not need more configuration.
62
62
 
63
- For longer operations, increase the `timeout`:
63
+ For longer operations, make the `timeout` larger:
64
64
 
65
65
  ```javascript
66
66
  // Default behavior - polls for up to 10 seconds automatically
@@ -6,9 +6,9 @@ description: Launch browsers, desktop apps, and extensions in your sandbox
6
6
 
7
7
  ## Overview
8
8
 
9
- The Provision API sets up applications in your sandbox before tests run. It handles downloading, installing, and launching browsers, desktop apps, VS Code, Chrome extensions, and more.
9
+ The Provision API sets up applications in your sandbox before the tests run. It downloads, installs, and starts browsers, desktop apps, VS Code, Chrome extensions, and more.
10
10
 
11
- Access provision methods via `testdriver.provision.*`:
11
+ Use the provision methods through `testdriver.provision.*`:
12
12
 
13
13
  ```javascript
14
14
  await testdriver.provision.chrome({ url: 'https://example.com' });
@@ -18,7 +18,7 @@ await testdriver.provision.chrome({ url: 'https://example.com' });
18
18
 
19
19
  ### chrome()
20
20
 
21
- Launch Google Chrome with an optional URL.
21
+ Start Google Chrome with an optional URL.
22
22
 
23
23
  ```javascript
24
24
  await testdriver.provision.chrome(options?)
@@ -27,15 +27,15 @@ await testdriver.provision.chrome(options?)
27
27
  <ParamField path="options" type="ProvisionChromeOptions">
28
28
  <Expandable title="properties">
29
29
  <ParamField path="url" type="string" default="http://testdriver-sandbox.vercel.app/">
30
- URL to navigate to after launch.
30
+ The URL to go to after Chrome starts.
31
31
  </ParamField>
32
32
 
33
33
  <ParamField path="maximized" type="boolean" default={true}>
34
- Launch Chrome in maximized window mode.
34
+ Start Chrome with the window at the maximum size.
35
35
  </ParamField>
36
36
 
37
37
  <ParamField path="guest" type="boolean" default={false}>
38
- Launch Chrome in guest profile mode.
38
+ Start Chrome in the guest profile mode.
39
39
  </ParamField>
40
40
  </Expandable>
41
41
  </ParamField>
@@ -54,7 +54,7 @@ await testdriver.provision.chrome({
54
54
 
55
55
  ### chromeExtension()
56
56
 
57
- Install and launch a Chrome extension. You can install from a local unpacked directory or from the Chrome Web Store by extension ID.
57
+ Install and start a Chrome extension. You can install it from a local unpacked directory. Or you can install it from the Chrome Web Store by the extension ID.
58
58
 
59
59
  ```javascript
60
60
  await testdriver.provision.chromeExtension(options)