@testdriverai/mcp 7.10.0-canary.0 → 7.10.1-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 (196) hide show
  1. package/.claude-plugin/marketplace.json +17 -0
  2. package/agent/index.js +116 -71
  3. package/agent/interface.js +13 -1
  4. package/agent/lib/commands.js +35 -15
  5. package/agent/lib/provision-commands.js +92 -11
  6. package/agent/lib/sandbox.js +263 -30
  7. package/agent/lib/sdk.js +16 -12
  8. package/agent/lib/system.js +107 -31
  9. package/ai/.claude-plugin/plugin.json +89 -4
  10. package/ai/agents/testdriver.md +4 -8
  11. package/ai/skills/testdriver-assert/SKILL.md +0 -1
  12. package/ai/skills/testdriver-aws-setup/SKILL.md +1 -1
  13. package/ai/skills/testdriver-caching/SKILL.md +13 -6
  14. package/ai/skills/testdriver-ci-cd/SKILL.md +57 -14
  15. package/ai/skills/testdriver-client/SKILL.md +10 -6
  16. package/ai/skills/testdriver-customizing-devices/SKILL.md +7 -5
  17. package/ai/skills/testdriver-dashcam/SKILL.md +36 -3
  18. package/ai/skills/testdriver-debugging-with-screenshots/SKILL.md +28 -4
  19. package/ai/skills/testdriver-device-config/SKILL.md +5 -5
  20. package/ai/skills/testdriver-find/SKILL.md +50 -11
  21. package/ai/skills/testdriver-generating-tests/SKILL.md +163 -8
  22. package/ai/skills/testdriver-hosted/SKILL.md +1 -1
  23. package/ai/skills/testdriver-machine-setup/SKILL.md +331 -0
  24. package/ai/skills/testdriver-making-assertions/SKILL.md +78 -2
  25. package/ai/skills/testdriver-mcp-workflow/SKILL.md +2 -2
  26. package/ai/skills/testdriver-parse/SKILL.md +1 -1
  27. package/ai/skills/testdriver-performing-actions/SKILL.md +97 -3
  28. package/ai/skills/testdriver-provision/SKILL.md +0 -20
  29. package/ai/skills/testdriver-quickstart/SKILL.md +299 -21
  30. package/ai/skills/testdriver-reusable-code/SKILL.md +3 -3
  31. package/ai/skills/testdriver-running-tests/SKILL.md +1 -1
  32. package/ai/skills/testdriver-screenshot/SKILL.md +5 -5
  33. package/ai/skills/testdriver-scroll/SKILL.md +30 -160
  34. package/ai/skills/testdriver-test-writer/SKILL.md +3 -5
  35. package/ai/skills/testdriver-testdriver/SKILL.md +3 -7
  36. package/ai/skills/testdriver-wait/SKILL.md +1 -1
  37. package/{docs/v7/ai.mdx → ai/skills/testdriver:ai/SKILL.md} +3 -4
  38. package/ai/skills/testdriver:assert/SKILL.md +315 -0
  39. package/ai/skills/testdriver:aws-setup/SKILL.md +448 -0
  40. package/ai/skills/testdriver:cache/SKILL.md +221 -0
  41. package/ai/skills/testdriver:caching/SKILL.md +124 -0
  42. package/ai/skills/testdriver:captcha/SKILL.md +158 -0
  43. package/ai/skills/testdriver:ci-cd/SKILL.md +659 -0
  44. package/ai/skills/testdriver:click/SKILL.md +286 -0
  45. package/ai/skills/testdriver:client/SKILL.md +477 -0
  46. package/ai/skills/testdriver:customizing-devices/SKILL.md +319 -0
  47. package/ai/skills/testdriver:dashcam/SKILL.md +451 -0
  48. package/ai/skills/testdriver:debugging-with-screenshots/SKILL.md +415 -0
  49. package/{docs/v7/device-config.mdx → ai/skills/testdriver:device-config/SKILL.md} +8 -8
  50. package/ai/skills/testdriver:double-click/SKILL.md +102 -0
  51. package/ai/skills/testdriver:elements/SKILL.md +605 -0
  52. package/ai/skills/testdriver:enterprise/SKILL.md +7 -0
  53. package/ai/skills/testdriver:errors/SKILL.md +246 -0
  54. package/ai/skills/testdriver:events/SKILL.md +356 -0
  55. package/ai/skills/testdriver:exec/SKILL.md +317 -0
  56. package/ai/skills/testdriver:find/SKILL.md +860 -0
  57. package/ai/skills/testdriver:focus-application/SKILL.md +293 -0
  58. package/ai/skills/testdriver:generating-tests/SKILL.md +25 -0
  59. package/ai/skills/testdriver:hosted/SKILL.md +156 -0
  60. package/ai/skills/testdriver:hover/SKILL.md +278 -0
  61. package/{docs/v7/locating-elements.mdx → ai/skills/testdriver:locating-elements/SKILL.md} +3 -3
  62. package/ai/skills/testdriver:making-assertions/SKILL.md +32 -0
  63. package/ai/skills/testdriver:mcp/SKILL.md +7 -0
  64. package/ai/skills/testdriver:mouse-down/SKILL.md +161 -0
  65. package/ai/skills/testdriver:mouse-up/SKILL.md +164 -0
  66. package/ai/skills/testdriver:parse/SKILL.md +236 -0
  67. package/ai/skills/testdriver:performing-actions/SKILL.md +53 -0
  68. package/ai/skills/testdriver:press-keys/SKILL.md +348 -0
  69. package/ai/skills/testdriver:provision/SKILL.md +331 -0
  70. package/ai/skills/testdriver:quickstart/SKILL.md +172 -0
  71. package/ai/skills/testdriver:redraw/SKILL.md +214 -0
  72. package/ai/skills/testdriver:reusable-code/SKILL.md +249 -0
  73. package/ai/skills/testdriver:right-click/SKILL.md +123 -0
  74. package/{docs/v7/running-tests.mdx → ai/skills/testdriver:running-tests/SKILL.md} +4 -4
  75. package/ai/skills/testdriver:screenshot/SKILL.md +248 -0
  76. package/ai/skills/testdriver:screenshots/SKILL.md +184 -0
  77. package/ai/skills/testdriver:scroll/SKILL.md +205 -0
  78. package/ai/skills/testdriver:secrets/SKILL.md +115 -0
  79. package/ai/skills/testdriver:self-hosted/SKILL.md +147 -0
  80. package/ai/skills/testdriver:test-results-json/SKILL.md +257 -0
  81. package/ai/skills/testdriver:testdriver/SKILL.md +624 -0
  82. package/ai/skills/testdriver:type/SKILL.md +357 -0
  83. package/ai/skills/testdriver:variables/SKILL.md +111 -0
  84. package/ai/skills/testdriver:wait/SKILL.md +50 -0
  85. package/{docs/v7/waiting-for-elements.mdx → ai/skills/testdriver:waiting-for-elements/SKILL.md} +3 -3
  86. package/ai/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
  87. package/debugger/index.html +12 -0
  88. package/docs/_data/examples-manifest.json +54 -46
  89. package/docs/_data/examples-manifest.schema.json +12 -2
  90. package/docs/_scripts/extract-example-urls.js +21 -3
  91. package/docs/_scripts/generate-examples.js +64 -16
  92. package/docs/changelog.mdx +29 -2
  93. package/docs/claude-mcp-plugin.mdx +65 -18
  94. package/docs/docs.json +16 -33
  95. package/docs/snippets/tests/scroll-yaml.mdx +2 -2
  96. package/docs/v6/commands/scroll-until-image.mdx +1 -1
  97. package/docs/v6/commands/scroll-until-text.mdx +2 -2
  98. package/docs/v6/commands/scroll.mdx +2 -2
  99. package/docs/v7/_drafts/agents.mdx +0 -4
  100. package/docs/v7/_drafts/best-practices.mdx +0 -12
  101. package/docs/v7/_drafts/commands/scroll-until-image.mdx +1 -1
  102. package/docs/v7/_drafts/commands/scroll-until-text.mdx +2 -2
  103. package/docs/v7/_drafts/commands/scroll.mdx +1 -1
  104. package/docs/v7/_drafts/configuration.mdx +0 -12
  105. package/docs/v7/_drafts/faq.mdx +2 -10
  106. package/docs/v7/_drafts/readme.mdx +0 -1
  107. package/docs/v7/_drafts/troubleshooting.mdx +1 -4
  108. package/docs/v7/assert.mdx +0 -1
  109. package/docs/v7/aws-setup.mdx +1 -1
  110. package/docs/v7/caching.mdx +14 -10
  111. package/docs/v7/ci-cd.mdx +98 -14
  112. package/docs/v7/client.mdx +10 -6
  113. package/docs/v7/copilot/auto-healing.mdx +167 -18
  114. package/docs/v7/copilot/running-tests.mdx +915 -54
  115. package/docs/v7/customizing-devices.mdx +7 -5
  116. package/docs/v7/dashcam.mdx +36 -3
  117. package/docs/v7/debugging-with-screenshots.mdx +31 -7
  118. package/docs/v7/examples/ai.mdx +13 -8
  119. package/docs/v7/examples/assert.mdx +1 -1
  120. package/docs/v7/examples/chrome-extension.mdx +30 -13
  121. package/docs/v7/examples/element-not-found.mdx +1 -1
  122. package/docs/v7/examples/findall-coffee-icons.mdx +3 -2
  123. package/docs/v7/examples/formatted-logging.mdx +74 -0
  124. package/docs/v7/examples/hover-image.mdx +1 -1
  125. package/docs/v7/examples/hover-text-with-description.mdx +2 -2
  126. package/docs/v7/examples/hover-text.mdx +1 -1
  127. package/docs/v7/examples/installer.mdx +1 -1
  128. package/docs/v7/examples/launch-vscode-linux.mdx +27 -27
  129. package/docs/v7/examples/match-image.mdx +1 -1
  130. package/docs/v7/examples/parse.mdx +3 -2
  131. package/docs/v7/examples/press-keys.mdx +2 -2
  132. package/docs/v7/examples/scroll-keyboard.mdx +2 -2
  133. package/docs/v7/examples/scroll-until-text.mdx +1 -1
  134. package/docs/v7/examples/scroll.mdx +1 -1
  135. package/docs/v7/examples/type.mdx +1 -1
  136. package/docs/v7/find.mdx +50 -11
  137. package/docs/v7/generating-tests.mdx +166 -10
  138. package/docs/v7/hosted.mdx +1 -1
  139. package/docs/v7/making-assertions.mdx +81 -4
  140. package/docs/v7/parse.mdx +1 -1
  141. package/docs/v7/performing-actions.mdx +100 -5
  142. package/docs/v7/provision.mdx +0 -20
  143. package/docs/v7/quickstart.mdx +299 -21
  144. package/docs/v7/reusable-code.mdx +3 -3
  145. package/docs/v7/screenshot.mdx +5 -5
  146. package/docs/v7/scroll.mdx +30 -160
  147. package/docs/v7/wait.mdx +1 -1
  148. package/examples/chrome-extension.test.mjs +29 -12
  149. package/examples/config.mjs +1 -1
  150. package/examples/launch-vscode-linux.test.mjs +25 -25
  151. package/interfaces/cli/commands/init.js +84 -2
  152. package/interfaces/vitest-plugin.mjs +51 -61
  153. package/lib/core/Dashcam.js +43 -2
  154. package/lib/core/index.d.ts +13 -1
  155. package/lib/github-comment.mjs +11 -5
  156. package/lib/init-project.js +98 -44
  157. package/lib/install-clients.js +470 -0
  158. package/lib/provision.js +749 -0
  159. package/lib/resolve-channel.js +2 -2
  160. package/lib/sentry.js +15 -2
  161. package/lib/vitest/hooks.mjs +44 -34
  162. package/mcp-server/README.md +32 -0
  163. package/mcp-server/dist/core/actions.d.ts +176 -0
  164. package/mcp-server/dist/core/actions.js +753 -0
  165. package/mcp-server/dist/env-utils.d.ts +45 -0
  166. package/mcp-server/dist/env-utils.js +63 -0
  167. package/mcp-server/dist/provision-types.d.ts +6 -2
  168. package/mcp-server/dist/provision-types.js +3 -1
  169. package/mcp-server/dist/server.mjs +449 -751
  170. package/mcp-server/package-lock.json +384 -1
  171. package/mcp-server/package.json +5 -2
  172. package/mcp-server/src/core/actions.ts +912 -0
  173. package/mcp-server/src/env-utils.test.ts +82 -0
  174. package/mcp-server/src/env-utils.ts +77 -0
  175. package/mcp-server/src/provision-types.ts +4 -1
  176. package/mcp-server/src/server.ts +533 -954
  177. package/mcp-server/tsconfig.json +1 -1
  178. package/mcp-server/vitest.config.ts +7 -0
  179. package/package.json +15 -3
  180. package/sdk.d.ts +11 -9
  181. package/sdk.js +116 -746
  182. package/setup/aws/spawn-runner.sh +24 -3
  183. package/docs/v7/_drafts/caching-ai.mdx +0 -215
  184. package/docs/v7/_drafts/caching.mdx +0 -366
  185. package/docs/v7/_drafts/prompt-cache.mdx +0 -200
  186. package/docs/v7/copilot/creating-tests.mdx +0 -156
  187. package/docs/v7/copilot/github.mdx +0 -143
  188. package/docs/v7/copilot/setup.mdx +0 -143
  189. package/docs/v7/examples/exec-output.mdx +0 -84
  190. package/docs/v7/examples/exec-pwsh.mdx +0 -82
  191. package/docs/v7/examples/focus-window.mdx +0 -61
  192. package/docs/v7/examples/scroll-until-image.mdx +0 -82
  193. package/docs/v7/examples/windows-installer.mdx +0 -95
  194. package/examples/formatted-logging.test.mjs +0 -27
  195. package/examples/match-image.test.mjs +0 -55
  196. package/manual/exec-stream-logs.test.mjs +0 -25
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: testdriver:secrets
3
+ description: Securely manage passwords and sensitive data in your tests
4
+ ---
5
+ <!-- Generated from secrets.mdx. DO NOT EDIT. -->
6
+
7
+ Protect sensitive information like passwords, API keys, and tokens in your TestDriver tests.
8
+
9
+ ## Typing Secrets Securely
10
+
11
+ When typing sensitive information like passwords, use the `secret: true` option to prevent the value from being logged or stored:
12
+
13
+ ```javascript
14
+ import { test } from 'vitest';
15
+ import { chrome } from 'testdriverai/presets';
16
+
17
+ test('login with secure password', async (context) => {
18
+ const { testdriver } = await chrome(context, {
19
+ url: 'https://myapp.com/login'
20
+ });
21
+
22
+ await testdriver.find('email input').click();
23
+ await testdriver.type(process.env.TD_USERNAME);
24
+
25
+ await testdriver.find('password input').click();
26
+ // Password is masked in logs and recordings
27
+ await testdriver.type(process.env.TD_PASSWORD, { secret: true });
28
+
29
+ await testdriver.find('login button').click();
30
+ await testdriver.assert('dashboard is visible');
31
+ });
32
+ ```
33
+
34
+ <Note>
35
+ When `secret: true` is set, the typed text appears as `****` in all logs, recordings, and dashcam output.
36
+ </Note>
37
+
38
+ ## Storing Secrets in GitHub
39
+
40
+ Store sensitive credentials as GitHub repository secrets so they're never exposed in your code:
41
+
42
+ <Steps>
43
+ <Step title="Navigate to Repository Settings">
44
+ Go to your GitHub repository → **Settings** → **Secrets and variables** → **Actions**
45
+ </Step>
46
+ <Step title="Add Repository Secrets">
47
+ Click **New repository secret** and add your secrets:
48
+ - `TD_API_KEY` - Your TestDriver API key
49
+ - `TD_USERNAME` - Test account username
50
+ - `TD_PASSWORD` - Test account password
51
+ </Step>
52
+ <Step title="Use in GitHub Actions">
53
+ Reference secrets in your workflow file:
54
+ ```yaml .github/workflows/test.yml
55
+ - name: Run TestDriver tests
56
+ env:
57
+ TD_API_KEY: ${{ secrets.TD_API_KEY }}
58
+ TD_USERNAME: ${{ secrets.TD_USERNAME }}
59
+ TD_PASSWORD: ${{ secrets.TD_PASSWORD }}
60
+ run: vitest run
61
+ ```
62
+ </Step>
63
+ </Steps>
64
+
65
+ ## Local Development
66
+
67
+ For local development, store secrets in a `.env` file:
68
+
69
+ ```bash .env
70
+ TD_API_KEY=your_api_key_here
71
+ TD_USERNAME=testuser@example.com
72
+ TD_PASSWORD=your_secure_password
73
+ ```
74
+
75
+ <Warning>
76
+ Never commit `.env` files to version control. Add `.env` to your `.gitignore` file.
77
+ </Warning>
78
+
79
+ ## Complete Example
80
+
81
+ Here's a full login test with proper secrets handling:
82
+
83
+ ```javascript tests/login.test.js
84
+ import { test, expect } from 'vitest';
85
+ import { chrome } from 'testdriverai/presets';
86
+
87
+ test('secure login flow', async (context) => {
88
+ const { testdriver } = await chrome(context, {
89
+ url: process.env.TD_WEBSITE || 'https://staging.myapp.com'
90
+ });
91
+
92
+ // Enter username (not sensitive)
93
+ await testdriver.find('email input').click();
94
+ await testdriver.type(process.env.TD_USERNAME);
95
+
96
+ // Enter password securely
97
+ await testdriver.find('password input').click();
98
+ await testdriver.type(process.env.TD_PASSWORD, { secret: true });
99
+
100
+ // Submit login
101
+ await testdriver.find('login button').click();
102
+
103
+ // Verify successful login
104
+ const loggedIn = await testdriver.assert('user is logged in');
105
+ expect(loggedIn).toBeTruthy();
106
+ });
107
+ ```
108
+
109
+ <Card title="Secrets Best Practices" icon="shield-check">
110
+ - **Always use `secret: true`** when typing passwords, tokens, or sensitive data
111
+ - **Use environment variables** to keep secrets out of code
112
+ - **Store secrets in your CI provider** (GitHub Actions, GitLab CI, etc.)
113
+ - **Never commit secrets** to version control
114
+ - **Rotate secrets regularly** to maintain security
115
+ </Card>
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: testdriver:self-hosted
3
+ description: Our enterprise solution with unlimited test execution, assisted setup, and dedicated support.
4
+ ---
5
+ <!-- Generated from self-hosted.mdx. DO NOT EDIT. -->
6
+
7
+ Self-hosted is our enterprise solution for teams that need unlimited test execution, infrastructure control, and dedicated support. Pricing is based on **parallel test capacity** with a flat license fee — no per-second billing.
8
+
9
+ <CardGroup cols={2}>
10
+ <Card title="Unlimited Execution" icon="infinity">
11
+ Run as many tests as you want with no device-second metering. Predictable monthly costs.
12
+ </Card>
13
+ <Card title="Assisted Setup & Support" icon="headset">
14
+ Our team helps you deploy, configure, and optimize your infrastructure. Dedicated engineering support included.
15
+ </Card>
16
+ <Card title="Full Control" icon="gear">
17
+ Use your own AI keys, custom hardware, specific software, and network configurations. RDP into test machines for debugging.
18
+ </Card>
19
+ <Card title="Security & Compliance" icon="shield-check">
20
+ Keep data in your environment. Air-gapped deployment available for regulated industries.
21
+ </Card>
22
+ </CardGroup>
23
+
24
+ ## Deployment Options
25
+
26
+ Choose the level of control you need:
27
+
28
+ | Component | Standard | Air-Gapped |
29
+ |-----------|----------|------------|
30
+ | **Test Sandboxes** | Your AWS | Your infrastructure (any cloud or on-prem) |
31
+ | **Dashboard** | TestDriver hosted | Your infrastructure |
32
+ | **API** | TestDriver hosted | Your infrastructure |
33
+ | **AI Processing** | Your API keys | Your infrastructure |
34
+ | **Data Storage** | Your AWS account | 100% your infrastructure |
35
+ | **Network** | Internet access required | Fully air-gapped |
36
+ | **Cloud Providers** | AWS | AWS, Azure, GCP, on-prem |
37
+
38
+ ### Standard Deployment
39
+
40
+ Run test sandboxes on your AWS infrastructure while using TestDriver's hosted dashboard and API:
41
+
42
+ - **Quick setup** via CloudFormation — deploy in hours
43
+ - **Dashboard access** at [console.testdriver.ai](https://console.testdriver.ai)
44
+ - **Your AI keys** — control costs with your own OpenAI, Anthropic, or other provider
45
+ - **Custom AMIs** — install specific software, configure networking
46
+
47
+ <Card
48
+ title="AWS Setup Guide"
49
+ icon="aws"
50
+ href="/v7/aws-setup"
51
+ >
52
+ Step-by-step instructions for deploying TestDriver on your AWS infrastructure using CloudFormation.
53
+ </Card>
54
+
55
+ ### Air-Gapped Deployment
56
+
57
+ Deploy the entire TestDriver stack in your environment for complete isolation:
58
+
59
+ - **Full stack** — dashboard, API, and test infrastructure all in your environment
60
+ - **No external dependencies** — data never leaves your network perimeter
61
+ - **Any infrastructure** — AWS, Azure, GCP, or on-premises
62
+ - **Regulated industries** — government, defense, healthcare, finance
63
+
64
+ ## Custom VM Images
65
+
66
+ Build test environments with your applications, dependencies, and user data pre-installed. You get full access to:
67
+
68
+ - **Golden VM** — our pre-configured base image with TestDriver agent, drivers, and optimizations
69
+ - **Packer scripts** — build custom AMIs with your applications, user data, and configurations
70
+ - **Faster test startup** — skip installation steps by baking dependencies into your image
71
+ - **Consistent environments** — every test runs on an identical, reproducible machine
72
+
73
+ <AccordionGroup>
74
+ <Accordion title="What can you customize?">
75
+ - Install applications (browsers, desktop apps, dev tools)
76
+ - Configure user accounts and credentials
77
+ - Set up network proxies and certificates
78
+ - Install fonts, language packs, and locales
79
+ - Pre-seed databases or test fixtures
80
+ - Configure Windows/Linux settings
81
+ </Accordion>
82
+
83
+ <Accordion title="How it works">
84
+ 1. We provide our golden VM base image and Packer scripts
85
+ 2. You customize the scripts to install your software and configuration
86
+ 3. Run Packer to build your custom AMI
87
+ 4. Configure TestDriver to use your custom AMI for test sandboxes
88
+ 5. Tests spin up with everything pre-installed — no setup time wasted
89
+ </Accordion>
90
+ </AccordionGroup>
91
+
92
+ ## Implementation Process
93
+
94
+ <Steps>
95
+ <Step title="Discovery Call">
96
+ Discuss your requirements, security constraints, and integration needs with our team.
97
+ </Step>
98
+
99
+ <Step title="Architecture Review">
100
+ Our engineers design a deployment architecture that meets your security and compliance requirements.
101
+ </Step>
102
+
103
+ <Step title="Deployment">
104
+ We work with your team to deploy TestDriver, including assisted setup and configuration.
105
+ </Step>
106
+
107
+ <Step title="Integration">
108
+ Connect TestDriver to your CI/CD pipelines, internal tools, and workflows.
109
+ </Step>
110
+
111
+ <Step title="Training & Handoff">
112
+ Comprehensive training for your team on operating and maintaining the deployment.
113
+ </Step>
114
+ </Steps>
115
+
116
+ ## What's Included
117
+
118
+ - **Flat license fee** per parallel test slot
119
+ - **Unlimited test execution** — no device-second charges
120
+ - **Assisted setup** — our team helps you deploy and configure
121
+ - **Dedicated support** — direct access to our engineering team
122
+ - **Custom contract terms** — volume-based pricing, custom SLAs
123
+ - **Professional services** — implementation assistance and training
124
+
125
+ ## Comparison: Hosted vs Self-Hosted
126
+
127
+ | Feature | Hosted | Self-Hosted |
128
+ |---------|--------|-------------|
129
+ | **Setup Time** | Minutes | Hours (assisted) |
130
+ | **Pricing Model** | Device-seconds | Flat license fee |
131
+ | **Infrastructure** | TestDriver | Your AWS or any cloud |
132
+ | **AI API Keys** | TestDriver's | Your own |
133
+ | **Custom Software** | Limited | Full control |
134
+ | **Hardware Selection** | Standard | Your choice |
135
+ | **Debugging Access** | Replays only | Full RDP access |
136
+ | **Support** | Community/Standard | Dedicated engineering |
137
+ | **Air-Gapped Option** | No | Yes |
138
+
139
+ ## Get Started
140
+
141
+ <Card
142
+ title="Schedule a Consultation"
143
+ icon="calendar"
144
+ href="https://testdriver.ai/demo"
145
+ >
146
+ Discuss your requirements with our team and get a custom proposal for your self-hosted deployment.
147
+ </Card>
@@ -0,0 +1,257 @@
1
+ ---
2
+ name: testdriver:test-results-json
3
+ description: Per-test JSON result files with metadata, versions, and infrastructure details
4
+ ---
5
+ <!-- Generated from test-results-json.mdx. DO NOT EDIT. -->
6
+
7
+ ## Overview
8
+
9
+ TestDriver automatically writes a JSON result file for each test case after it finishes. These files contain comprehensive metadata about the test run, including SDK and runner versions, infrastructure details, interaction statistics, and links to recordings.
10
+
11
+ Result files are written to:
12
+
13
+ ```
14
+ .testdriver/results/<testFile>/<testName>.json
15
+ ```
16
+
17
+ For example, a test file `tests/login.test.mjs` with a test named `"should log in"` produces:
18
+
19
+ ```
20
+ .testdriver/results/tests/login.test.mjs/should_log_in.json
21
+ ```
22
+
23
+ <Note>
24
+ Test names are sanitized for filesystem use — special characters are replaced with underscores and names are truncated to 200 characters.
25
+ </Note>
26
+
27
+ ## Enabling
28
+
29
+ No configuration is required. The JSON files are written automatically by the TestDriver Vitest reporter plugin whenever tests run.
30
+
31
+ ## JSON Schema
32
+
33
+ Each result file is organized into logical groups:
34
+
35
+ ### `versions`
36
+
37
+ | Field | Type | Description |
38
+ |---|---|---|
39
+ | `versions.sdk` | `string \| null` | TestDriver SDK version (e.g. `"7.8.0"`) |
40
+ | `versions.vitest` | `string \| null` | Vitest version used to run the test |
41
+ | `versions.api` | `string \| null` | TestDriver API server version |
42
+ | `versions.runnerBefore` | `string \| null` | Runner version at sandbox start |
43
+ | `versions.runnerAfter` | `string \| null` | Runner version after auto-update |
44
+ | `versions.runnerWasUpdated` | `boolean` | Whether the runner was auto-updated during provisioning |
45
+
46
+ ### `test`
47
+
48
+ | Field | Type | Description |
49
+ |---|---|---|
50
+ | `test.file` | `string \| null` | Relative path to the test file |
51
+ | `test.name` | `string \| null` | Name of the test case |
52
+ | `test.suite` | `string \| null` | Name of the parent `describe` block |
53
+ | `test.passed` | `boolean` | Whether the test passed |
54
+ | `test.caseId` | `string \| null` | Database ID for this test case |
55
+ | `test.runId` | `string \| null` | Database ID for the overall test run |
56
+ | `test.error` | `string \| null` | Error message if the test failed |
57
+ | `test.errorStack` | `string \| null` | Error stack trace if the test failed |
58
+
59
+ ### `urls`
60
+
61
+ | Field | Type | Description |
62
+ |---|---|---|
63
+ | `urls.api` | `string \| null` | API root URL used for this test |
64
+ | `urls.console` | `string \| null` | TestDriver console base URL |
65
+ | `urls.vnc` | `string \| null` | VNC URL for the sandbox |
66
+ | `urls.testRun` | `string \| null` | Direct link to this test case in the console |
67
+
68
+ ### `replay`
69
+
70
+ The `replay` object contains the recording replay URL and derived embed links. The `gifUrl` and `embedUrl` are generated automatically from the replay URL.
71
+
72
+ | Field | Type | Description |
73
+ |---|---|---|
74
+ | `replay.url` | `string \| null` | Recording replay URL |
75
+ | `replay.gifUrl` | `string \| null` | Animated GIF thumbnail of the recording |
76
+ | `replay.embedUrl` | `string \| null` | Embeddable replay URL (appends `&embed=true`) |
77
+ | `replay.markdown` | `string \| null` | Ready-to-use Markdown embed with GIF linking to the replay |
78
+
79
+ The `replay.markdown` field produces a clickable GIF badge you can paste directly into PR comments, README files, or issue descriptions:
80
+
81
+ ```markdown
82
+ [![Test Recording](https://api.testdriver.ai/replay/abc123/gif?shareKey=xyz)](https://console.testdriver.ai/replay/abc123?share=xyz)
83
+ ```
84
+
85
+ ### `date`
86
+
87
+ | Field | Type | Description |
88
+ |---|---|---|
89
+ | `date` | `string` | ISO 8601 timestamp when the test finished |
90
+
91
+ ### `team`
92
+
93
+ | Field | Type | Description |
94
+ |---|---|---|
95
+ | `team.id` | `string \| null` | Team ID from the sandbox |
96
+ | `team.sessionId` | `string \| null` | SDK session ID |
97
+
98
+ ### `infrastructure`
99
+
100
+ | Field | Type | Description |
101
+ |---|---|---|
102
+ | `infrastructure.sandboxId` | `string \| null` | Sandbox instance ID |
103
+ | `infrastructure.instanceId` | `string \| null` | Instance ID |
104
+ | `infrastructure.os` | `string \| null` | Operating system of the sandbox (`"linux"` or `"windows"`) |
105
+ | `infrastructure.amiId` | `string \| null` | AWS AMI ID used for provisioning |
106
+ | `infrastructure.e2bTemplateId` | `string \| null` | E2B template ID used for provisioning |
107
+ | `infrastructure.imageVersion` | `string \| null` | Sandbox image version |
108
+
109
+ ### `realtime`
110
+
111
+ | Field | Type | Description |
112
+ |---|---|---|
113
+ | `realtime.channel` | `string \| null` | Ably channel name used for communication |
114
+ | `realtime.messageCount` | `number` | Number of messages published to the realtime channel |
115
+
116
+ ### `interactions`
117
+
118
+ | Field | Type | Description |
119
+ |---|---|---|
120
+ | `interactions.total` | `number` | Total number of interactions recorded |
121
+ | `interactions.cached` | `number` | Number of interactions served from cache |
122
+ | `interactions.byType` | `object` | Breakdown of interactions by type (e.g. `find`, `click`, `assert`) |
123
+
124
+ ## Example Output
125
+
126
+ ```json
127
+ {
128
+ "sdkVersion": "7.8.0",
129
+ "vitestVersion": "4.0.0",
130
+ "apiVersion": "1.45.0",
131
+ "runnerVersionBefore": "2.1.0",
132
+ "runnerVersionAfter": "2.1.1",
133
+ "wasUpdated": true,
134
+ "apiUrl": "https://api.testdriver.ai",
135
+ "consoleUrl": "https://console.testdriver.ai",
136
+ "testRunLink": "https://console.testdriver.ai/runs/abc123/def456",
137
+ "dashcamUrl": "https://app.dashcam.io/replay/abc123",
138
+ "vncUrl": "wss://sandbox-123.testdriver.ai/vnc",
139
+ "date": "2025-01-15T14:30:00.000Z",
140
+ "team": {
141
+ "id": "team_abc123",
142
+ "sessionId": "sess_xyz789"
143
+ },
144
+ "infrastructure": {
145
+ "sandboxId": "sandbox-123",
146
+ "instanceId": "i-abc123",
147
+ "os": "linux",
148
+ "amiId": "ami-0abc123",
149
+ "e2bTemplateId": null,
150
+ "imageVersion": "v2.1.0"
151
+ },
152
+ "realtime": {
153
+ "channel": "sandbox:sandbox-123",
154
+ "messageCount": 42
155
+ },
156
+ "interactions": {
157
+ "total": 15,
158
+ "cached": 3,
159
+ "byType": {
160
+ "find": 8,
161
+ "click": 5,
162
+ "assert": 2
163
+ }
164
+ }
165
+ }
166
+ ```
167
+
168
+ ## Using Result Files in CI
169
+
170
+ Result files are useful for extracting test metadata in CI pipelines without parsing log output.
171
+
172
+ ### GitHub Actions Example
173
+
174
+ Use `fromJSON` to parse a result file into a GitHub Actions expression you can reference in subsequent steps:
175
+
176
+ ```yaml
177
+ - name: Run tests
178
+ run: npx vitest run tests/login.test.mjs
179
+
180
+ - name: Parse result
181
+ id: result
182
+ run: |
183
+ # Read the first JSON result file
184
+ FILE=$(find .testdriver/results -name '*.json' | head -n 1)
185
+ echo "json=$(cat "$FILE")" >> "$GITHUB_OUTPUT"
186
+
187
+ - name: Comment on PR
188
+ if: fromJSON(steps.result.outputs.json).test.passed == false
189
+ uses: actions/github-script@v7
190
+ with:
191
+ script: |
192
+ const result = ${{ steps.result.outputs.json }};
193
+ await github.rest.issues.createComment({
194
+ owner: context.repo.owner,
195
+ repo: context.repo.repo,
196
+ issue_number: context.issue.number,
197
+ body: [
198
+ `❌ **${result.test.name}** failed`,
199
+ ``,
200
+ `Error: ${result.test.error}`,
201
+ ``,
202
+ result.replay.markdown,
203
+ ``,
204
+ `[View full recording](${result.urls.testRun})`
205
+ ].join('\n')
206
+ });
207
+ ```
208
+
209
+ You can also load all results into a matrix or iterate over them:
210
+
211
+ ```yaml
212
+ - name: Run tests
213
+ run: npx vitest run tests/*.test.mjs
214
+
215
+ - name: Collect results
216
+ id: results
217
+ run: |
218
+ # Merge all result files into a JSON array
219
+ echo "json=$(find .testdriver/results -name '*.json' -exec cat {} + | jq -s '.')" >> "$GITHUB_OUTPUT"
220
+
221
+ - name: Summary
222
+ run: |
223
+ echo '## Test Results' >> $GITHUB_STEP_SUMMARY
224
+ RESULTS='${{ steps.results.outputs.json }}'
225
+ echo "$RESULTS" | jq -r '.[] | "| \(.test.name) | \(if .test.passed then "✅" else "❌" end) | \(.urls.testRun) |"' >> $GITHUB_STEP_SUMMARY
226
+ ```
227
+
228
+ ### Reading Results Programmatically
229
+
230
+ ```javascript
231
+ import fs from "fs";
232
+ import path from "path";
233
+
234
+ const resultsDir = ".testdriver/results";
235
+
236
+ function readResults(dir) {
237
+ const results = [];
238
+ for (const testDir of fs.readdirSync(dir, { recursive: true })) {
239
+ const fullPath = path.join(dir, testDir);
240
+ if (fullPath.endsWith(".json") && fs.statSync(fullPath).isFile()) {
241
+ results.push(JSON.parse(fs.readFileSync(fullPath, "utf-8")));
242
+ }
243
+ }
244
+ return results;
245
+ }
246
+
247
+ const results = readResults(resultsDir);
248
+ const passed = results.filter(r => r.test.passed);
249
+ const failed = results.filter(r => !r.test.passed);
250
+
251
+ console.log(`${passed.length} passed, ${failed.length} failed`);
252
+ for (const r of failed) {
253
+ console.log(` FAIL: ${r.test.name} — ${r.test.error}`);
254
+ console.log(` Recording: ${r.urls.testRun}`);
255
+ console.log(` Embed: ${r.replay.markdown}`);
256
+ }
257
+ ```