testdriverai 7.8.0-test.7 → 7.8.0-test.71
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/agent/index.js +18 -5
- package/agent/lib/commands.js +3 -2
- package/agent/lib/http.js +162 -0
- package/agent/lib/logger.js +15 -0
- package/agent/lib/sandbox.js +554 -209
- package/agent/lib/sdk.js +5 -22
- package/agent/lib/system.js +25 -65
- package/ai/skills/testdriver-cache/SKILL.md +221 -0
- package/ai/skills/testdriver-errors/SKILL.md +246 -0
- package/ai/skills/testdriver-events/SKILL.md +356 -0
- package/ai/skills/testdriver-find/SKILL.md +14 -20
- package/ai/skills/testdriver-mcp/SKILL.md +7 -0
- package/ai/skills/testdriver-provision/SKILL.md +331 -0
- package/ai/skills/testdriver-redraw/SKILL.md +214 -0
- package/ai/skills/testdriver-running-tests/SKILL.md +1 -1
- package/ai/skills/testdriver-screenshots/SKILL.md +184 -0
- package/docs/_data/examples-manifest.json +46 -46
- package/docs/_scripts/extract-example-urls.js +67 -72
- package/docs/changelog.mdx +148 -8
- package/docs/docs.json +46 -38
- package/docs/images/content/vscode/v7-chat.png +0 -0
- package/docs/images/content/vscode/v7-choose-agent.png +0 -0
- package/docs/images/content/vscode/v7-full.png +0 -0
- package/docs/images/content/vscode/v7-onboarding.png +0 -0
- package/docs/v7/cache.mdx +223 -0
- package/docs/v7/copilot/auto-healing.mdx +265 -0
- package/docs/v7/copilot/creating-tests.mdx +156 -0
- package/docs/v7/copilot/github.mdx +143 -0
- package/docs/v7/copilot/running-tests.mdx +149 -0
- package/docs/v7/copilot/setup.mdx +143 -0
- package/docs/v7/enterprise.mdx +3 -110
- package/docs/v7/errors.mdx +248 -0
- package/docs/v7/events.mdx +358 -0
- package/docs/v7/examples/ai.mdx +1 -1
- package/docs/v7/examples/assert.mdx +1 -1
- package/docs/v7/examples/captcha-api.mdx +1 -1
- package/docs/v7/examples/chrome-extension.mdx +1 -1
- package/docs/v7/examples/drag-and-drop.mdx +1 -1
- package/docs/v7/examples/element-not-found.mdx +1 -1
- package/docs/v7/examples/exec-output.mdx +85 -0
- package/docs/v7/examples/exec-pwsh.mdx +83 -0
- package/docs/v7/examples/focus-window.mdx +62 -0
- package/docs/v7/examples/hover-image.mdx +1 -1
- package/docs/v7/examples/hover-text.mdx +1 -1
- package/docs/v7/examples/installer.mdx +1 -1
- package/docs/v7/examples/launch-vscode-linux.mdx +1 -1
- package/docs/v7/examples/match-image.mdx +1 -1
- package/docs/v7/examples/press-keys.mdx +1 -1
- package/docs/v7/examples/scroll-keyboard.mdx +1 -1
- package/docs/v7/examples/scroll-until-image.mdx +1 -1
- package/docs/v7/examples/scroll-until-text.mdx +1 -1
- package/docs/v7/examples/scroll.mdx +1 -1
- package/docs/v7/examples/type.mdx +1 -1
- package/docs/v7/examples/windows-installer.mdx +1 -1
- package/docs/v7/find.mdx +14 -20
- package/docs/v7/{cloud.mdx → hosted.mdx} +43 -5
- package/docs/v7/mcp.mdx +9 -0
- package/docs/v7/provision.mdx +333 -0
- package/docs/v7/quickstart.mdx +30 -2
- package/docs/v7/redraw.mdx +216 -0
- package/docs/v7/running-tests.mdx +1 -1
- package/docs/v7/screenshots.mdx +186 -0
- package/docs/v7/self-hosted.mdx +127 -44
- package/docs/v7/test-results-json.mdx +258 -0
- package/examples/scroll-keyboard.test.mjs +1 -1
- package/examples/scroll.test.mjs +1 -12
- package/interfaces/logger.js +0 -12
- package/interfaces/vitest-plugin.mjs +170 -51
- package/lib/core/Dashcam.js +30 -23
- package/lib/environments.json +22 -0
- package/lib/github-comment.mjs +58 -40
- package/lib/init-project.js +5 -67
- package/lib/resolve-channel.js +42 -12
- package/lib/sentry.js +47 -23
- package/lib/vitest/hooks.mjs +63 -3
- package/{examples → manual}/drag-and-drop.test.mjs +1 -1
- package/manual/exec-stream-logs.test.mjs +25 -0
- package/mcp-server/dist/server.mjs +28 -8
- package/mcp-server/src/server.ts +31 -8
- package/package.json +4 -3
- package/sdk.d.ts +4 -0
- package/sdk.js +45 -15
- package/setup/aws/install-dev-runner.sh +79 -0
- package/setup/aws/spawn-runner.sh +165 -0
- package/test-sentry-span.js +35 -0
- package/vitest.config.mjs +22 -34
- package/vitest.runner.config.mjs +33 -0
- /package/{examples → manual}/flake-diffthreshold-001.test.mjs +0 -0
- /package/{examples → manual}/flake-diffthreshold-01.test.mjs +0 -0
- /package/{examples → manual}/flake-diffthreshold-05.test.mjs +0 -0
- /package/{examples → manual}/flake-noredraw-cache.test.mjs +0 -0
- /package/{examples → manual}/flake-noredraw-nocache.test.mjs +0 -0
- /package/{examples → manual}/flake-redraw-cache.test.mjs +0 -0
- /package/{examples → manual}/flake-redraw-nocache.test.mjs +0 -0
- /package/{examples → manual}/flake-rocket-match.test.mjs +0 -0
- /package/{examples → manual}/flake-shared.mjs +0 -0
- /package/{examples → manual}/no-provision.test.mjs +0 -0
- /package/{examples → manual}/scroll-until-text.test.mjs +0 -0
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* match-image.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69c32c9a6560e1c6d04ac33c/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* press-keys.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69c32ca6b4a333234cc21a72/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll-keyboard.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69c32cab6f1e64e218b9e1c8/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll-until-image.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69c32cad6560e1c6d04ac342/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll-until-text.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api.testdriver.ai/api/v1/testdriver/testcase/69a62b99dc33133fc0da9440/replay"
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69a62b99dc33133fc0da9440/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69c32cb1ca96d9648a141714/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* type.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69c32ca56560e1c6d04ac33f/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* windows-installer.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69c32c9e6f1e64e218b9e1c3/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
package/docs/v7/find.mdx
CHANGED
|
@@ -50,8 +50,8 @@ const element = await testdriver.find(description, options)
|
|
|
50
50
|
- `"any"` — No wrapping, uses the description as-is (default behavior)
|
|
51
51
|
</ParamField>
|
|
52
52
|
|
|
53
|
-
<ParamField path="zoom" type="boolean" default={
|
|
54
|
-
|
|
53
|
+
<ParamField path="zoom" type="boolean" default={true}>
|
|
54
|
+
Two-phase zoom mode for better precision in crowded UIs with many similar elements. Enabled by default.
|
|
55
55
|
</ParamField>
|
|
56
56
|
|
|
57
57
|
<ParamField path="ai" type="object">
|
|
@@ -333,14 +333,19 @@ The `timeout` option:
|
|
|
333
333
|
- Returns the element (check `element.found()` if not throwing on failure)
|
|
334
334
|
- Set to `0` to disable polling and make a single attempt
|
|
335
335
|
|
|
336
|
-
## Zoom Mode
|
|
336
|
+
## Zoom Mode
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
Zoom mode is **enabled by default**. It uses a two-phase approach for better precision when locating elements, especially in crowded UIs with many similar elements.
|
|
339
|
+
|
|
340
|
+
To disable zoom for a specific find call, pass `zoom: false`:
|
|
339
341
|
|
|
340
342
|
```javascript
|
|
341
|
-
//
|
|
342
|
-
const extensionsBtn = await testdriver.find('extensions puzzle icon in Chrome toolbar'
|
|
343
|
+
// Zoom is on by default — no option needed
|
|
344
|
+
const extensionsBtn = await testdriver.find('extensions puzzle icon in Chrome toolbar');
|
|
343
345
|
await extensionsBtn.click();
|
|
346
|
+
|
|
347
|
+
// Disable zoom for a specific call if needed
|
|
348
|
+
const largeButton = await testdriver.find('big hero button', { zoom: false });
|
|
344
349
|
```
|
|
345
350
|
|
|
346
351
|
### How Zoom Mode Works
|
|
@@ -353,22 +358,11 @@ await extensionsBtn.click();
|
|
|
353
358
|
This two-phase approach gives the AI a higher-resolution view of the target area, improving accuracy when multiple similar elements are close together.
|
|
354
359
|
|
|
355
360
|
<Tip>
|
|
356
|
-
|
|
357
|
-
-
|
|
358
|
-
-
|
|
359
|
-
- Targeting elements in dense UI areas
|
|
360
|
-
- The default locate is clicking the wrong similar element
|
|
361
|
-
- You get an AI verification rejection like "The crosshair is located in the empty space of the browser's tab bar/title bar area" — this means the initial locate was imprecise and zoom will help the AI pinpoint the correct element
|
|
361
|
+
You may want to disable zoom with `zoom: false` when:
|
|
362
|
+
- Targeting large, isolated elements where the extra precision isn't needed
|
|
363
|
+
- You want to speed up find calls in simple UIs
|
|
362
364
|
</Tip>
|
|
363
365
|
|
|
364
|
-
```javascript
|
|
365
|
-
// Without zoom - may click wrong icon in toolbar
|
|
366
|
-
const icon = await testdriver.find('settings icon');
|
|
367
|
-
|
|
368
|
-
// With zoom - better precision for crowded areas
|
|
369
|
-
const icon = await testdriver.find('settings icon', { zoom: true });
|
|
370
|
-
```
|
|
371
|
-
|
|
372
366
|
## Cache Options
|
|
373
367
|
|
|
374
368
|
Control caching behavior to optimize performance, especially when using dynamic variables in prompts.
|
|
@@ -1,18 +1,56 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
3
|
-
sidebarTitle: "
|
|
2
|
+
title: "Hosted"
|
|
3
|
+
sidebarTitle: "Hosted"
|
|
4
4
|
description: "The fastest way to get started with TestDriver. Just set your API key and start testing."
|
|
5
5
|
icon: "cloud"
|
|
6
|
+
mode: "wide"
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Hosted pricing is based on **device-seconds**: the amount of time your tests run on **our infrastructure**.
|
|
9
10
|
|
|
10
11
|
- **Zero Setup** — Start testing immediately. No DevOps required.
|
|
11
12
|
- **Free Tier** — Get started with a limited preview at no cost.
|
|
12
13
|
- **Pay As You Go** — Only pay for the device-seconds you use.
|
|
13
14
|
|
|
15
|
+
## Hosted Plans
|
|
16
|
+
|
|
17
|
+
<CardGroup cols={3}>
|
|
18
|
+
<Card title="Free Trial" icon="gift" href="https://docs.testdriver.ai">
|
|
19
|
+
**$0/month**
|
|
20
|
+
|
|
21
|
+
- 1 Concurrent Sandbox
|
|
22
|
+
- 60 Minutes Included
|
|
23
|
+
- 1 Team User
|
|
24
|
+
- Community Support
|
|
25
|
+
</Card>
|
|
26
|
+
|
|
27
|
+
<Card title="Pro" icon="rocket" href="https://console.testdriver.ai/checkout/pro">
|
|
28
|
+
**$20/month**
|
|
29
|
+
|
|
30
|
+
- 2 Concurrent Sandboxes
|
|
31
|
+
- 600 Minutes Included
|
|
32
|
+
- Overage: $0.002/second
|
|
33
|
+
- 1 Team User
|
|
34
|
+
- Test Recordings
|
|
35
|
+
- Community Support
|
|
36
|
+
</Card>
|
|
37
|
+
|
|
38
|
+
<Card title="Team" icon="users" href="https://console.testdriver.ai/checkout/team">
|
|
39
|
+
**$600/month**
|
|
40
|
+
|
|
41
|
+
- 8 Concurrent Sandboxes
|
|
42
|
+
- 10,000 Minutes Included
|
|
43
|
+
- Overage: $0.001/second
|
|
44
|
+
- 5 Team Users
|
|
45
|
+
- Test Recordings
|
|
46
|
+
- Private Support
|
|
47
|
+
- Test Analytics
|
|
48
|
+
- CPU, RAM, & Network Profiles
|
|
49
|
+
</Card>
|
|
50
|
+
</CardGroup>
|
|
51
|
+
|
|
14
52
|
## Get Started
|
|
15
|
-
|
|
53
|
+
Hosted is the default when you follow the Quickstart guide.
|
|
16
54
|
<Card
|
|
17
55
|
title="Try the Quickstart"
|
|
18
56
|
icon="play"
|
|
@@ -102,7 +140,7 @@ To prevent tests from failing due to exceeding your license slot limit, we recom
|
|
|
102
140
|
|
|
103
141
|
## When to Consider Self-Hosted
|
|
104
142
|
|
|
105
|
-
|
|
143
|
+
Hosted is perfect for getting started and for teams that want zero infrastructure management. However, you might consider [Self-Hosted](/v7/self-hosted) if you:
|
|
106
144
|
|
|
107
145
|
- Want to escape per-second billing with a flat license fee
|
|
108
146
|
- Require greater concurrency than offered in Cloud plans
|
package/docs/v7/mcp.mdx
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Provision"
|
|
3
|
+
sidebarTitle: "Provision"
|
|
4
|
+
description: "Launch browsers, desktop apps, and extensions in your sandbox"
|
|
5
|
+
icon: "rocket"
|
|
6
|
+
mode: "wide"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
Access provision methods via `testdriver.provision.*`:
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
await testdriver.provision.chrome({ url: 'https://example.com' });
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
<Note>
|
|
20
|
+
When `reconnect: true` is set on the client, **all provision methods are skipped** since the application is assumed to already be running.
|
|
21
|
+
</Note>
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### chrome()
|
|
26
|
+
|
|
27
|
+
Launch Google Chrome with an optional URL.
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
await testdriver.provision.chrome(options?)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
<ParamField path="options" type="ProvisionChromeOptions">
|
|
34
|
+
<Expandable title="properties">
|
|
35
|
+
<ParamField path="url" type="string" default="http://testdriver-sandbox.vercel.app/">
|
|
36
|
+
URL to navigate to after launch.
|
|
37
|
+
</ParamField>
|
|
38
|
+
|
|
39
|
+
<ParamField path="maximized" type="boolean" default={true}>
|
|
40
|
+
Launch Chrome in maximized window mode.
|
|
41
|
+
</ParamField>
|
|
42
|
+
|
|
43
|
+
<ParamField path="guest" type="boolean" default={false}>
|
|
44
|
+
Launch Chrome in guest profile mode.
|
|
45
|
+
</ParamField>
|
|
46
|
+
</Expandable>
|
|
47
|
+
</ParamField>
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
// Basic
|
|
51
|
+
await testdriver.provision.chrome({ url: 'https://example.com' });
|
|
52
|
+
|
|
53
|
+
// With guest mode
|
|
54
|
+
await testdriver.provision.chrome({
|
|
55
|
+
url: 'https://example.com',
|
|
56
|
+
guest: true,
|
|
57
|
+
maximized: true,
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### chromeExtension()
|
|
62
|
+
|
|
63
|
+
Install and launch a Chrome extension. You can install from a local unpacked directory or from the Chrome Web Store by extension ID.
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
await testdriver.provision.chromeExtension(options)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
<ParamField path="options" type="ProvisionChromeExtensionOptions" required>
|
|
70
|
+
One of `extensionPath` or `extensionId` is required.
|
|
71
|
+
|
|
72
|
+
<Expandable title="properties">
|
|
73
|
+
<ParamField path="extensionPath" type="string">
|
|
74
|
+
Local path to an unpacked extension directory. The extension files are uploaded to the sandbox.
|
|
75
|
+
</ParamField>
|
|
76
|
+
|
|
77
|
+
<ParamField path="extensionId" type="string">
|
|
78
|
+
Chrome Web Store extension ID to install.
|
|
79
|
+
</ParamField>
|
|
80
|
+
|
|
81
|
+
<ParamField path="maximized" type="boolean" default={true}>
|
|
82
|
+
Launch Chrome in maximized window mode.
|
|
83
|
+
</ParamField>
|
|
84
|
+
</Expandable>
|
|
85
|
+
</ParamField>
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
// From local directory
|
|
89
|
+
await testdriver.provision.chromeExtension({
|
|
90
|
+
extensionPath: './my-extension',
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// From Chrome Web Store
|
|
94
|
+
await testdriver.provision.chromeExtension({
|
|
95
|
+
extensionId: 'abcdefghijklmnop',
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### vscode()
|
|
100
|
+
|
|
101
|
+
Launch Visual Studio Code with an optional workspace and extensions.
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
await testdriver.provision.vscode(options?)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
<ParamField path="options" type="ProvisionVSCodeOptions">
|
|
108
|
+
<Expandable title="properties">
|
|
109
|
+
<ParamField path="workspace" type="string">
|
|
110
|
+
Path to a workspace folder or `.code-workspace` file to open.
|
|
111
|
+
</ParamField>
|
|
112
|
+
|
|
113
|
+
<ParamField path="extensions" type="string[]" default={[]}>
|
|
114
|
+
Array of VS Code extension IDs to install before launching.
|
|
115
|
+
</ParamField>
|
|
116
|
+
</Expandable>
|
|
117
|
+
</ParamField>
|
|
118
|
+
|
|
119
|
+
```javascript
|
|
120
|
+
await testdriver.provision.vscode({
|
|
121
|
+
workspace: '/home/testdriver/project',
|
|
122
|
+
extensions: ['ms-python.python', 'esbenp.prettier-vscode'],
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### installer()
|
|
127
|
+
|
|
128
|
+
Download and run an application installer. Supports `.msi`, `.exe`, `.deb`, `.rpm`, `.appimage`, `.sh`, `.dmg`, and `.pkg` formats.
|
|
129
|
+
|
|
130
|
+
```javascript
|
|
131
|
+
await testdriver.provision.installer(options)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
<ParamField path="options" type="ProvisionInstallerOptions" required>
|
|
135
|
+
<Expandable title="properties">
|
|
136
|
+
<ParamField path="url" type="string" required>
|
|
137
|
+
Download URL for the installer.
|
|
138
|
+
</ParamField>
|
|
139
|
+
|
|
140
|
+
<ParamField path="filename" type="string">
|
|
141
|
+
Override the auto-detected filename from the URL.
|
|
142
|
+
</ParamField>
|
|
143
|
+
|
|
144
|
+
<ParamField path="appName" type="string">
|
|
145
|
+
Application name to focus after installation completes.
|
|
146
|
+
</ParamField>
|
|
147
|
+
|
|
148
|
+
<ParamField path="launch" type="boolean" default={true}>
|
|
149
|
+
Whether to focus/launch the app after installation.
|
|
150
|
+
</ParamField>
|
|
151
|
+
</Expandable>
|
|
152
|
+
</ParamField>
|
|
153
|
+
|
|
154
|
+
**Behavior:**
|
|
155
|
+
- Downloads the installer from the URL
|
|
156
|
+
- Auto-detects the install method based on file extension
|
|
157
|
+
- Runs the appropriate install command (e.g., `msiexec` for `.msi`, `dpkg` for `.deb`)
|
|
158
|
+
- Optionally focuses the installed application
|
|
159
|
+
|
|
160
|
+
```javascript
|
|
161
|
+
// Windows MSI installer
|
|
162
|
+
await testdriver.provision.installer({
|
|
163
|
+
url: 'https://example.com/app-setup.msi',
|
|
164
|
+
appName: 'MyApp',
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// Linux DEB package
|
|
168
|
+
await testdriver.provision.installer({
|
|
169
|
+
url: 'https://example.com/app.deb',
|
|
170
|
+
appName: 'MyApp',
|
|
171
|
+
launch: true,
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### electron()
|
|
176
|
+
|
|
177
|
+
Launch an Electron application.
|
|
178
|
+
|
|
179
|
+
```javascript
|
|
180
|
+
await testdriver.provision.electron(options)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
<ParamField path="options" type="ProvisionElectronOptions" required>
|
|
184
|
+
<Expandable title="properties">
|
|
185
|
+
<ParamField path="appPath" type="string" required>
|
|
186
|
+
Path to the Electron application directory or executable.
|
|
187
|
+
</ParamField>
|
|
188
|
+
|
|
189
|
+
<ParamField path="args" type="string[]" default={[]}>
|
|
190
|
+
Additional command-line arguments to pass to the Electron app.
|
|
191
|
+
</ParamField>
|
|
192
|
+
</Expandable>
|
|
193
|
+
</ParamField>
|
|
194
|
+
|
|
195
|
+
```javascript
|
|
196
|
+
await testdriver.provision.electron({
|
|
197
|
+
appPath: '/home/testdriver/my-electron-app',
|
|
198
|
+
args: ['--no-sandbox'],
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### dashcam()
|
|
203
|
+
|
|
204
|
+
Start Dashcam recording with custom options. Usually called automatically by other provision methods, but can be called directly for custom configurations.
|
|
205
|
+
|
|
206
|
+
```javascript
|
|
207
|
+
await testdriver.provision.dashcam(options?)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
<ParamField path="options" type="ProvisionDashcamOptions">
|
|
211
|
+
<Expandable title="properties">
|
|
212
|
+
<ParamField path="logPath" type="string">
|
|
213
|
+
Path to the TestDriver log file. Defaults to `/tmp/testdriver.log` (Linux) or `C:\Users\testdriver\testdriver.log` (Windows).
|
|
214
|
+
</ParamField>
|
|
215
|
+
|
|
216
|
+
<ParamField path="logName" type="string" default="TestDriver Log">
|
|
217
|
+
Display name for the log file in the Dashcam replay.
|
|
218
|
+
</ParamField>
|
|
219
|
+
|
|
220
|
+
<ParamField path="webLogs" type="boolean" default={true}>
|
|
221
|
+
Enable web traffic log capture.
|
|
222
|
+
</ParamField>
|
|
223
|
+
|
|
224
|
+
<ParamField path="title" type="string">
|
|
225
|
+
Recording title for the Dashcam session.
|
|
226
|
+
</ParamField>
|
|
227
|
+
</Expandable>
|
|
228
|
+
</ParamField>
|
|
229
|
+
|
|
230
|
+
```javascript
|
|
231
|
+
await testdriver.provision.dashcam({
|
|
232
|
+
title: 'Login Flow Test',
|
|
233
|
+
logPath: '/tmp/my-app.log',
|
|
234
|
+
logName: 'Application Log',
|
|
235
|
+
webLogs: true,
|
|
236
|
+
});
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Reconnect Behavior
|
|
240
|
+
|
|
241
|
+
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.
|
|
242
|
+
|
|
243
|
+
```javascript
|
|
244
|
+
const testdriver = new TestDriver({
|
|
245
|
+
reconnect: true,
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
await testdriver.ready();
|
|
249
|
+
|
|
250
|
+
// These calls are silently skipped:
|
|
251
|
+
await testdriver.provision.chrome({ url: 'https://example.com' });
|
|
252
|
+
await testdriver.provision.dashcam();
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Types
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
interface ProvisionChromeOptions {
|
|
259
|
+
url?: string; // Default: "http://testdriver-sandbox.vercel.app/"
|
|
260
|
+
maximized?: boolean; // Default: true
|
|
261
|
+
guest?: boolean; // Default: false
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
interface ProvisionChromeExtensionOptions {
|
|
265
|
+
extensionPath?: string; // Local unpacked extension path
|
|
266
|
+
extensionId?: string; // Chrome Web Store ID
|
|
267
|
+
maximized?: boolean; // Default: true
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
interface ProvisionVSCodeOptions {
|
|
271
|
+
workspace?: string; // Workspace path
|
|
272
|
+
extensions?: string[]; // Extension IDs to install
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
interface ProvisionInstallerOptions {
|
|
276
|
+
url: string; // Download URL (required)
|
|
277
|
+
filename?: string; // Override filename
|
|
278
|
+
appName?: string; // App name to focus
|
|
279
|
+
launch?: boolean; // Default: true
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
interface ProvisionElectronOptions {
|
|
283
|
+
appPath: string; // Path to Electron app (required)
|
|
284
|
+
args?: string[]; // Additional args
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
interface ProvisionDashcamOptions {
|
|
288
|
+
logPath?: string; // Log file path
|
|
289
|
+
logName?: string; // Default: "TestDriver Log"
|
|
290
|
+
webLogs?: boolean; // Default: true
|
|
291
|
+
title?: string; // Recording title
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Complete Example
|
|
296
|
+
|
|
297
|
+
```javascript
|
|
298
|
+
import { describe, it, beforeAll, afterAll } from 'vitest';
|
|
299
|
+
import TestDriver from 'testdriverai';
|
|
300
|
+
|
|
301
|
+
describe('Chrome Extension Test', () => {
|
|
302
|
+
let testdriver;
|
|
303
|
+
|
|
304
|
+
beforeAll(async () => {
|
|
305
|
+
testdriver = new TestDriver({
|
|
306
|
+
os: 'linux',
|
|
307
|
+
resolution: '1920x1080',
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
await testdriver.ready();
|
|
311
|
+
|
|
312
|
+
// Install extension and open Chrome
|
|
313
|
+
await testdriver.provision.chromeExtension({
|
|
314
|
+
extensionPath: './my-extension',
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// Start Dashcam with custom logs
|
|
318
|
+
await testdriver.provision.dashcam({
|
|
319
|
+
title: 'Extension Test',
|
|
320
|
+
webLogs: true,
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
afterAll(async () => {
|
|
325
|
+
await testdriver.disconnect();
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('tests the extension popup', async () => {
|
|
329
|
+
await testdriver.find('extension icon').click();
|
|
330
|
+
await testdriver.find('popup content').click();
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
```
|
package/docs/v7/quickstart.mdx
CHANGED
|
@@ -10,7 +10,7 @@ TestDriver makes it easy to write automated computer-use tests for web browsers,
|
|
|
10
10
|
<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>
|
|
11
11
|
|
|
12
12
|
<Tabs>
|
|
13
|
-
<Tab title="
|
|
13
|
+
<Tab title="CLI" icon="terminal">
|
|
14
14
|
|
|
15
15
|
Get started quickly with the TestDriver CLI.
|
|
16
16
|
|
|
@@ -40,7 +40,35 @@ TestDriver makes it easy to write automated computer-use tests for web browsers,
|
|
|
40
40
|
</Step>
|
|
41
41
|
</Steps>
|
|
42
42
|
</Tab>
|
|
43
|
-
<Tab title="
|
|
43
|
+
<Tab title="GitHub Copilot" icon="github">
|
|
44
|
+
|
|
45
|
+
Use the TestDriver VS Code extension with GitHub Copilot for an AI-powered testing workflow.
|
|
46
|
+
|
|
47
|
+
<Card
|
|
48
|
+
title="Install TestDriver for VS Code"
|
|
49
|
+
icon="/images/content/extension/vscode.svg"
|
|
50
|
+
href="vscode:extension/testdriver.testdriver"
|
|
51
|
+
arrow
|
|
52
|
+
horizontal
|
|
53
|
+
>
|
|
54
|
+
</Card>
|
|
55
|
+
|
|
56
|
+
The extension provides one-click sign-in, project initialization, a live preview panel for watching tests execute, and MCP server configuration for GitHub Copilot.
|
|
57
|
+
|
|
58
|
+
Once installed, follow the full setup guide to configure MCP and start building tests with AI assistance:
|
|
59
|
+
|
|
60
|
+
<Card
|
|
61
|
+
title="VS Code + Copilot Setup Guide"
|
|
62
|
+
icon="arrow-right"
|
|
63
|
+
href="/v7/copilot/setup"
|
|
64
|
+
arrow
|
|
65
|
+
horizontal
|
|
66
|
+
>
|
|
67
|
+
Sign in, initialize your project, and configure MCP for GitHub Copilot.
|
|
68
|
+
</Card>
|
|
69
|
+
|
|
70
|
+
</Tab>
|
|
71
|
+
<Tab title="Manual" icon="wrench">
|
|
44
72
|
|
|
45
73
|
Install TestDriver and manually create the files yourself.
|
|
46
74
|
|