testdriverai 7.2.3 → 7.2.10
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/.github/workflows/publish.yaml +15 -7
- package/.github/workflows/testdriver.yml +163 -0
- package/.testdriver/last-sandbox +7 -0
- package/agent/events.js +1 -0
- package/agent/index.js +99 -163
- package/agent/lib/sandbox.js +11 -1
- package/agents.md +393 -0
- package/bin/testdriverai.js +8 -0
- package/debug/01-table-initial.png +0 -0
- package/debug/02-after-ai-explore.png +0 -0
- package/debug/02-after-scroll.png +0 -0
- package/debugger/index.html +37 -0
- package/docs/docs.json +93 -125
- package/docs/v7/_drafts/architecture.mdx +1 -26
- package/docs/v7/_drafts/caching.mdx +2 -2
- package/docs/v7/{getting-started → _drafts}/installation.mdx +0 -66
- package/docs/v7/{features/coverage.mdx → _drafts/powerful.mdx} +1 -90
- package/docs/v7/_drafts/quick-start-test-recording.mdx +0 -1
- package/docs/v7/{features → _drafts}/scalable.mdx +126 -4
- package/docs/v7/_drafts/screenshot.mdx +155 -0
- package/docs/v7/_drafts/test-recording.mdx +0 -6
- package/docs/v7/_drafts/writing-tests.mdx +25 -0
- package/docs/v7/{api/act.mdx → ai.mdx} +28 -27
- package/docs/v7/{api/assert.mdx → assert.mdx} +3 -3
- package/docs/v7/aws-setup.mdx +338 -0
- package/docs/v7/caching.mdx +128 -0
- package/docs/v7/ci-cd.mdx +605 -0
- package/docs/v7/{api/click.mdx → click.mdx} +4 -4
- package/docs/v7/cloud.mdx +120 -0
- package/docs/v7/customizing-devices.mdx +129 -0
- package/docs/v7/{api/doubleClick.mdx → double-click.mdx} +5 -5
- package/docs/v7/enterprise.mdx +135 -0
- package/docs/v7/examples.mdx +5 -0
- package/docs/v7/{api/exec.mdx → exec.mdx} +3 -3
- package/docs/v7/{api/find.mdx → find.mdx} +17 -21
- package/docs/v7/{api/focusApplication.mdx → focus-application.mdx} +3 -3
- package/docs/v7/generating-tests.mdx +32 -0
- package/docs/v7/{api/hover.mdx → hover.mdx} +3 -3
- package/docs/v7/locating-elements.mdx +71 -0
- package/docs/v7/making-assertions.mdx +32 -0
- package/docs/v7/{api/mouseDown.mdx → mouse-down.mdx} +7 -7
- package/docs/v7/{api/mouseUp.mdx → mouse-up.mdx} +8 -8
- package/docs/v7/performing-actions.mdx +51 -0
- package/docs/v7/{api/pressKeys.mdx → press-keys.mdx} +3 -3
- package/docs/v7/quickstart.mdx +162 -0
- package/docs/v7/reusable-code.mdx +240 -0
- package/docs/v7/{api/rightClick.mdx → right-click.mdx} +5 -5
- package/docs/v7/running-tests.mdx +181 -0
- package/docs/v7/{api/scroll.mdx → scroll.mdx} +3 -3
- package/docs/v7/secrets.mdx +115 -0
- package/docs/v7/self-hosted.mdx +66 -0
- package/docs/v7/{api/type.mdx → type.mdx} +3 -3
- package/docs/v7/variables.mdx +111 -0
- package/docs/v7/waiting-for-elements.mdx +66 -0
- package/docs/v7/what-is-testdriver.mdx +54 -0
- package/interfaces/cli/commands/init.js +33 -19
- package/interfaces/cli/lib/base.js +24 -0
- package/interfaces/cli.js +8 -1
- package/interfaces/logger.js +8 -3
- package/interfaces/vitest-plugin.mjs +16 -71
- package/lib/sentry.js +343 -0
- package/lib/vitest/hooks.mjs +81 -81
- package/package.json +4 -3
- package/sdk-log-formatter.js +41 -0
- package/sdk.d.ts +22 -9
- package/sdk.js +344 -100
- package/test/manual/reconnect-provision.test.mjs +49 -0
- package/test/manual/reconnect-signin.test.mjs +41 -0
- package/test/testdriver/act.test.mjs +30 -0
- package/test/testdriver/ai.test.mjs +30 -0
- package/test/testdriver/assert.test.mjs +1 -1
- package/test/testdriver/hover-text.test.mjs +1 -1
- package/test/testdriver/setup/testHelpers.mjs +8 -119
- package/test/testdriver/windows-installer.test.mjs +61 -0
- package/tests/example.test.js +33 -0
- package/tests/login.js +28 -0
- package/tests/table-sort-enrollments.test.mjs +72 -0
- package/tests/table-sort-experiment.test.mjs +42 -0
- package/tests/table-sort-setup.test.mjs +59 -0
- package/vitest.config.mjs +3 -1
- package/agent/lib/cache.js +0 -142
- package/docs/v7/api/assertions.mdx +0 -403
- package/docs/v7/features/ai-native.mdx +0 -413
- package/docs/v7/features/application-logs.mdx +0 -353
- package/docs/v7/features/browser-logs.mdx +0 -414
- package/docs/v7/features/cache-management.mdx +0 -402
- package/docs/v7/features/continuous-testing.mdx +0 -346
- package/docs/v7/features/data-driven-testing.mdx +0 -441
- package/docs/v7/features/easy-to-write.mdx +0 -280
- package/docs/v7/features/enterprise.mdx +0 -656
- package/docs/v7/features/fast.mdx +0 -406
- package/docs/v7/features/managed-sandboxes.mdx +0 -384
- package/docs/v7/features/network-monitoring.mdx +0 -568
- package/docs/v7/features/parallel-execution.mdx +0 -381
- package/docs/v7/features/powerful.mdx +0 -531
- package/docs/v7/features/sandbox-customization.mdx +0 -229
- package/docs/v7/features/stable.mdx +0 -473
- package/docs/v7/features/system-performance.mdx +0 -616
- package/docs/v7/features/test-analytics.mdx +0 -373
- package/docs/v7/features/test-cases.mdx +0 -393
- package/docs/v7/features/test-replays.mdx +0 -408
- package/docs/v7/features/test-reports.mdx +0 -308
- package/docs/v7/getting-started/debugging-tests.mdx +0 -382
- package/docs/v7/getting-started/quickstart.mdx +0 -90
- package/docs/v7/getting-started/running-tests.mdx +0 -173
- package/docs/v7/getting-started/setting-up-in-ci.mdx +0 -612
- package/docs/v7/getting-started/writing-tests.mdx +0 -534
- package/docs/v7/overview/what-is-testdriver.mdx +0 -386
- package/docs/v7/presets/chrome-extension.mdx +0 -248
- package/docs/v7/presets/chrome.mdx +0 -300
- package/docs/v7/presets/electron.mdx +0 -460
- package/docs/v7/presets/vscode.mdx +0 -417
- package/docs/v7/presets/webapp.mdx +0 -393
- /package/docs/v7/{commands → _drafts/commands}/assert.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/exec.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/focus-application.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/hover-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/hover-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/if.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/match-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/press-keys.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/remember.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/run.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll-until-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll-until-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/type.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait-for-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait-for-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait.mdx +0 -0
- /package/docs/v7/{getting-started → _drafts}/configuration.mdx +0 -0
- /package/docs/v7/{features → _drafts}/observable.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/linux.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/macos.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/windows.mdx +0 -0
- /package/docs/v7/{playwright.mdx → _drafts/playwright.mdx} +0 -0
- /package/docs/v7/{overview → _drafts}/readme.mdx +0 -0
- /package/docs/v7/{features → _drafts}/reports.mdx +0 -0
- /package/docs/v7/{api/client.mdx → client.mdx} +0 -0
- /package/docs/v7/{api/dashcam.mdx → dashcam.mdx} +0 -0
- /package/docs/v7/{api/elements.mdx → elements.mdx} +0 -0
- /package/docs/v7/{api/sandbox.mdx → sandbox.mdx} +0 -0
package/docs/docs.json
CHANGED
|
@@ -187,132 +187,100 @@
|
|
|
187
187
|
}
|
|
188
188
|
]
|
|
189
189
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
"/v7/api/act",
|
|
283
|
-
"/v7/api/assert",
|
|
284
|
-
"/v7/api/assertions",
|
|
285
|
-
"/v7/api/click",
|
|
286
|
-
"/v7/api/doubleClick",
|
|
287
|
-
"/v7/api/exec",
|
|
288
|
-
"/v7/api/find",
|
|
289
|
-
"/v7/api/focusApplication",
|
|
290
|
-
"/v7/api/hover",
|
|
291
|
-
"/v7/api/mouseDown",
|
|
292
|
-
"/v7/api/mouseUp",
|
|
293
|
-
"/v7/api/pressKeys",
|
|
294
|
-
"/v7/api/rightClick",
|
|
295
|
-
"/v7/api/type",
|
|
296
|
-
"/v7/api/scroll"
|
|
297
|
-
]
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
"group": "Client SDK",
|
|
301
|
-
"icon": "code",
|
|
302
|
-
"pages": [
|
|
303
|
-
"/v7/api/client",
|
|
304
|
-
"/v7/api/elements",
|
|
305
|
-
"/v7/api/sandbox",
|
|
306
|
-
"/v7/api/dashcam"
|
|
307
|
-
]
|
|
308
|
-
}
|
|
309
|
-
]
|
|
310
|
-
}
|
|
311
|
-
]
|
|
312
|
-
}
|
|
313
|
-
|
|
190
|
+
{
|
|
191
|
+
"version": "v7",
|
|
192
|
+
"groups": [
|
|
193
|
+
{
|
|
194
|
+
"group": "Overview",
|
|
195
|
+
"pages": [
|
|
196
|
+
"/v7/what-is-testdriver",
|
|
197
|
+
"/v7/quickstart",
|
|
198
|
+
"/v7/examples",
|
|
199
|
+
{
|
|
200
|
+
"group": "Plans & Pricing",
|
|
201
|
+
"icon": "server",
|
|
202
|
+
"pages": [
|
|
203
|
+
"/v7/cloud",
|
|
204
|
+
{
|
|
205
|
+
"group": "Self-Hosted",
|
|
206
|
+
"icon": "server",
|
|
207
|
+
"pages": [
|
|
208
|
+
"/v7/self-hosted",
|
|
209
|
+
"/v7/aws-setup"
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
"/v7/enterprise"
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"group": "Creating Tests",
|
|
219
|
+
"pages": [
|
|
220
|
+
"/v7/generating-tests",
|
|
221
|
+
"/v7/locating-elements",
|
|
222
|
+
"/v7/waiting-for-elements",
|
|
223
|
+
"/v7/performing-actions",
|
|
224
|
+
"/v7/making-assertions"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"group": "Running Tests",
|
|
229
|
+
"pages": [
|
|
230
|
+
"/v7/running-tests",
|
|
231
|
+
"/v7/caching",
|
|
232
|
+
"/v7/ci-cd"
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"group": "Scaling",
|
|
237
|
+
"pages": [
|
|
238
|
+
"/v7/variables",
|
|
239
|
+
"/v7/secrets",
|
|
240
|
+
"/v7/reusable-code",
|
|
241
|
+
"/v7/customizing-devices"
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"group": "Reference",
|
|
246
|
+
"icon": "book",
|
|
247
|
+
"pages": [
|
|
248
|
+
{
|
|
249
|
+
"group": "Actions",
|
|
250
|
+
"icon": "bolt",
|
|
251
|
+
"pages": [
|
|
252
|
+
"/v7/ai",
|
|
253
|
+
"/v7/assert",
|
|
254
|
+
"/v7/click",
|
|
255
|
+
"/v7/double-click",
|
|
256
|
+
"/v7/exec",
|
|
257
|
+
"/v7/find",
|
|
258
|
+
"/v7/focus-application",
|
|
259
|
+
"/v7/hover",
|
|
260
|
+
"/v7/mouse-down",
|
|
261
|
+
"/v7/mouse-up",
|
|
262
|
+
"/v7/press-keys",
|
|
263
|
+
"/v7/right-click",
|
|
264
|
+
"/v7/type",
|
|
265
|
+
"/v7/scroll"
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"group": "Client SDK",
|
|
270
|
+
"icon": "code",
|
|
271
|
+
"pages": [
|
|
272
|
+
"/v7/client",
|
|
273
|
+
"/v7/elements",
|
|
274
|
+
"/v7/sandbox",
|
|
275
|
+
"/v7/dashcam"
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
}
|
|
314
282
|
]
|
|
315
|
-
|
|
283
|
+
},
|
|
316
284
|
"logo": {
|
|
317
285
|
"light": "/images/template/light.png",
|
|
318
286
|
"dark": "/images/template/dark.png",
|
|
@@ -44,7 +44,6 @@ This system provides comprehensive test execution tracking, linking test runs wi
|
|
|
44
44
|
│ │ │ │
|
|
45
45
|
│ │ • TdTestRun │ │
|
|
46
46
|
│ │ • TdTestCase │ │
|
|
47
|
-
│ │ • TdSandbox │ │
|
|
48
47
|
│ │ • Replay │ │
|
|
49
48
|
│ └────────────────┘ │
|
|
50
49
|
│ │
|
|
@@ -95,7 +94,6 @@ Represents a complete test suite execution (e.g., `npx vitest run`).
|
|
|
95
94
|
|
|
96
95
|
**Relationships:**
|
|
97
96
|
- `team`: Owner team
|
|
98
|
-
- `sandbox`: TdSandbox where tests ran
|
|
99
97
|
- `testCases`: Collection of TdTestCase
|
|
100
98
|
- `replays`: Associated Replay records
|
|
101
99
|
|
|
@@ -114,36 +112,13 @@ Represents an individual test within a test run.
|
|
|
114
112
|
|
|
115
113
|
**Relationships:**
|
|
116
114
|
- `testRun`: Parent TdTestRun
|
|
117
|
-
- `replay`: Associated Replay
|
|
118
|
-
|
|
119
|
-
### TdSandbox
|
|
120
|
-
Represents a spawned VM/sandbox instance.
|
|
121
|
-
|
|
122
|
-
**Key Fields:**
|
|
123
|
-
- `sandboxId`: Unique identifier
|
|
124
|
-
- `platform`: windows | mac | linux
|
|
125
|
-
- `status`: provisioning | ready | running | stopped | terminated
|
|
126
|
-
- `instanceId`, `instanceType`: AWS EC2 details
|
|
127
|
-
- `ipAddress`, `vncUrl`, `wsUrl`: Connection details
|
|
128
|
-
- `spawnTime`, `readyTime`, `terminateTime`: Lifecycle timestamps
|
|
129
|
-
- `dashcamAuth`: Whether dashcam was authenticated
|
|
130
|
-
- `dashcamProjectId`: Dashcam project for replays
|
|
131
|
-
|
|
132
|
-
**Relationships:**
|
|
133
|
-
- `team`: Owner team
|
|
134
|
-
- `user`: User who spawned it
|
|
135
|
-
- `testRuns`: Tests that ran on this sandbox
|
|
136
|
-
- `replays`: Dashcam recordings from this sandbox
|
|
137
|
-
|
|
138
|
-
**Note:** Sandbox creation/updates happen via WebSocket (not REST API) as part of the sandbox provisioning flow.
|
|
139
|
-
|
|
115
|
+
- `replay`: Associated Replay recor
|
|
140
116
|
### Replay (Extended)
|
|
141
117
|
Existing model extended with test run associations.
|
|
142
118
|
|
|
143
119
|
**New Fields:**
|
|
144
120
|
- `tdTestRun`: Associated test run
|
|
145
121
|
- `tdTestCase`: Associated test case
|
|
146
|
-
- `tdSandbox`: Sandbox where recorded
|
|
147
122
|
|
|
148
123
|
## API Endpoints
|
|
149
124
|
|
|
@@ -418,69 +418,3 @@ npx vitest run verify.test.js
|
|
|
418
418
|
For on-premise deployment, see [self-hosting guide](/v7/guides/self-hosting).
|
|
419
419
|
</Accordion>
|
|
420
420
|
</AccordionGroup>
|
|
421
|
-
|
|
422
|
-
## Next Steps
|
|
423
|
-
|
|
424
|
-
Now that you have TestDriver installed:
|
|
425
|
-
|
|
426
|
-
<CardGroup cols={2}>
|
|
427
|
-
<Card
|
|
428
|
-
title="Write Your First Test"
|
|
429
|
-
icon="pencil"
|
|
430
|
-
href="/v7/getting-started/writing-tests"
|
|
431
|
-
>
|
|
432
|
-
Learn how to write effective TestDriver tests
|
|
433
|
-
</Card>
|
|
434
|
-
|
|
435
|
-
<Card
|
|
436
|
-
title="Generate Tests with AI"
|
|
437
|
-
icon="wand-magic-sparkles"
|
|
438
|
-
href="/v7/getting-started/generating-tests"
|
|
439
|
-
>
|
|
440
|
-
Use Claude to generate tests automatically
|
|
441
|
-
</Card>
|
|
442
|
-
|
|
443
|
-
<Card
|
|
444
|
-
title="View Examples"
|
|
445
|
-
icon="code"
|
|
446
|
-
href="/v7/presets/chrome"
|
|
447
|
-
>
|
|
448
|
-
See TestDriver in action with examples
|
|
449
|
-
</Card>
|
|
450
|
-
|
|
451
|
-
<Card
|
|
452
|
-
title="API Reference"
|
|
453
|
-
icon="book"
|
|
454
|
-
href="/v7/api/client"
|
|
455
|
-
>
|
|
456
|
-
Explore all available methods
|
|
457
|
-
</Card>
|
|
458
|
-
</CardGroup>
|
|
459
|
-
|
|
460
|
-
## Getting Help
|
|
461
|
-
|
|
462
|
-
<CardGroup cols={3}>
|
|
463
|
-
<Card
|
|
464
|
-
title="Discord"
|
|
465
|
-
icon="discord"
|
|
466
|
-
href="https://discord.com/invite/cWDFW8DzPm"
|
|
467
|
-
>
|
|
468
|
-
Join our community
|
|
469
|
-
</Card>
|
|
470
|
-
|
|
471
|
-
<Card
|
|
472
|
-
title="GitHub"
|
|
473
|
-
icon="github"
|
|
474
|
-
href="https://github.com/testdriverai"
|
|
475
|
-
>
|
|
476
|
-
Report issues
|
|
477
|
-
</Card>
|
|
478
|
-
|
|
479
|
-
<Card
|
|
480
|
-
title="Documentation"
|
|
481
|
-
icon="book"
|
|
482
|
-
href="/v7/guides/troubleshooting"
|
|
483
|
-
>
|
|
484
|
-
Troubleshooting guide
|
|
485
|
-
</Card>
|
|
486
|
-
</CardGroup>
|
|
@@ -1,100 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Common Patterns"
|
|
3
3
|
description: "Test everything from desktop apps to chatbots to video content"
|
|
4
4
|
icon: "radar"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
TestDriver provides unmatched testing coverage across platforms, applications, and content types. From desktop applications to AI chatbots, from PDFs to videos, TestDriver can test it all.
|
|
8
8
|
|
|
9
|
-
## Application Types
|
|
10
|
-
|
|
11
|
-
### Desktop Applications
|
|
12
|
-
|
|
13
|
-
Test native desktop applications on Windows, macOS, and Linux with the same simple API:
|
|
14
|
-
|
|
15
|
-
```javascript
|
|
16
|
-
import { test } from 'vitest';
|
|
17
|
-
import { desktop } from 'testdriverai/presets';
|
|
18
|
-
|
|
19
|
-
test('desktop app with file operations', async (context) => {
|
|
20
|
-
const { testdriver } = await desktop(context, {
|
|
21
|
-
appPath: '/Applications/MyApp.app',
|
|
22
|
-
os: 'mac'
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
await testdriver.find('File menu').click();
|
|
26
|
-
await testdriver.find('Open').click();
|
|
27
|
-
await testdriver.find('Documents folder').doubleClick();
|
|
28
|
-
await testdriver.find('test.txt').click();
|
|
29
|
-
await testdriver.find('Open button').click();
|
|
30
|
-
await testdriver.assert('test.txt is displayed in the editor');
|
|
31
|
-
});
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
<Card title="Desktop Preset" icon="desktop" href="/v7/presets/desktop">
|
|
35
|
-
Complete guide to testing desktop applications
|
|
36
|
-
</Card>
|
|
37
|
-
|
|
38
|
-
### VS Code Extensions
|
|
39
|
-
|
|
40
|
-
Test IDE extensions with full access to the VS Code environment:
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
import { test } from 'vitest';
|
|
44
|
-
import { vscode } from 'testdriverai/presets';
|
|
45
|
-
|
|
46
|
-
test('vscode extension with settings', async (context) => {
|
|
47
|
-
const { testdriver } = await vscode(context, {
|
|
48
|
-
workspace: '/tmp/test-project',
|
|
49
|
-
extensions: ['your-extension-id']
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// Open settings
|
|
53
|
-
await testdriver.pressKeys(['cmd', ',']);
|
|
54
|
-
await testdriver.find('search settings input').type('your.extension.setting');
|
|
55
|
-
await testdriver.find('Enable feature checkbox').click();
|
|
56
|
-
|
|
57
|
-
// Verify extension behavior
|
|
58
|
-
await testdriver.pressKeys(['cmd', 'shift', 'p']);
|
|
59
|
-
await testdriver.type('Your Extension Command');
|
|
60
|
-
await testdriver.pressKeys(['enter']);
|
|
61
|
-
await testdriver.assert('Extension panel is visible');
|
|
62
|
-
});
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
<Card title="VS Code Preset" icon="code" href="/v7/presets/vscode">
|
|
66
|
-
Complete guide to testing VS Code extensions
|
|
67
|
-
</Card>
|
|
68
|
-
|
|
69
|
-
### Chrome Extensions
|
|
70
|
-
|
|
71
|
-
Test browser extensions in their natural environment with access to popups, content scripts, and background pages:
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
import { test } from 'vitest';
|
|
75
|
-
import { chromeExtension } from 'testdriverai/presets';
|
|
76
|
-
|
|
77
|
-
test('chrome extension functionality', async (context) => {
|
|
78
|
-
const { testdriver } = await chromeExtension(context, {
|
|
79
|
-
extensionPath: './my-extension',
|
|
80
|
-
url: 'https://example.com'
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// Test extension popup
|
|
84
|
-
await testdriver.find('extension icon').click();
|
|
85
|
-
await testdriver.find('Enable feature toggle').click();
|
|
86
|
-
await testdriver.assert('Feature enabled message appears');
|
|
87
|
-
|
|
88
|
-
// Test content script injection
|
|
89
|
-
await testdriver.assert('Extension content is visible on page');
|
|
90
|
-
});
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
<Card title="Chrome Extension Preset" icon="puzzle-piece" href="/v7/presets/chrome-extension">
|
|
94
|
-
Complete guide to testing Chrome extensions
|
|
95
|
-
</Card>
|
|
96
|
-
|
|
97
|
-
## Advanced Use Cases
|
|
98
9
|
|
|
99
10
|
### AI Chatbots
|
|
100
11
|
|
|
@@ -185,7 +185,6 @@ await client.completeTestRun({
|
|
|
185
185
|
**API (Backend)**
|
|
186
186
|
- `api/models/TdTestRun.js` - Test run model
|
|
187
187
|
- `api/models/TdTestCase.js` - Test case model
|
|
188
|
-
- `api/models/TdSandbox.js` - Sandbox tracking model
|
|
189
188
|
- `api/controllers/testdriver/testdriver-test-run-create.js` - Create test run endpoint
|
|
190
189
|
- `api/controllers/testdriver/testdriver-test-run-complete.js` - Complete test run endpoint
|
|
191
190
|
- `api/controllers/testdriver/testdriver-test-case-create.js` - Record test case endpoint
|
|
@@ -344,13 +344,35 @@ TestDriver integrates seamlessly with all major CI/CD platforms:
|
|
|
344
344
|
|
|
345
345
|
## JUnit Reports
|
|
346
346
|
|
|
347
|
-
Generate JUnit XML reports for test result aggregation
|
|
347
|
+
Generate JUnit XML reports for test result aggregation and CI/CD integration.
|
|
348
|
+
|
|
349
|
+
### Basic Setup
|
|
350
|
+
|
|
351
|
+
Configure Vitest to output JUnit reports by adding a reporter to your config:
|
|
352
|
+
|
|
353
|
+
```javascript vitest.config.mjs
|
|
354
|
+
import { defineConfig } from 'vitest/config';
|
|
355
|
+
|
|
356
|
+
export default defineConfig({
|
|
357
|
+
test: {
|
|
358
|
+
testTimeout: 120000,
|
|
359
|
+
hookTimeout: 120000,
|
|
360
|
+
reporters: ['default', 'junit'],
|
|
361
|
+
outputFile: {
|
|
362
|
+
junit: 'test-report.junit.xml'
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Or run from the command line:
|
|
348
369
|
|
|
349
370
|
```bash
|
|
350
|
-
# Generate JUnit report
|
|
351
371
|
npx vitest run --reporter=junit --outputFile=test-results.xml
|
|
352
372
|
```
|
|
353
373
|
|
|
374
|
+
This generates a standard JUnit XML report:
|
|
375
|
+
|
|
354
376
|
```xml test-results.xml
|
|
355
377
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
356
378
|
<testsuites name="vitest tests" tests="12" failures="0" errors="0" time="125.3">
|
|
@@ -359,12 +381,112 @@ npx vitest run --reporter=junit --outputFile=test-results.xml
|
|
|
359
381
|
<testcase name="invalid credentials show error" time="9.8" />
|
|
360
382
|
<testcase name="password reset works" time="9.0" />
|
|
361
383
|
</testsuite>
|
|
362
|
-
<!-- More test suites -->
|
|
363
384
|
</testsuites>
|
|
364
385
|
```
|
|
365
386
|
|
|
387
|
+
### GitHub Actions PR Comments
|
|
388
|
+
|
|
389
|
+
Use JUnit reports to automatically post test results as comments on pull requests. This provides immediate visibility into test failures without leaving GitHub.
|
|
390
|
+
|
|
391
|
+
```yaml .github/workflows/test.yml
|
|
392
|
+
name: E2E Tests
|
|
393
|
+
|
|
394
|
+
on:
|
|
395
|
+
pull_request:
|
|
396
|
+
branches: [main]
|
|
397
|
+
|
|
398
|
+
permissions:
|
|
399
|
+
contents: read
|
|
400
|
+
pull-requests: write
|
|
401
|
+
checks: write
|
|
402
|
+
|
|
403
|
+
jobs:
|
|
404
|
+
test:
|
|
405
|
+
runs-on: ubuntu-latest
|
|
406
|
+
|
|
407
|
+
steps:
|
|
408
|
+
- uses: actions/checkout@v4
|
|
409
|
+
|
|
410
|
+
- name: Setup Node.js
|
|
411
|
+
uses: actions/setup-node@v4
|
|
412
|
+
with:
|
|
413
|
+
node-version: '20'
|
|
414
|
+
cache: 'npm'
|
|
415
|
+
|
|
416
|
+
- name: Install dependencies
|
|
417
|
+
run: npm ci
|
|
418
|
+
|
|
419
|
+
- name: Run tests
|
|
420
|
+
run: npx vitest run
|
|
421
|
+
env:
|
|
422
|
+
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
423
|
+
|
|
424
|
+
- name: Publish Test Results
|
|
425
|
+
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
426
|
+
if: always()
|
|
427
|
+
with:
|
|
428
|
+
files: test-report.junit.xml
|
|
429
|
+
comment_mode: always
|
|
430
|
+
check_name: Test Results
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
<Note>
|
|
434
|
+
The `if: always()` ensures test results are published even when tests fail, so you always see what went wrong.
|
|
435
|
+
</Note>
|
|
436
|
+
|
|
437
|
+
The [publish-unit-test-result-action](https://github.com/EnricoMi/publish-unit-test-result-action) creates:
|
|
438
|
+
|
|
439
|
+
- **PR comments** with a summary table of passed/failed tests
|
|
440
|
+
- **Check runs** visible in the GitHub PR checks tab
|
|
441
|
+
- **Annotations** highlighting failed tests in the diff view
|
|
442
|
+
|
|
443
|
+
### Multi-Platform Testing with JUnit
|
|
444
|
+
|
|
445
|
+
When testing across multiple platforms, use separate check names to distinguish results:
|
|
446
|
+
|
|
447
|
+
```yaml .github/workflows/test.yml
|
|
448
|
+
jobs:
|
|
449
|
+
test-linux:
|
|
450
|
+
runs-on: ubuntu-latest
|
|
451
|
+
steps:
|
|
452
|
+
# ... setup steps ...
|
|
453
|
+
|
|
454
|
+
- name: Run Linux tests
|
|
455
|
+
run: npx vitest run
|
|
456
|
+
env:
|
|
457
|
+
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
458
|
+
TD_OS: linux
|
|
459
|
+
|
|
460
|
+
- name: Publish Test Results
|
|
461
|
+
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
462
|
+
if: always()
|
|
463
|
+
with:
|
|
464
|
+
files: test-report.junit.xml
|
|
465
|
+
comment_mode: always
|
|
466
|
+
check_name: Test Results (Linux)
|
|
467
|
+
|
|
468
|
+
test-windows:
|
|
469
|
+
runs-on: ubuntu-latest
|
|
470
|
+
steps:
|
|
471
|
+
# ... setup steps ...
|
|
472
|
+
|
|
473
|
+
- name: Run Windows tests
|
|
474
|
+
run: npx vitest run
|
|
475
|
+
env:
|
|
476
|
+
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
477
|
+
TD_OS: windows
|
|
478
|
+
|
|
479
|
+
- name: Publish Test Results
|
|
480
|
+
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
481
|
+
if: always()
|
|
482
|
+
with:
|
|
483
|
+
files: test-report.junit.xml
|
|
484
|
+
comment_mode: always
|
|
485
|
+
check_name: Test Results (Windows)
|
|
486
|
+
```
|
|
487
|
+
|
|
366
488
|
<Check>
|
|
367
|
-
JUnit reports integrate with Jenkins, Azure DevOps, TeamCity, and other CI platforms for test result visualization.
|
|
489
|
+
JUnit reports integrate with Jenkins, Azure DevOps, TeamCity, GitLab, and other CI platforms for test result visualization.
|
|
368
490
|
</Check>
|
|
369
491
|
|
|
370
492
|
## Familiar Test Syntax
|