testdriverai 7.2.9 → 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.
Files changed (124) hide show
  1. package/.github/workflows/testdriver.yml +127 -0
  2. package/.testdriver/last-sandbox +7 -0
  3. package/agent/events.js +1 -0
  4. package/agent/index.js +71 -54
  5. package/agent/lib/sandbox.js +11 -1
  6. package/agents.md +393 -0
  7. package/debug/01-table-initial.png +0 -0
  8. package/debug/02-after-ai-explore.png +0 -0
  9. package/debug/02-after-scroll.png +0 -0
  10. package/docs/docs.json +93 -125
  11. package/docs/v7/_drafts/caching.mdx +2 -2
  12. package/docs/v7/{getting-started → _drafts}/installation.mdx +0 -66
  13. package/docs/v7/{features/coverage.mdx → _drafts/powerful.mdx} +1 -90
  14. package/docs/v7/{features → _drafts}/scalable.mdx +126 -4
  15. package/docs/v7/_drafts/screenshot.mdx +155 -0
  16. package/docs/v7/_drafts/writing-tests.mdx +25 -0
  17. package/docs/v7/{api/act.mdx → ai.mdx} +27 -27
  18. package/docs/v7/{api/assert.mdx → assert.mdx} +3 -3
  19. package/docs/v7/aws-setup.mdx +338 -0
  20. package/docs/v7/caching.mdx +128 -0
  21. package/docs/v7/ci-cd.mdx +605 -0
  22. package/docs/v7/{api/click.mdx → click.mdx} +4 -4
  23. package/docs/v7/cloud.mdx +120 -0
  24. package/docs/v7/customizing-devices.mdx +129 -0
  25. package/docs/v7/{api/doubleClick.mdx → double-click.mdx} +5 -5
  26. package/docs/v7/enterprise.mdx +135 -0
  27. package/docs/v7/examples.mdx +5 -0
  28. package/docs/v7/{api/exec.mdx → exec.mdx} +3 -3
  29. package/docs/v7/{api/find.mdx → find.mdx} +17 -21
  30. package/docs/v7/{api/focusApplication.mdx → focus-application.mdx} +3 -3
  31. package/docs/v7/generating-tests.mdx +32 -0
  32. package/docs/v7/{api/hover.mdx → hover.mdx} +3 -3
  33. package/docs/v7/locating-elements.mdx +71 -0
  34. package/docs/v7/making-assertions.mdx +32 -0
  35. package/docs/v7/{api/mouseDown.mdx → mouse-down.mdx} +7 -7
  36. package/docs/v7/{api/mouseUp.mdx → mouse-up.mdx} +8 -8
  37. package/docs/v7/performing-actions.mdx +51 -0
  38. package/docs/v7/{api/pressKeys.mdx → press-keys.mdx} +3 -3
  39. package/docs/v7/quickstart.mdx +162 -0
  40. package/docs/v7/reusable-code.mdx +240 -0
  41. package/docs/v7/{api/rightClick.mdx → right-click.mdx} +5 -5
  42. package/docs/v7/running-tests.mdx +181 -0
  43. package/docs/v7/{api/scroll.mdx → scroll.mdx} +3 -3
  44. package/docs/v7/secrets.mdx +115 -0
  45. package/docs/v7/self-hosted.mdx +66 -0
  46. package/docs/v7/{api/type.mdx → type.mdx} +3 -3
  47. package/docs/v7/variables.mdx +111 -0
  48. package/docs/v7/waiting-for-elements.mdx +66 -0
  49. package/docs/v7/what-is-testdriver.mdx +54 -0
  50. package/lib/vitest/hooks.mjs +80 -68
  51. package/package.json +1 -1
  52. package/sdk.d.ts +22 -9
  53. package/sdk.js +177 -44
  54. package/test/manual/reconnect-provision.test.mjs +49 -0
  55. package/test/manual/reconnect-signin.test.mjs +41 -0
  56. package/test/testdriver/ai.test.mjs +30 -0
  57. package/test/testdriver/setup/testHelpers.mjs +0 -1
  58. package/test/testdriver/windows-installer.test.mjs +61 -0
  59. package/tests/table-sort-enrollments.test.mjs +72 -0
  60. package/tests/table-sort-experiment.test.mjs +42 -0
  61. package/tests/table-sort-setup.test.mjs +59 -0
  62. package/vitest.config.mjs +1 -0
  63. package/docs/v7/api/assertions.mdx +0 -403
  64. package/docs/v7/features/ai-native.mdx +0 -413
  65. package/docs/v7/features/application-logs.mdx +0 -353
  66. package/docs/v7/features/browser-logs.mdx +0 -414
  67. package/docs/v7/features/cache-management.mdx +0 -402
  68. package/docs/v7/features/continuous-testing.mdx +0 -346
  69. package/docs/v7/features/data-driven-testing.mdx +0 -441
  70. package/docs/v7/features/easy-to-write.mdx +0 -280
  71. package/docs/v7/features/enterprise.mdx +0 -656
  72. package/docs/v7/features/fast.mdx +0 -406
  73. package/docs/v7/features/managed-sandboxes.mdx +0 -384
  74. package/docs/v7/features/network-monitoring.mdx +0 -568
  75. package/docs/v7/features/parallel-execution.mdx +0 -381
  76. package/docs/v7/features/powerful.mdx +0 -531
  77. package/docs/v7/features/sandbox-customization.mdx +0 -229
  78. package/docs/v7/features/stable.mdx +0 -473
  79. package/docs/v7/features/system-performance.mdx +0 -616
  80. package/docs/v7/features/test-analytics.mdx +0 -373
  81. package/docs/v7/features/test-cases.mdx +0 -393
  82. package/docs/v7/features/test-replays.mdx +0 -408
  83. package/docs/v7/features/test-reports.mdx +0 -308
  84. package/docs/v7/getting-started/debugging-tests.mdx +0 -382
  85. package/docs/v7/getting-started/quickstart.mdx +0 -90
  86. package/docs/v7/getting-started/running-tests.mdx +0 -173
  87. package/docs/v7/getting-started/setting-up-in-ci.mdx +0 -612
  88. package/docs/v7/getting-started/writing-tests.mdx +0 -534
  89. package/docs/v7/overview/what-is-testdriver.mdx +0 -386
  90. package/docs/v7/presets/chrome-extension.mdx +0 -248
  91. package/docs/v7/presets/chrome.mdx +0 -300
  92. package/docs/v7/presets/electron.mdx +0 -460
  93. package/docs/v7/presets/vscode.mdx +0 -417
  94. package/docs/v7/presets/webapp.mdx +0 -393
  95. package/vitest.config.js +0 -18
  96. /package/docs/v7/{commands → _drafts/commands}/assert.mdx +0 -0
  97. /package/docs/v7/{commands → _drafts/commands}/exec.mdx +0 -0
  98. /package/docs/v7/{commands → _drafts/commands}/focus-application.mdx +0 -0
  99. /package/docs/v7/{commands → _drafts/commands}/hover-image.mdx +0 -0
  100. /package/docs/v7/{commands → _drafts/commands}/hover-text.mdx +0 -0
  101. /package/docs/v7/{commands → _drafts/commands}/if.mdx +0 -0
  102. /package/docs/v7/{commands → _drafts/commands}/match-image.mdx +0 -0
  103. /package/docs/v7/{commands → _drafts/commands}/press-keys.mdx +0 -0
  104. /package/docs/v7/{commands → _drafts/commands}/remember.mdx +0 -0
  105. /package/docs/v7/{commands → _drafts/commands}/run.mdx +0 -0
  106. /package/docs/v7/{commands → _drafts/commands}/scroll-until-image.mdx +0 -0
  107. /package/docs/v7/{commands → _drafts/commands}/scroll-until-text.mdx +0 -0
  108. /package/docs/v7/{commands → _drafts/commands}/scroll.mdx +0 -0
  109. /package/docs/v7/{commands → _drafts/commands}/type.mdx +0 -0
  110. /package/docs/v7/{commands → _drafts/commands}/wait-for-image.mdx +0 -0
  111. /package/docs/v7/{commands → _drafts/commands}/wait-for-text.mdx +0 -0
  112. /package/docs/v7/{commands → _drafts/commands}/wait.mdx +0 -0
  113. /package/docs/v7/{getting-started → _drafts}/configuration.mdx +0 -0
  114. /package/docs/v7/{features → _drafts}/observable.mdx +0 -0
  115. /package/docs/v7/{platforms → _drafts/platforms}/linux.mdx +0 -0
  116. /package/docs/v7/{platforms → _drafts/platforms}/macos.mdx +0 -0
  117. /package/docs/v7/{platforms → _drafts/platforms}/windows.mdx +0 -0
  118. /package/docs/v7/{playwright.mdx → _drafts/playwright.mdx} +0 -0
  119. /package/docs/v7/{overview → _drafts}/readme.mdx +0 -0
  120. /package/docs/v7/{features → _drafts}/reports.mdx +0 -0
  121. /package/docs/v7/{api/client.mdx → client.mdx} +0 -0
  122. /package/docs/v7/{api/dashcam.mdx → dashcam.mdx} +0 -0
  123. /package/docs/v7/{api/elements.mdx → elements.mdx} +0 -0
  124. /package/docs/v7/{api/sandbox.mdx → sandbox.mdx} +0 -0
@@ -1,393 +0,0 @@
1
- ---
2
- title: "Test Cases"
3
- description: "Individual test case reports with history, trends, and pass rates"
4
- icon: "file-lines"
5
- ---
6
-
7
- View detailed information for every test case including execution history, pass rate trends, recent runs, and replay links.
8
-
9
- ## Test Cases Dashboard
10
-
11
- Access all test cases at [app.testdriver.ai/tests](https://app.testdriver.ai/tests):
12
-
13
- <Card title="Test Cases" icon="list" href="https://app.testdriver.ai/tests">
14
- View all test cases with filtering and historical data
15
- </Card>
16
-
17
- ### Test Case Information
18
-
19
- Each test case displays:
20
-
21
- - **Test Name** - Full descriptive name
22
- - **File** - Source file location (e.g., `test/testdriver.test.js`)
23
- - **Passed** - Number of successful runs
24
- - **Failed** - Number of failed runs
25
- - **Pass Rate** - Success percentage with visual indicator
26
- - **Trend** - Sparkline showing recent pass/fail history
27
- - **Change** - Comparison to previous period
28
- - **Last Run** - Most recent execution time
29
- - **Replay** - Quick link to latest test replay
30
-
31
- ## Filtering & Search
32
-
33
- Find specific test cases quickly:
34
-
35
- <Tabs>
36
- <Tab title="Time Period">
37
- ```
38
- Last 24 hours (default)
39
- Last week
40
- Last month
41
- Custom date range
42
- ```
43
- </Tab>
44
-
45
- <Tab title="Branch">
46
- ```
47
- main (default)
48
- All branches
49
- Specific branch
50
- ```
51
- </Tab>
52
-
53
- <Tab title="Repository">
54
- ```
55
- All repositories
56
- frontend
57
- backend
58
- Specific repo
59
- ```
60
- </Tab>
61
-
62
- <Tab title="Suite/File">
63
- ```
64
- All test files
65
- test/login.test.js
66
- test/checkout.test.js
67
- Search by filename
68
- ```
69
- </Tab>
70
-
71
- <Tab title="Test Name">
72
- ```
73
- Search test names
74
- "should login"
75
- "checkout flow"
76
- Partial matching
77
- ```
78
- </Tab>
79
- </Tabs>
80
-
81
- ## Pass Rate Indicators
82
-
83
- Visual status at a glance:
84
-
85
- <CardGroup cols={3}>
86
- <Card title="100% Pass Rate" icon="check" color="green">
87
- Green bar - All runs passed
88
- </Card>
89
-
90
- <Card title="Partial Pass Rate" icon="minus" color="yellow">
91
- Yellow/Orange bar - Some failures
92
- </Card>
93
-
94
- <Card title="0% Pass Rate" icon="xmark" color="red">
95
- Red bar - All runs failed
96
- </Card>
97
- </CardGroup>
98
-
99
- ## Test History
100
-
101
- View complete execution history for any test:
102
-
103
- ```
104
- Test: "should demonstrate formatted log in dashcam replay"
105
- File: test/testdriver.test.js
106
-
107
- Recent Runs:
108
- ┌─────────────┬────────┬──────────┬──────────┬─────────────────────┐
109
- │ Run ID │ Status │ Duration │ Platform │ Timestamp │
110
- ├─────────────┼────────┼──────────┼──────────┼─────────────────────┤
111
- │ run_abc123 │ PASSED │ 1.2s │ Linux │ 2 hours ago │
112
- │ run_abc122 │ PASSED │ 1.1s │ Linux │ 3 hours ago │
113
- │ run_abc121 │ FAILED │ 0.8s │ Linux │ 5 hours ago │
114
- │ run_abc120 │ PASSED │ 1.3s │ Linux │ 6 hours ago │
115
- └─────────────┴────────┴──────────┴──────────┴─────────────────────┘
116
-
117
- Pass Rate: 75% (3/4 passed)
118
- Avg Duration: 1.1s
119
- ```
120
-
121
- ## Trend Visualization
122
-
123
- See pass/fail patterns over time:
124
-
125
- ```
126
- Sparkline Chart (Past 7 Days):
127
- █ = Passed
128
- ▁ = Failed
129
- = Not run
130
-
131
- Day: 1 2 3 4 5 6 7
132
- [█][█][▁][█][█][█][█]
133
-
134
- Pass Rate Trend: ↑ 85% → 100% (improving)
135
- ```
136
-
137
- **Insights:**
138
- - Identify flaky tests (inconsistent patterns)
139
- - Track stabilization efforts
140
- - Spot recent regressions
141
- - Validate fixes
142
-
143
- ## Recent Test Runs
144
-
145
- Quick access to latest executions:
146
-
147
- <Tabs>
148
- <Tab title="Passed Run">
149
- ```
150
- Status: PASSED ✓
151
- Duration: 54s
152
- Platform: Linux + Chrome
153
- Branch: main
154
- Commit: 8cbef48
155
- Timestamp: about 1 hour ago
156
-
157
- [View Replay] [View Logs]
158
- ```
159
- </Tab>
160
-
161
- <Tab title="Failed Run">
162
- ```
163
- Status: FAILED ✗
164
- Duration: 2m 36s
165
- Platform: Linux + Chrome
166
- Branch: main
167
- Commit: 8cbef48
168
- Error: Element not found
169
- Timestamp: 12 minutes ago
170
-
171
- [View Replay] [View Logs] [Debug]
172
- ```
173
- </Tab>
174
-
175
- <Tab title="Running">
176
- ```
177
- Status: RUNNING ⟳
178
- Elapsed: 1m 23s
179
- Platform: Linux + Chrome
180
- Branch: feature/checkout
181
- Commit: a1b2c3d
182
- Started: just now
183
-
184
- [Watch Live] [Cancel]
185
- ```
186
- </Tab>
187
- </Tabs>
188
-
189
- ## Flaky Test Identification
190
-
191
- Tests with inconsistent results are flagged:
192
-
193
- ```
194
- ⚠️ FLAKY TEST DETECTED
195
-
196
- Test: "should click Sign in and verify error message"
197
- Flakiness Score: 42%
198
-
199
- Last 10 Runs:
200
- ✓ ✗ ✓ ✓ ✗ ✓ ✗ ✓ ✓ ✓
201
-
202
- Recommendation:
203
- - Add explicit waits
204
- - Check for race conditions
205
- - Review network dependencies
206
- - Enable anti-flake features
207
-
208
- [View Flaky Run Comparison] [See Debugging Tips]
209
- ```
210
-
211
- ## Pass/Fail History Chart
212
-
213
- Detailed historical view:
214
-
215
- ```
216
- Bar Chart (Last 30 Days):
217
- - Green bars: Number of passed runs per day
218
- - Red bars: Number of failed runs per day
219
- - Height indicates total runs
220
-
221
- Day Passed Failed Total
222
- Dec 1 5 0 5
223
- Dec 2 8 2 10
224
- Dec 3 6 1 7
225
- ...
226
- Dec 9 12 3 15
227
-
228
- Overall: 85% pass rate
229
- ```
230
-
231
- ## Test Comparison
232
-
233
- Compare test performance across branches or time periods:
234
-
235
- <Tabs>
236
- <Tab title="Branch Comparison">
237
- ```
238
- Test: "should login successfully"
239
-
240
- Branch: main
241
- - Pass Rate: 95%
242
- - Avg Duration: 1.2s
243
- - Runs: 100
244
-
245
- Branch: feature/new-auth
246
- - Pass Rate: 87%
247
- - Avg Duration: 1.8s
248
- - Runs: 45
249
-
250
- Difference:
251
- - Pass Rate: -8% (regression)
252
- - Duration: +50% (slower)
253
- ```
254
- </Tab>
255
-
256
- <Tab title="Time Comparison">
257
- ```
258
- Test: "should complete checkout"
259
-
260
- Last Week:
261
- - Pass Rate: 78%
262
- - Avg Duration: 3.2s
263
-
264
- This Week:
265
- - Pass Rate: 92%
266
- - Avg Duration: 2.1s
267
-
268
- Improvement:
269
- - Pass Rate: +14% (better)
270
- - Duration: -34% (faster)
271
- ```
272
- </Tab>
273
- </Tabs>
274
-
275
- ## Export Test Cases
276
-
277
- Download test case data:
278
-
279
- <Tabs>
280
- <Tab title="CSV">
281
- ```csv
282
- Test Name,File,Passed,Failed,Pass Rate,Avg Duration,Last Run
283
- should login,test/auth.test.js,45,5,90%,1.2s,2024-12-09T10:30:00Z
284
- should checkout,test/shop.test.js,38,12,76%,3.4s,2024-12-09T10:25:00Z
285
- ```
286
- </Tab>
287
-
288
- <Tab title="JSON">
289
- ```json
290
- {
291
- "testCases": [
292
- {
293
- "name": "should login successfully",
294
- "file": "test/auth.test.js",
295
- "stats": {
296
- "passed": 45,
297
- "failed": 5,
298
- "passRate": 0.90,
299
- "avgDuration": 1.2
300
- },
301
- "lastRun": {
302
- "status": "PASSED",
303
- "timestamp": "2024-12-09T10:30:00Z",
304
- "replayUrl": "https://app.testdriver.ai/replay/abc123"
305
- }
306
- }
307
- ]
308
- }
309
- ```
310
- </Tab>
311
- </Tabs>
312
-
313
- ## Bulk Actions
314
-
315
- Manage multiple tests at once:
316
-
317
- <CardGroup cols={2}>
318
- <Card title="Re-run Selected" icon="rotate-right">
319
- Re-execute failed or flaky tests
320
- </Card>
321
-
322
- <Card title="Mark as Known Issue" icon="flag">
323
- Track expected failures
324
- </Card>
325
-
326
- <Card title="Add to Watch List" icon="eye">
327
- Monitor specific tests
328
- </Card>
329
-
330
- <Card title="Export Selection" icon="download">
331
- Download filtered results
332
- </Card>
333
- </CardGroup>
334
-
335
- ## Integration with Replays
336
-
337
- Quick access to debugging tools:
338
-
339
- ```javascript
340
- import { test } from 'vitest';
341
- import { chrome } from 'testdriverai/presets';
342
-
343
- test('trackable test case', async (context) => {
344
- const { testdriver, dashcam } = await chrome(context, {
345
- url: 'https://example.com'
346
- });
347
-
348
- await testdriver.find('button').click();
349
-
350
- // After test completes:
351
- // - Test case appears in dashboard
352
- // - Replay automatically linked
353
- // - History updated
354
- // - Pass rate recalculated
355
- console.log('Replay URL:', dashcam.url);
356
- });
357
- ```
358
-
359
- ## Learn More
360
-
361
- <CardGroup cols={2}>
362
- <Card
363
- title="Test Reports"
364
- icon="list-check"
365
- href="/v7/features/test-reports"
366
- >
367
- View all test run reports
368
- </Card>
369
-
370
- <Card
371
- title="Test Analytics"
372
- icon="chart-line"
373
- href="/v7/features/test-analytics"
374
- >
375
- Analyze trends and metrics
376
- </Card>
377
-
378
- <Card
379
- title="Test Replays"
380
- icon="video"
381
- href="/v7/features/test-replays"
382
- >
383
- Watch test execution videos
384
- </Card>
385
-
386
- <Card
387
- title="Flake Prevention"
388
- icon="shield-check"
389
- href="/v7/features/stable"
390
- >
391
- Eliminate flaky tests
392
- </Card>
393
- </CardGroup>