@testdriverai/agent 7.9.33-test → 7.9.34-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 (76) hide show
  1. package/ai/skills/testdriver:ai/SKILL.md +204 -0
  2. package/ai/skills/testdriver:assert/SKILL.md +315 -0
  3. package/ai/skills/testdriver:aws-setup/SKILL.md +448 -0
  4. package/ai/skills/testdriver:cache/SKILL.md +221 -0
  5. package/ai/skills/testdriver:caching/SKILL.md +124 -0
  6. package/ai/skills/testdriver:captcha/SKILL.md +158 -0
  7. package/ai/skills/testdriver:ci-cd/SKILL.md +602 -0
  8. package/ai/skills/testdriver:click/SKILL.md +286 -0
  9. package/ai/skills/testdriver:client/SKILL.md +477 -0
  10. package/ai/skills/testdriver:customizing-devices/SKILL.md +319 -0
  11. package/ai/skills/testdriver:dashcam/SKILL.md +451 -0
  12. package/ai/skills/testdriver:debugging-with-screenshots/SKILL.md +415 -0
  13. package/ai/skills/testdriver:device-config/SKILL.md +317 -0
  14. package/ai/skills/testdriver:double-click/SKILL.md +102 -0
  15. package/ai/skills/testdriver:elements/SKILL.md +605 -0
  16. package/ai/skills/testdriver:enterprise/SKILL.md +7 -0
  17. package/ai/skills/testdriver:errors/SKILL.md +246 -0
  18. package/ai/skills/testdriver:events/SKILL.md +356 -0
  19. package/ai/skills/testdriver:exec/SKILL.md +317 -0
  20. package/ai/skills/testdriver:find/SKILL.md +860 -0
  21. package/ai/skills/testdriver:focus-application/SKILL.md +293 -0
  22. package/ai/skills/testdriver:generating-tests/SKILL.md +36 -0
  23. package/ai/skills/testdriver:hosted/SKILL.md +156 -0
  24. package/ai/skills/testdriver:hover/SKILL.md +278 -0
  25. package/ai/skills/testdriver:locating-elements/SKILL.md +71 -0
  26. package/ai/skills/testdriver:making-assertions/SKILL.md +32 -0
  27. package/ai/skills/testdriver:mcp/SKILL.md +7 -0
  28. package/ai/skills/testdriver:mouse-down/SKILL.md +161 -0
  29. package/ai/skills/testdriver:mouse-up/SKILL.md +164 -0
  30. package/ai/skills/testdriver:parse/SKILL.md +236 -0
  31. package/ai/skills/testdriver:performing-actions/SKILL.md +53 -0
  32. package/ai/skills/testdriver:press-keys/SKILL.md +348 -0
  33. package/ai/skills/testdriver:provision/SKILL.md +331 -0
  34. package/ai/skills/testdriver:quickstart/SKILL.md +172 -0
  35. package/ai/skills/testdriver:redraw/SKILL.md +214 -0
  36. package/ai/skills/testdriver:reusable-code/SKILL.md +249 -0
  37. package/ai/skills/testdriver:right-click/SKILL.md +123 -0
  38. package/ai/skills/testdriver:running-tests/SKILL.md +185 -0
  39. package/ai/skills/testdriver:screenshot/SKILL.md +248 -0
  40. package/ai/skills/testdriver:screenshots/SKILL.md +184 -0
  41. package/ai/skills/testdriver:scroll/SKILL.md +205 -0
  42. package/ai/skills/testdriver:secrets/SKILL.md +115 -0
  43. package/ai/skills/testdriver:self-hosted/SKILL.md +147 -0
  44. package/ai/skills/testdriver:test-results-json/SKILL.md +257 -0
  45. package/ai/skills/testdriver:testdriver/SKILL.md +624 -0
  46. package/ai/skills/testdriver:type/SKILL.md +357 -0
  47. package/ai/skills/testdriver:variables/SKILL.md +111 -0
  48. package/ai/skills/testdriver:wait/SKILL.md +50 -0
  49. package/ai/skills/testdriver:waiting-for-elements/SKILL.md +90 -0
  50. package/ai/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
  51. package/docs/_data/examples-manifest.json +42 -42
  52. package/docs/v7/debugging-with-screenshots.mdx +14 -0
  53. package/docs/v7/examples/ai.mdx +1 -1
  54. package/docs/v7/examples/assert.mdx +1 -1
  55. package/docs/v7/examples/chrome-extension.mdx +2 -2
  56. package/docs/v7/examples/element-not-found.mdx +1 -1
  57. package/docs/v7/examples/exec-output.mdx +1 -1
  58. package/docs/v7/examples/exec-pwsh.mdx +1 -1
  59. package/docs/v7/examples/findall-coffee-icons.mdx +1 -1
  60. package/docs/v7/examples/focus-window.mdx +1 -1
  61. package/docs/v7/examples/hover-image.mdx +1 -1
  62. package/docs/v7/examples/hover-text-with-description.mdx +1 -1
  63. package/docs/v7/examples/hover-text.mdx +1 -1
  64. package/docs/v7/examples/installer.mdx +1 -1
  65. package/docs/v7/examples/launch-vscode-linux.mdx +1 -1
  66. package/docs/v7/examples/parse.mdx +1 -1
  67. package/docs/v7/examples/press-keys.mdx +1 -1
  68. package/docs/v7/examples/prompt.mdx +1 -1
  69. package/docs/v7/examples/scroll-keyboard.mdx +1 -1
  70. package/docs/v7/examples/scroll-until-image.mdx +1 -1
  71. package/docs/v7/examples/scroll.mdx +1 -1
  72. package/docs/v7/examples/type.mdx +1 -1
  73. package/docs/v7/examples/windows-installer.mdx +1 -1
  74. package/docs/v7/find.mdx +33 -0
  75. package/package.json +1 -1
  76. package/setup/aws/spawn-runner.sh +24 -3
@@ -0,0 +1,331 @@
1
+ ---
2
+ name: testdriver:provision
3
+ description: Launch browsers, desktop apps, and extensions in your sandbox
4
+ ---
5
+ <!-- Generated from provision.mdx. DO NOT EDIT. -->
6
+
7
+ ## Overview
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.
10
+
11
+ Access provision methods via `testdriver.provision.*`:
12
+
13
+ ```javascript
14
+ await testdriver.provision.chrome({ url: 'https://example.com' });
15
+ ```
16
+
17
+ <Note>
18
+ When `reconnect: true` is set on the client, **all provision methods are skipped** since the application is assumed to already be running.
19
+ </Note>
20
+
21
+ ## Methods
22
+
23
+ ### chrome()
24
+
25
+ Launch Google Chrome with an optional URL.
26
+
27
+ ```javascript
28
+ await testdriver.provision.chrome(options?)
29
+ ```
30
+
31
+ <ParamField path="options" type="ProvisionChromeOptions">
32
+ <Expandable title="properties">
33
+ <ParamField path="url" type="string" default="http://testdriver-sandbox.vercel.app/">
34
+ URL to navigate to after launch.
35
+ </ParamField>
36
+
37
+ <ParamField path="maximized" type="boolean" default={true}>
38
+ Launch Chrome in maximized window mode.
39
+ </ParamField>
40
+
41
+ <ParamField path="guest" type="boolean" default={false}>
42
+ Launch Chrome in guest profile mode.
43
+ </ParamField>
44
+ </Expandable>
45
+ </ParamField>
46
+
47
+ ```javascript
48
+ // Basic
49
+ await testdriver.provision.chrome({ url: 'https://example.com' });
50
+
51
+ // With guest mode
52
+ await testdriver.provision.chrome({
53
+ url: 'https://example.com',
54
+ guest: true,
55
+ maximized: true,
56
+ });
57
+ ```
58
+
59
+ ### chromeExtension()
60
+
61
+ Install and launch a Chrome extension. You can install from a local unpacked directory or from the Chrome Web Store by extension ID.
62
+
63
+ ```javascript
64
+ await testdriver.provision.chromeExtension(options)
65
+ ```
66
+
67
+ <ParamField path="options" type="ProvisionChromeExtensionOptions" required>
68
+ One of `extensionPath` or `extensionId` is required.
69
+
70
+ <Expandable title="properties">
71
+ <ParamField path="extensionPath" type="string">
72
+ Local path to an unpacked extension directory. The extension files are uploaded to the sandbox.
73
+ </ParamField>
74
+
75
+ <ParamField path="extensionId" type="string">
76
+ Chrome Web Store extension ID to install.
77
+ </ParamField>
78
+
79
+ <ParamField path="maximized" type="boolean" default={true}>
80
+ Launch Chrome in maximized window mode.
81
+ </ParamField>
82
+ </Expandable>
83
+ </ParamField>
84
+
85
+ ```javascript
86
+ // From local directory
87
+ await testdriver.provision.chromeExtension({
88
+ extensionPath: './my-extension',
89
+ });
90
+
91
+ // From Chrome Web Store
92
+ await testdriver.provision.chromeExtension({
93
+ extensionId: 'abcdefghijklmnop',
94
+ });
95
+ ```
96
+
97
+ ### vscode()
98
+
99
+ Launch Visual Studio Code with an optional workspace and extensions.
100
+
101
+ ```javascript
102
+ await testdriver.provision.vscode(options?)
103
+ ```
104
+
105
+ <ParamField path="options" type="ProvisionVSCodeOptions">
106
+ <Expandable title="properties">
107
+ <ParamField path="workspace" type="string">
108
+ Path to a workspace folder or `.code-workspace` file to open.
109
+ </ParamField>
110
+
111
+ <ParamField path="extensions" type="string[]" default={[]}>
112
+ Array of VS Code extension IDs to install before launching.
113
+ </ParamField>
114
+ </Expandable>
115
+ </ParamField>
116
+
117
+ ```javascript
118
+ await testdriver.provision.vscode({
119
+ workspace: '/home/testdriver/project',
120
+ extensions: ['ms-python.python', 'esbenp.prettier-vscode'],
121
+ });
122
+ ```
123
+
124
+ ### installer()
125
+
126
+ Download and run an application installer. Supports `.msi`, `.exe`, `.deb`, `.rpm`, `.appimage`, `.sh`, `.dmg`, and `.pkg` formats.
127
+
128
+ ```javascript
129
+ await testdriver.provision.installer(options)
130
+ ```
131
+
132
+ <ParamField path="options" type="ProvisionInstallerOptions" required>
133
+ <Expandable title="properties">
134
+ <ParamField path="url" type="string" required>
135
+ Download URL for the installer.
136
+ </ParamField>
137
+
138
+ <ParamField path="filename" type="string">
139
+ Override the auto-detected filename from the URL.
140
+ </ParamField>
141
+
142
+ <ParamField path="appName" type="string">
143
+ Application name to focus after installation completes.
144
+ </ParamField>
145
+
146
+ <ParamField path="launch" type="boolean" default={true}>
147
+ Whether to focus/launch the app after installation.
148
+ </ParamField>
149
+ </Expandable>
150
+ </ParamField>
151
+
152
+ **Behavior:**
153
+ - Downloads the installer from the URL
154
+ - Auto-detects the install method based on file extension
155
+ - Runs the appropriate install command (e.g., `msiexec` for `.msi`, `dpkg` for `.deb`)
156
+ - Optionally focuses the installed application
157
+
158
+ ```javascript
159
+ // Windows MSI installer
160
+ await testdriver.provision.installer({
161
+ url: 'https://example.com/app-setup.msi',
162
+ appName: 'MyApp',
163
+ });
164
+
165
+ // Linux DEB package
166
+ await testdriver.provision.installer({
167
+ url: 'https://example.com/app.deb',
168
+ appName: 'MyApp',
169
+ launch: true,
170
+ });
171
+ ```
172
+
173
+ ### electron()
174
+
175
+ Launch an Electron application.
176
+
177
+ ```javascript
178
+ await testdriver.provision.electron(options)
179
+ ```
180
+
181
+ <ParamField path="options" type="ProvisionElectronOptions" required>
182
+ <Expandable title="properties">
183
+ <ParamField path="appPath" type="string" required>
184
+ Path to the Electron application directory or executable.
185
+ </ParamField>
186
+
187
+ <ParamField path="args" type="string[]" default={[]}>
188
+ Additional command-line arguments to pass to the Electron app.
189
+ </ParamField>
190
+ </Expandable>
191
+ </ParamField>
192
+
193
+ ```javascript
194
+ await testdriver.provision.electron({
195
+ appPath: '/home/testdriver/my-electron-app',
196
+ args: ['--no-sandbox'],
197
+ });
198
+ ```
199
+
200
+ ### dashcam()
201
+
202
+ Start Dashcam recording with custom options. Usually called automatically by other provision methods, but can be called directly for custom configurations.
203
+
204
+ ```javascript
205
+ await testdriver.provision.dashcam(options?)
206
+ ```
207
+
208
+ <ParamField path="options" type="ProvisionDashcamOptions">
209
+ <Expandable title="properties">
210
+ <ParamField path="logPath" type="string">
211
+ Path to the TestDriver log file. Defaults to `/tmp/testdriver.log` (Linux) or `C:\Users\testdriver\testdriver.log` (Windows).
212
+ </ParamField>
213
+
214
+ <ParamField path="logName" type="string" default="TestDriver Log">
215
+ Display name for the log file in the Dashcam replay.
216
+ </ParamField>
217
+
218
+ <ParamField path="webLogs" type="boolean" default={true}>
219
+ Enable web traffic log capture.
220
+ </ParamField>
221
+
222
+ <ParamField path="title" type="string">
223
+ Recording title for the Dashcam session.
224
+ </ParamField>
225
+ </Expandable>
226
+ </ParamField>
227
+
228
+ ```javascript
229
+ await testdriver.provision.dashcam({
230
+ title: 'Login Flow Test',
231
+ logPath: '/tmp/my-app.log',
232
+ logName: 'Application Log',
233
+ webLogs: true,
234
+ });
235
+ ```
236
+
237
+ ## Reconnect Behavior
238
+
239
+ When `reconnect: true` is set on the client, all provision methods are wrapped in a Proxy that intercepts calls and skips them silently. This is because when reconnecting to an existing sandbox, the applications are already running.
240
+
241
+ ```javascript
242
+ const testdriver = new TestDriver({
243
+ reconnect: true,
244
+ });
245
+
246
+ await testdriver.ready();
247
+
248
+ // These calls are silently skipped:
249
+ await testdriver.provision.chrome({ url: 'https://example.com' });
250
+ await testdriver.provision.dashcam();
251
+ ```
252
+
253
+ ## Types
254
+
255
+ ```typescript
256
+ interface ProvisionChromeOptions {
257
+ url?: string; // Default: "http://testdriver-sandbox.vercel.app/"
258
+ maximized?: boolean; // Default: true
259
+ guest?: boolean; // Default: false
260
+ }
261
+
262
+ interface ProvisionChromeExtensionOptions {
263
+ extensionPath?: string; // Local unpacked extension path
264
+ extensionId?: string; // Chrome Web Store ID
265
+ maximized?: boolean; // Default: true
266
+ }
267
+
268
+ interface ProvisionVSCodeOptions {
269
+ workspace?: string; // Workspace path
270
+ extensions?: string[]; // Extension IDs to install
271
+ }
272
+
273
+ interface ProvisionInstallerOptions {
274
+ url: string; // Download URL (required)
275
+ filename?: string; // Override filename
276
+ appName?: string; // App name to focus
277
+ launch?: boolean; // Default: true
278
+ }
279
+
280
+ interface ProvisionElectronOptions {
281
+ appPath: string; // Path to Electron app (required)
282
+ args?: string[]; // Additional args
283
+ }
284
+
285
+ interface ProvisionDashcamOptions {
286
+ logPath?: string; // Log file path
287
+ logName?: string; // Default: "TestDriver Log"
288
+ webLogs?: boolean; // Default: true
289
+ title?: string; // Recording title
290
+ }
291
+ ```
292
+
293
+ ## Complete Example
294
+
295
+ ```javascript
296
+ import { describe, it, beforeAll, afterAll } from 'vitest';
297
+ import TestDriver from 'testdriverai';
298
+
299
+ describe('Chrome Extension Test', () => {
300
+ let testdriver;
301
+
302
+ beforeAll(async () => {
303
+ testdriver = new TestDriver({
304
+ os: 'linux',
305
+ resolution: '1920x1080',
306
+ });
307
+
308
+ await testdriver.ready();
309
+
310
+ // Install extension and open Chrome
311
+ await testdriver.provision.chromeExtension({
312
+ extensionPath: './my-extension',
313
+ });
314
+
315
+ // Start Dashcam with custom logs
316
+ await testdriver.provision.dashcam({
317
+ title: 'Extension Test',
318
+ webLogs: true,
319
+ });
320
+ });
321
+
322
+ afterAll(async () => {
323
+ await testdriver.disconnect();
324
+ });
325
+
326
+ it('tests the extension popup', async () => {
327
+ await testdriver.find('extension icon').click();
328
+ await testdriver.find('popup content').click();
329
+ });
330
+ });
331
+ ```
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: testdriver:quickstart
3
+ description: Run your first computer-use test in minutes.
4
+ ---
5
+ <!-- Generated from quickstart.mdx. DO NOT EDIT. -->
6
+
7
+ TestDriver makes it easy to write automated computer-use tests for web browsers, desktop apps, and more. Follow the directions below to run your first TestDriver test.
8
+
9
+ <Tip><a href="https://discord.com/invite/cWDFW8DzPm" target="_blank" rel="noreferrer">Join our Discord</a> if you have any questions or need help getting started!</Tip>
10
+
11
+ <Tabs>
12
+ <Tab title="CLI" icon="terminal">
13
+
14
+ Get started quickly with the TestDriver CLI.
15
+
16
+ <Steps>
17
+ <Step title="Install TestDriver">
18
+
19
+ Use `npx` to quickly set up an example project:
20
+
21
+ ```bash
22
+ npx testdriverai init
23
+ ```
24
+
25
+ This will walk you through creating a new project folder, installing dependencies, setting up your API key, and configuring MCP for your preferred AI assistant (VS Code, Cursor, Claude Desktop, etc.).
26
+
27
+ </Step>
28
+
29
+ <Step title="Run Your Test">
30
+
31
+ TestDriver uses Vitest as the test runner. To run your test, use:
32
+
33
+ ```bash
34
+ vitest run
35
+ ```
36
+
37
+ This will spawn a sandbox, launch Chrome, and run the example test!
38
+
39
+ </Step>
40
+ </Steps>
41
+ </Tab>
42
+ <Tab title="GitHub Copilot" icon="github">
43
+
44
+ Use the TestDriver VS Code extension with GitHub Copilot for an AI-powered testing workflow.
45
+
46
+ <Card
47
+ title="Install TestDriver for VS Code"
48
+ icon="/images/content/extension/vscode.svg"
49
+ href="vscode:extension/testdriver.testdriver"
50
+ arrow
51
+ horizontal
52
+ >
53
+ </Card>
54
+
55
+ The extension provides one-click sign-in, project initialization, a live preview panel for watching tests execute, and MCP server configuration for GitHub Copilot.
56
+
57
+ Once installed, follow the full setup guide to configure MCP and start building tests with AI assistance:
58
+
59
+ <Card
60
+ title="VS Code + Copilot Setup Guide"
61
+ icon="arrow-right"
62
+ href="/v7/copilot/setup"
63
+ arrow
64
+ horizontal
65
+ >
66
+ Sign in, initialize your project, and configure MCP for GitHub Copilot.
67
+ </Card>
68
+
69
+ </Tab>
70
+ <Tab title="Manual" icon="wrench">
71
+
72
+ Install TestDriver and manually create the files yourself.
73
+
74
+ <Steps>
75
+ <Step title="Create a TestDriver Account">
76
+
77
+ You will need a TestDriver account to get an API key.
78
+
79
+ <Card
80
+ title="Get an API Key"
81
+ icon="user-plus"
82
+ href="https://console.testdriver.ai/team"
83
+ arrow
84
+ horizontal
85
+ >
86
+ Start with 60 free device minutes, no credit-card required!
87
+ </Card>
88
+
89
+ </Step>
90
+ <Step title="Install Dependencies">
91
+
92
+ Install Vitest and TestDriver as dev dependencies:
93
+
94
+ ```bash
95
+ npm install --save-dev vitest testdriverai
96
+ ```
97
+
98
+ </Step>
99
+ <Step title="Create a vitest.config.js File">
100
+
101
+ In your project root, create a `vitest.config.js` file with the following content:
102
+
103
+ ```js vitest.config.js
104
+ import TestDriver from 'testdriverai/vitest';
105
+ import { defineConfig } from 'vitest/config';
106
+
107
+ export default defineConfig({
108
+ test: {
109
+ testTimeout: 900000,
110
+ hookTimeout: 900000,
111
+ reporters: [
112
+ 'default',
113
+ TestDriver()
114
+ ],
115
+ setupFiles: ['testdriverai/vitest/setup'],
116
+ },
117
+ });
118
+ ```
119
+
120
+ </Step>
121
+ <Step title="Create an Example Test File">
122
+
123
+ Add your API key to the example test file below and save it as `test.mjs` in your project root.
124
+
125
+ ```js test.mjs highlight={9}
126
+ import { describe, expect, it } from "vitest";
127
+ // Import TestDriver from the vitest hooks
128
+ import { TestDriver } from "testdriverai/vitest/hooks";
129
+
130
+ describe("Google Search Example", () => {
131
+ it("should search for TestDriver", async (context) => {
132
+ // Create TestDriver instance - automatically connects to sandbox
133
+ const testdriver = TestDriver(context, {
134
+ apiKey: 'YOUR_API_KEY_HERE' // supply your API key here
135
+ });
136
+
137
+ // Provision Chrome browser with a URL
138
+ // This also starts dashcam recording automatically
139
+ await testdriver.provision.chrome({ url: "https://duckduckgo.com" });
140
+
141
+ // Find and interact with elements using natural language
142
+ const searchBox = await testdriver.find("DuckDuckGo search input field");
143
+ await searchBox.click();
144
+
145
+ // Type into the focused element
146
+ await testdriver.type("testdriver.ai");
147
+
148
+ // Press Enter to search
149
+ await testdriver.pressKeys(["enter"]);
150
+
151
+ // Assert something is visible on the page
152
+ const result = await testdriver.assert("search results are displayed");
153
+ expect(result).toBeTruthy();
154
+ });
155
+ });
156
+ ```
157
+
158
+ </Step>
159
+ <Step title="Run Your Test">
160
+
161
+ TestDriver uses Vitest as the test runner. To run your test, use:
162
+
163
+ ```bash
164
+ vitest run
165
+ ```
166
+
167
+ This will spawn a sandbox, launch Chrome, and run the example test!
168
+
169
+ </Step>
170
+ </Steps>
171
+ </Tab>
172
+ </Tabs>