@testdriverai/agent 7.11.240-test → 7.11.241-test

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 (52) hide show
  1. package/ai/skills/testdriver-agent/SKILL.md +174 -91
  2. package/ai/skills/testdriver-assert/SKILL.md +73 -269
  3. package/ai/skills/testdriver-aws-setup/SKILL.md +194 -312
  4. package/ai/skills/testdriver-bring-your-own-machine/SKILL.md +137 -204
  5. package/ai/skills/testdriver-cache/SKILL.md +142 -149
  6. package/ai/skills/testdriver-caching/SKILL.md +97 -87
  7. package/ai/skills/testdriver-captcha/SKILL.md +126 -111
  8. package/ai/skills/testdriver-ci-cd/SKILL.md +153 -542
  9. package/ai/skills/testdriver-click/SKILL.md +74 -229
  10. package/ai/skills/testdriver-client/SKILL.md +175 -229
  11. package/ai/skills/testdriver-customizing-devices/SKILL.md +72 -250
  12. package/ai/skills/testdriver-dashcam/SKILL.md +71 -404
  13. package/ai/skills/testdriver-debugging-with-screenshots/SKILL.md +103 -369
  14. package/ai/skills/testdriver-double-click/SKILL.md +46 -67
  15. package/ai/skills/testdriver-errors/SKILL.md +102 -176
  16. package/ai/skills/testdriver-events/SKILL.md +170 -327
  17. package/ai/skills/testdriver-exec/SKILL.md +92 -256
  18. package/ai/skills/testdriver-extract/SKILL.md +69 -170
  19. package/ai/skills/testdriver-find/SKILL.md +140 -736
  20. package/ai/skills/testdriver-focus-application/SKILL.md +69 -246
  21. package/ai/skills/testdriver-generating-tests/SKILL.md +102 -136
  22. package/ai/skills/testdriver-hosted/SKILL.md +79 -143
  23. package/ai/skills/testdriver-hover/SKILL.md +62 -235
  24. package/ai/skills/testdriver-locating-elements/SKILL.md +71 -366
  25. package/ai/skills/testdriver-making-assertions/SKILL.md +114 -72
  26. package/ai/skills/testdriver-mcp-setup/SKILL.md +79 -62
  27. package/ai/skills/testdriver-mouse-down/SKILL.md +46 -124
  28. package/ai/skills/testdriver-mouse-up/SKILL.md +45 -128
  29. package/ai/skills/testdriver-options/SKILL.md +73 -46
  30. package/ai/skills/testdriver-parse/SKILL.md +95 -184
  31. package/ai/skills/testdriver-performing-actions/SKILL.md +101 -91
  32. package/ai/skills/testdriver-press-keys/SKILL.md +59 -299
  33. package/ai/skills/testdriver-provision/SKILL.md +135 -179
  34. package/ai/skills/testdriver-quickstart/SKILL.md +24 -8
  35. package/ai/skills/testdriver-quickstart-claude/SKILL.md +84 -0
  36. package/ai/skills/testdriver-quickstart-github/SKILL.md +62 -32
  37. package/ai/skills/testdriver-quickstart-manual/SKILL.md +59 -32
  38. package/ai/skills/testdriver-quickstart-vscode/SKILL.md +96 -0
  39. package/ai/skills/testdriver-redraw/SKILL.md +100 -164
  40. package/ai/skills/testdriver-reusable-code/SKILL.md +95 -199
  41. package/ai/skills/testdriver-right-click/SKILL.md +45 -88
  42. package/ai/skills/testdriver-screenshot/SKILL.md +47 -201
  43. package/ai/skills/testdriver-screenshots/SKILL.md +86 -136
  44. package/ai/skills/testdriver-scroll/SKILL.md +71 -154
  45. package/ai/skills/testdriver-secrets/SKILL.md +94 -90
  46. package/ai/skills/testdriver-self-hosted/SKILL.md +82 -140
  47. package/ai/skills/testdriver-test-results-json/SKILL.md +165 -202
  48. package/ai/skills/testdriver-type/SKILL.md +56 -304
  49. package/ai/skills/testdriver-variables/SKILL.md +119 -80
  50. package/ai/skills/testdriver-wait/SKILL.md +31 -29
  51. package/ai/skills/testdriver-what-is-testdriver/SKILL.md +80 -32
  52. package/package.json +1 -1
@@ -1,321 +1,143 @@
1
1
  ---
2
2
  name: testdriver:customizing-devices
3
- description: Configure TestDriver sandbox options and environment settings
3
+ description: Choose the sandbox OS and resolution, preview mode, recording, and how long it stays alive.
4
4
  ---
5
5
  <!-- Generated from customizing-devices.mdx. DO NOT EDIT. -->
6
6
 
7
- ## TestDriver Options
7
+ import { EnterpriseBadge, EnterpriseCta } from '/snippets/enterprise.mdx';
8
8
 
9
- Configure the TestDriver behavior with options that you give to the `TestDriver()` function:
9
+ Every test runs in a sandbox: a fresh virtual machine. Pass options to `TestDriver(context, options)` to change it.
10
10
 
11
11
  ```javascript
12
12
  const testdriver = TestDriver(context, {
13
- // === Sandbox & Connection ===
14
- newSandbox: true, // Force creation of a new sandbox (default: true)
15
- reconnect: false, // Reconnect to last sandbox (default: false)
16
- keepAlive: 60000, // Keep sandbox alive after disconnect in ms (default: 60000)
17
- os: "linux", // 'linux' | 'windows' (default: 'linux')
18
- resolution: "1366x768", // Sandbox resolution (e.g., '1920x1080')
19
- ip: "203.0.113.42", // Direct IP for self-hosted sandbox
20
- sandboxAmi: "ami-1234", // Custom AMI ID (AWS deployments)
21
- sandboxInstance: "i3.metal", // EC2 instance type (AWS deployments)
22
-
23
- // === Preview & Debugging ===
24
- preview: "browser", // "browser" | "ide" | "none" (default: "browser")
25
- headless: false, // @deprecated - use preview: "none" instead
26
- debugOnFailure: false, // Keep sandbox alive on test failure for debugging
27
-
28
- // === Caching ===
29
- cache: true, // Enable element caching (default: true)
30
- // Or use advanced caching config:
31
- // cache: {
32
- // enabled: true,
33
- // thresholds: {
34
- // find: { screen: 0.05, element: 0.8 },
35
- // assert: 0.05
36
- // }
37
- // },
38
- cacheKey: "my-test", // Cache key for element finding operations
39
-
40
- // === Recording & Screenshots ===
41
- dashcam: true, // Enable/disable Dashcam video recording (default: true)
42
- autoScreenshots: true, // Capture screenshots before/after each command (default: false)
43
-
44
- // === AI Configuration ===
45
- ai: { // Global AI sampling configuration
46
- temperature: 0, // 0 = deterministic, higher = more creative
47
- top: {
48
- p: 0.9, // Top-P nucleus sampling (0-1)
49
- k: 40, // Top-K sampling (1 = most likely, 0 = disabled)
50
- },
51
- },
52
-
53
- // === Screen Change Detection ===
54
- redraw: true, // Enable redraw detection (default: true)
55
- // Or use advanced redraw config:
56
- // redraw: {
57
- // enabled: true,
58
- // thresholds: {
59
- // screen: 0.05, // Pixel diff threshold (0-1), false to disable
60
- // network: false, // Monitor network activity (default: false)
61
- // }
62
- // },
63
-
64
- // === Logging & Analytics ===
65
- logging: true, // Enable console logging output (default: true)
66
- analytics: true, // Enable analytics tracking (default: true)
67
-
68
- // === Advanced ===
69
- apiRoot: "https://...", // API endpoint URL (for self-hosted deployments)
70
- environment: {}, // Additional environment variables for the sandbox
13
+ os: 'windows',
14
+ preview: 'none',
15
+ keepAlive: 300000,
71
16
  });
72
17
  ```
73
18
 
74
- ### Preview Mode
19
+ This page covers the common changes. For every option and its default, see [Options](/options).
75
20
 
76
- Control how test execution is visualized. The `preview` option determines where the live debugger view opens:
21
+ ## Choose the operating system
77
22
 
78
- ```javascript
79
- const testdriver = TestDriver(context, {
80
- preview: "browser", // Opens in default browser (default)
81
- });
82
- ```
83
-
84
- | Value | Description |
85
- |-------|-------------|
86
- | `"browser"` | Opens debugger in default browser (default) |
87
- | `"ide"` | Opens preview in IDE panel (VSCode, Cursor - requires TestDriver extension) |
88
- | `"none"` | Headless mode, no visual preview |
89
-
90
- **IDE Preview**
91
-
92
- For the best development experience, use `preview: "ide"` with the TestDriver extension for VSCode or Cursor:
23
+ Sandboxes run Linux by default. Set `os` to run on Windows:
93
24
 
94
25
  ```javascript
95
- const testdriver = TestDriver(context, {
96
- preview: "ide", // Opens preview in IDE panel
97
- });
26
+ const testdriver = TestDriver(context, { os: 'windows' });
98
27
  ```
99
28
 
100
- **Headless Mode**
101
-
102
- Run tests without any visual preview. Useful for CI/CD pipelines:
103
-
104
- ```javascript
105
- const testdriver = TestDriver(context, {
106
- preview: "none", // No visual preview (headless)
107
- });
108
- ```
109
-
110
- <Note>
111
- The legacy `headless: true` option still works for backward compatibility and maps to `preview: "none"`.
112
- </Note>
113
-
114
- ### Debug on Failure
115
-
116
- Keep the sandbox alive when a test fails so you can reconnect and debug interactively. The sandbox ID is printed to the console along with instructions for reconnecting via MCP.
117
-
118
- ```javascript
119
- const testdriver = TestDriver(context, {
120
- debugOnFailure: true,
121
- });
122
- ```
29
+ <EnterpriseCta feature="Windows sandboxes" plural />
123
30
 
124
- ### IP Target
125
-
126
- If self-hosting TestDriver, use `ip` to specify the device IP. See [Run on Your Own Machine](/bring-your-own-machine) for details.
127
-
128
- ```javascript
129
- const testdriver = TestDriver(context, {
130
- ip: "203.0.113.42", // Your allowlisted IP
131
- });
132
- ```
133
-
134
- ### Operating System
135
-
136
- Set the `os` property to run tests on a specific operating system. Available options are `linux` (default) and `windows`.
137
-
138
- ```javascript
139
- const testdriver = TestDriver(context, {
140
- os: "windows", // Run on Windows sandbox
141
- });
142
- ```
143
-
144
- #### Using Environment Variables
145
-
146
- You can make the operating system configurable via environment variables. This requires adding code to read from `process.env` in your test:
147
-
148
- ```javascript
149
- const testdriver = TestDriver(context, {
150
- os: process.env.TD_OS || "linux", // Read from env, default to Linux
151
- });
152
- ```
153
-
154
- Then pass the variable when running tests:
31
+ The `TestDriver()` hook also reads the `TD_OS` environment variable when you don't pass `os`. That lets you run one suite on both systems without changing code:
155
32
 
156
33
  ```bash
157
- # Run tests on Windows
158
- TD_OS=windows vitest run
159
-
160
- # Run tests on Linux (default)
161
- TD_OS=linux vitest run
34
+ TD_OS=windows npx vitest run
162
35
  ```
163
36
 
164
- This pattern is useful for running the same test suite across multiple operating systems in CI/CD:
37
+ In GitHub Actions, run the suite once per OS with a matrix:
165
38
 
166
- ```yaml
167
- # Example GitHub Actions matrix
39
+ ```yaml .github/workflows/testdriver.yml
168
40
  strategy:
169
41
  matrix:
170
- os: [linux, windows]
42
+ td-os: [linux, windows]
171
43
  steps:
172
- - run: TD_OS=${{ matrix.os }} vitest run
44
+ # ...checkout, install, and authenticate steps
45
+ - name: Run tests on ${{ matrix.td-os }}
46
+ run: npx vitest run
47
+ env:
48
+ TD_OS: ${{ matrix.td-os }}
173
49
  ```
174
50
 
175
- ### Dashcam Recording
51
+ See [Run in CI/CD](/ci-cd) for the full workflow.
176
52
 
177
- Dashcam video recording is enabled by default. Disable it to skip recording:
53
+ ## Set the screen resolution
178
54
 
179
- ```javascript
180
- const testdriver = TestDriver(context, {
181
- dashcam: false,
182
- });
183
- ```
184
-
185
- ### Automatic Screenshots
186
-
187
- Screenshots are automatically captured before and after every command (click, type, find, assert, etc.) by default. Each screenshot filename includes the line number from your test file.
188
-
189
- Disable automatic screenshots:
55
+ The default resolution is `1366x768`. Set `resolution` to change it:
190
56
 
191
57
  ```javascript
192
- const testdriver = TestDriver(context, {
193
- autoScreenshots: false,
194
- });
58
+ const testdriver = TestDriver(context, { resolution: '1920x1080' });
195
59
  ```
196
60
 
197
- ### Caching
61
+ <EnterpriseCta feature="Custom screen resolution" />
198
62
 
199
- Element caching speeds up repeated `find()` and `assert()` calls. Enabled by default.
63
+ ## Choose how to watch the run
200
64
 
201
- ```javascript
202
- // Disable caching
203
- const testdriver = TestDriver(context, {
204
- cache: false,
205
- });
206
-
207
- // Advanced: custom thresholds
208
- const testdriver = TestDriver(context, {
209
- cache: {
210
- enabled: true,
211
- thresholds: {
212
- find: { screen: 0.05, element: 0.8 },
213
- assert: 0.05,
214
- },
215
- },
216
- cacheKey: "my-test",
217
- });
218
- ```
219
-
220
- ### Redraw Detection
65
+ `preview` sets where the live view of the sandbox opens:
221
66
 
222
- Redraw detection waits for the screen to stabilize before taking actions. Enabled by default.
67
+ - `"browser"` opens it in your default browser. This is the default.
68
+ - `"ide"` opens it in an editor panel. This needs the [TestDriver extension](/quickstart-vscode) for VS Code or Cursor.
69
+ - `"none"` turns the live view off. Use this in CI.
223
70
 
224
71
  ```javascript
225
- // Disable redraw detection
226
72
  const testdriver = TestDriver(context, {
227
- redraw: false,
228
- });
229
-
230
- // Advanced: custom thresholds with network monitoring
231
- const testdriver = TestDriver(context, {
232
- redraw: {
233
- enabled: true,
234
- thresholds: {
235
- screen: 0.05,
236
- network: true,
237
- },
238
- },
73
+ preview: process.env.CI ? 'none' : 'browser',
239
74
  });
240
75
  ```
241
76
 
242
- ### AI Configuration
77
+ `headless: true` is deprecated. Use `preview: "none"` instead.
243
78
 
244
- Control how the AI model generates responses for `find()` verification and `assert()` calls:
79
+ ## Record the run
245
80
 
246
- ```javascript
247
- const testdriver = TestDriver(context, {
248
- ai: {
249
- temperature: 0, // 0 = deterministic
250
- top: { p: 0.9, k: 40 },
251
- },
252
- });
253
- ```
254
-
255
- ### Environment Variables
256
-
257
- Pass additional environment variables to the sandbox:
81
+ - **Video.** [Dashcam](/dashcam) records every test by default. Set `dashcam: false` to turn it off.
82
+ - **Screenshots.** Set `autoScreenshots: true` to save a screenshot before and after each command. They're off by default. See [Debug a failing test](/debugging-with-screenshots).
258
83
 
259
84
  ```javascript
260
85
  const testdriver = TestDriver(context, {
261
- environment: {
262
- MY_VAR: "value",
263
- DEBUG: "true",
264
- },
86
+ dashcam: false,
87
+ autoScreenshots: true,
265
88
  });
266
89
  ```
267
90
 
268
- ## Keepalive
91
+ ## Keep a sandbox alive
269
92
 
270
- By default, sandboxes stay alive for 60 seconds after disconnect. Customize this with `keepAlive`:
93
+ After a test ends, its sandbox keeps running for `keepAlive` milliseconds, so you can reconnect to it:
271
94
 
272
- ```javascript
273
- const testdriver = TestDriver(context, {
274
- keepAlive: 300000, // Keep sandbox alive for 5 minutes after test
275
- });
276
- ```
277
-
278
- Set to `0` to terminate immediately:
95
+ - The default is `60000` (60 seconds).
96
+ - Values above 30 minutes are capped at 30 minutes.
97
+ - `0` uses the default. There's no value that ends the sandbox immediately.
98
+ - A sandbox never runs longer than 2 hours in total.
279
99
 
280
100
  ```javascript
281
101
  const testdriver = TestDriver(context, {
282
- keepAlive: 0, // Terminate sandbox immediately on disconnect
102
+ keepAlive: 10 * 60 * 1000, // 10 minutes
283
103
  });
284
104
  ```
285
105
 
286
- ### Connecting to an Existing Sandbox
287
-
288
- Speed up test development by connecting to an existing sandbox instead of starting fresh each time. This lets you iterate quickly on failing steps without re-running the entire test from the beginning.
106
+ To reconnect from another test file, set `reconnect: true`. TestDriver reattaches to the last sandbox it used and skips `provision` calls, because the app is already open. See [Reuse a sandbox while you iterate](/copilot/running-tests#reuse-a-sandbox-while-you-iterate).
289
107
 
290
- Split your test into two files: one for known-good steps that set up the desired state, and another for work-in-progress steps you want to debug.
108
+ To attach to a specific sandbox, pass its id as `sandboxId`. Unlike `reconnect`, `sandboxId` alone still runs `provision` calls.
291
109
 
292
- ```javascript known-good.test.mjs
293
- const testdriver = TestDriver(context, {
294
- keepAlive: 60000, // Keep sandbox alive for 60 seconds after test
295
- });
296
- ```
110
+ ### Keep the sandbox when a test fails
297
111
 
298
- ```javascript work-in-progress.test.mjs
299
- // Second test file: experiment.test.mjs (run within keepAlive window)
300
- const testdriver = TestDriver(context, {
301
- keepAlive: 60000,
302
- });
112
+ Set `debugOnFailure: true` to keep the sandbox running when a test fails. TestDriver prints the sandbox id so you can connect to it and look around.
303
113
 
304
- await testdriver.connect({ sandboxId: "sandbox-abc123" });
114
+ ```javascript
115
+ const testdriver = TestDriver(context, { debugOnFailure: true });
305
116
  ```
306
117
 
307
- Then, you can run both tests in sequence:
118
+ ## Run on your own machine
308
119
 
309
- ```bash
310
- vitest run -t known-good.test.mjs -t work-in-progress.test.mjs
311
- ```
120
+ To run tests on a machine you manage, set `ip` to its address. See [Run on your own machine](/bring-your-own-machine).
312
121
 
313
- And as you make changes to `work-in-progress.test.mjs`, you can re-run just that file to quickly iterate on the failing steps.
122
+ <EnterpriseCta feature="Connecting to your own machines" />
314
123
 
315
- ```bash
316
- vitest run work-in-progress.test.mjs
124
+ ```javascript
125
+ const testdriver = TestDriver(context, { ip: '203.0.113.42' });
317
126
  ```
318
127
 
319
- <Warning>
320
- Connecting to the same machine only works if run within the `keepAlive` window of the previous test.
321
- </Warning>
128
+ ## Next steps
129
+
130
+ <CardGroup cols={2}>
131
+ <Card title="Options" icon="sliders" href="/options">
132
+ Every client option, with its default.
133
+ </Card>
134
+ <Card title="Client & connection" icon="plug" href="/client">
135
+ Create, connect, and disconnect a client.
136
+ </Card>
137
+ <Card title="Run tests" icon="play" href="/copilot/running-tests">
138
+ Run tests locally and reuse a sandbox.
139
+ </Card>
140
+ <Card title="Run in CI/CD" icon="code-branch" href="/ci-cd">
141
+ Run tests on every pull request.
142
+ </Card>
143
+ </CardGroup>