testdriverai 7.9.33-test → 7.9.34-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.
- package/ai/skills/testdriver:ai/SKILL.md +204 -0
- package/ai/skills/testdriver:assert/SKILL.md +315 -0
- package/ai/skills/testdriver:aws-setup/SKILL.md +448 -0
- package/ai/skills/testdriver:cache/SKILL.md +221 -0
- package/ai/skills/testdriver:caching/SKILL.md +124 -0
- package/ai/skills/testdriver:captcha/SKILL.md +158 -0
- package/ai/skills/testdriver:ci-cd/SKILL.md +602 -0
- package/ai/skills/testdriver:click/SKILL.md +286 -0
- package/ai/skills/testdriver:client/SKILL.md +477 -0
- package/ai/skills/testdriver:customizing-devices/SKILL.md +319 -0
- package/ai/skills/testdriver:dashcam/SKILL.md +451 -0
- package/ai/skills/testdriver:debugging-with-screenshots/SKILL.md +415 -0
- package/ai/skills/testdriver:device-config/SKILL.md +317 -0
- package/ai/skills/testdriver:double-click/SKILL.md +102 -0
- package/ai/skills/testdriver:elements/SKILL.md +605 -0
- package/ai/skills/testdriver:enterprise/SKILL.md +7 -0
- package/ai/skills/testdriver:errors/SKILL.md +246 -0
- package/ai/skills/testdriver:events/SKILL.md +356 -0
- package/ai/skills/testdriver:exec/SKILL.md +317 -0
- package/ai/skills/testdriver:find/SKILL.md +860 -0
- package/ai/skills/testdriver:focus-application/SKILL.md +293 -0
- package/ai/skills/testdriver:generating-tests/SKILL.md +36 -0
- package/ai/skills/testdriver:hosted/SKILL.md +156 -0
- package/ai/skills/testdriver:hover/SKILL.md +278 -0
- package/ai/skills/testdriver:locating-elements/SKILL.md +71 -0
- package/ai/skills/testdriver:making-assertions/SKILL.md +32 -0
- package/ai/skills/testdriver:mcp/SKILL.md +7 -0
- package/ai/skills/testdriver:mouse-down/SKILL.md +161 -0
- package/ai/skills/testdriver:mouse-up/SKILL.md +164 -0
- package/ai/skills/testdriver:parse/SKILL.md +236 -0
- package/ai/skills/testdriver:performing-actions/SKILL.md +53 -0
- package/ai/skills/testdriver:press-keys/SKILL.md +348 -0
- package/ai/skills/testdriver:provision/SKILL.md +331 -0
- package/ai/skills/testdriver:quickstart/SKILL.md +172 -0
- package/ai/skills/testdriver:redraw/SKILL.md +214 -0
- package/ai/skills/testdriver:reusable-code/SKILL.md +249 -0
- package/ai/skills/testdriver:right-click/SKILL.md +123 -0
- package/ai/skills/testdriver:running-tests/SKILL.md +185 -0
- package/ai/skills/testdriver:screenshot/SKILL.md +248 -0
- package/ai/skills/testdriver:screenshots/SKILL.md +184 -0
- package/ai/skills/testdriver:scroll/SKILL.md +205 -0
- package/ai/skills/testdriver:secrets/SKILL.md +115 -0
- package/ai/skills/testdriver:self-hosted/SKILL.md +147 -0
- package/ai/skills/testdriver:test-results-json/SKILL.md +257 -0
- package/ai/skills/testdriver:testdriver/SKILL.md +624 -0
- package/ai/skills/testdriver:type/SKILL.md +357 -0
- package/ai/skills/testdriver:variables/SKILL.md +111 -0
- package/ai/skills/testdriver:wait/SKILL.md +50 -0
- package/ai/skills/testdriver:waiting-for-elements/SKILL.md +90 -0
- package/ai/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
- package/docs/_data/examples-manifest.json +42 -42
- package/docs/v7/debugging-with-screenshots.mdx +14 -0
- package/docs/v7/examples/ai.mdx +1 -1
- package/docs/v7/examples/assert.mdx +1 -1
- package/docs/v7/examples/chrome-extension.mdx +2 -2
- package/docs/v7/examples/element-not-found.mdx +1 -1
- package/docs/v7/examples/exec-output.mdx +1 -1
- package/docs/v7/examples/exec-pwsh.mdx +1 -1
- package/docs/v7/examples/findall-coffee-icons.mdx +1 -1
- package/docs/v7/examples/focus-window.mdx +1 -1
- package/docs/v7/examples/hover-image.mdx +1 -1
- package/docs/v7/examples/hover-text-with-description.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/parse.mdx +1 -1
- package/docs/v7/examples/press-keys.mdx +1 -1
- package/docs/v7/examples/prompt.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.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 +33 -0
- package/package.json +1 -1
- package/setup/aws/spawn-runner.sh +24 -3
|
@@ -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
|
+
[](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
|
+
```
|