testdriverai 7.2.9 → 7.2.11

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 +87 -126
  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/dashcam.mdx → dashcam.mdx} +0 -78
  26. package/docs/v7/{api/doubleClick.mdx → double-click.mdx} +5 -5
  27. package/docs/v7/{api/elements.mdx → elements.mdx} +1 -54
  28. package/docs/v7/enterprise.mdx +116 -0
  29. package/docs/v7/examples.mdx +5 -0
  30. package/docs/v7/{api/exec.mdx → exec.mdx} +3 -3
  31. package/docs/v7/{api/find.mdx → find.mdx} +17 -21
  32. package/docs/v7/{api/focusApplication.mdx → focus-application.mdx} +3 -3
  33. package/docs/v7/generating-tests.mdx +36 -0
  34. package/docs/v7/{api/hover.mdx → hover.mdx} +3 -3
  35. package/docs/v7/locating-elements.mdx +71 -0
  36. package/docs/v7/making-assertions.mdx +32 -0
  37. package/docs/v7/{api/mouseDown.mdx → mouse-down.mdx} +7 -7
  38. package/docs/v7/{api/mouseUp.mdx → mouse-up.mdx} +8 -8
  39. package/docs/v7/performing-actions.mdx +51 -0
  40. package/docs/v7/{api/pressKeys.mdx → press-keys.mdx} +3 -3
  41. package/docs/v7/quickstart.mdx +162 -0
  42. package/docs/v7/reusable-code.mdx +240 -0
  43. package/docs/v7/{api/rightClick.mdx → right-click.mdx} +5 -5
  44. package/docs/v7/running-tests.mdx +181 -0
  45. package/docs/v7/{api/scroll.mdx → scroll.mdx} +3 -3
  46. package/docs/v7/secrets.mdx +115 -0
  47. package/docs/v7/self-hosted.mdx +66 -0
  48. package/docs/v7/{api/type.mdx → type.mdx} +3 -3
  49. package/docs/v7/variables.mdx +111 -0
  50. package/docs/v7/waiting-for-elements.mdx +66 -0
  51. package/docs/v7/what-is-testdriver.mdx +54 -0
  52. package/lib/vitest/hooks.mjs +80 -68
  53. package/package.json +1 -1
  54. package/sdk.d.ts +22 -9
  55. package/sdk.js +177 -44
  56. package/test/manual/reconnect-provision.test.mjs +49 -0
  57. package/test/manual/reconnect-signin.test.mjs +41 -0
  58. package/test/testdriver/ai.test.mjs +30 -0
  59. package/test/testdriver/setup/testHelpers.mjs +0 -1
  60. package/test/testdriver/windows-installer.test.mjs +61 -0
  61. package/tests/table-sort-enrollments.test.mjs +72 -0
  62. package/tests/table-sort-experiment.test.mjs +42 -0
  63. package/tests/table-sort-setup.test.mjs +59 -0
  64. package/vitest.config.mjs +1 -0
  65. package/docs/v7/api/assertions.mdx +0 -403
  66. package/docs/v7/api/sandbox.mdx +0 -404
  67. package/docs/v7/features/ai-native.mdx +0 -413
  68. package/docs/v7/features/application-logs.mdx +0 -353
  69. package/docs/v7/features/browser-logs.mdx +0 -414
  70. package/docs/v7/features/cache-management.mdx +0 -402
  71. package/docs/v7/features/continuous-testing.mdx +0 -346
  72. package/docs/v7/features/data-driven-testing.mdx +0 -441
  73. package/docs/v7/features/easy-to-write.mdx +0 -280
  74. package/docs/v7/features/enterprise.mdx +0 -656
  75. package/docs/v7/features/fast.mdx +0 -406
  76. package/docs/v7/features/managed-sandboxes.mdx +0 -384
  77. package/docs/v7/features/network-monitoring.mdx +0 -568
  78. package/docs/v7/features/parallel-execution.mdx +0 -381
  79. package/docs/v7/features/powerful.mdx +0 -531
  80. package/docs/v7/features/sandbox-customization.mdx +0 -229
  81. package/docs/v7/features/stable.mdx +0 -473
  82. package/docs/v7/features/system-performance.mdx +0 -616
  83. package/docs/v7/features/test-analytics.mdx +0 -373
  84. package/docs/v7/features/test-cases.mdx +0 -393
  85. package/docs/v7/features/test-replays.mdx +0 -408
  86. package/docs/v7/features/test-reports.mdx +0 -308
  87. package/docs/v7/getting-started/debugging-tests.mdx +0 -382
  88. package/docs/v7/getting-started/quickstart.mdx +0 -90
  89. package/docs/v7/getting-started/running-tests.mdx +0 -173
  90. package/docs/v7/getting-started/setting-up-in-ci.mdx +0 -612
  91. package/docs/v7/getting-started/writing-tests.mdx +0 -534
  92. package/docs/v7/overview/what-is-testdriver.mdx +0 -386
  93. package/docs/v7/presets/chrome-extension.mdx +0 -248
  94. package/docs/v7/presets/chrome.mdx +0 -300
  95. package/docs/v7/presets/electron.mdx +0 -460
  96. package/docs/v7/presets/vscode.mdx +0 -417
  97. package/docs/v7/presets/webapp.mdx +0 -393
  98. package/vitest.config.js +0 -18
  99. /package/docs/v7/{commands → _drafts/commands}/assert.mdx +0 -0
  100. /package/docs/v7/{commands → _drafts/commands}/exec.mdx +0 -0
  101. /package/docs/v7/{commands → _drafts/commands}/focus-application.mdx +0 -0
  102. /package/docs/v7/{commands → _drafts/commands}/hover-image.mdx +0 -0
  103. /package/docs/v7/{commands → _drafts/commands}/hover-text.mdx +0 -0
  104. /package/docs/v7/{commands → _drafts/commands}/if.mdx +0 -0
  105. /package/docs/v7/{commands → _drafts/commands}/match-image.mdx +0 -0
  106. /package/docs/v7/{commands → _drafts/commands}/press-keys.mdx +0 -0
  107. /package/docs/v7/{commands → _drafts/commands}/remember.mdx +0 -0
  108. /package/docs/v7/{commands → _drafts/commands}/run.mdx +0 -0
  109. /package/docs/v7/{commands → _drafts/commands}/scroll-until-image.mdx +0 -0
  110. /package/docs/v7/{commands → _drafts/commands}/scroll-until-text.mdx +0 -0
  111. /package/docs/v7/{commands → _drafts/commands}/scroll.mdx +0 -0
  112. /package/docs/v7/{commands → _drafts/commands}/type.mdx +0 -0
  113. /package/docs/v7/{commands → _drafts/commands}/wait-for-image.mdx +0 -0
  114. /package/docs/v7/{commands → _drafts/commands}/wait-for-text.mdx +0 -0
  115. /package/docs/v7/{commands → _drafts/commands}/wait.mdx +0 -0
  116. /package/docs/v7/{getting-started → _drafts}/configuration.mdx +0 -0
  117. /package/docs/v7/{features → _drafts}/observable.mdx +0 -0
  118. /package/docs/v7/{platforms → _drafts/platforms}/linux.mdx +0 -0
  119. /package/docs/v7/{platforms → _drafts/platforms}/macos.mdx +0 -0
  120. /package/docs/v7/{platforms → _drafts/platforms}/windows.mdx +0 -0
  121. /package/docs/v7/{playwright.mdx → _drafts/playwright.mdx} +0 -0
  122. /package/docs/v7/{overview → _drafts}/readme.mdx +0 -0
  123. /package/docs/v7/{features → _drafts}/reports.mdx +0 -0
  124. /package/docs/v7/{api/client.mdx → client.mdx} +0 -0
@@ -1,353 +0,0 @@
1
- ---
2
- title: "Application Logs"
3
- description: "TestDriver SDK logs and test execution output"
4
- icon: "terminal"
5
- ---
6
-
7
- View detailed TestDriver application logs including test execution steps, AI vision analysis results, cache hits/misses, and debugging information.
8
-
9
- ## Application Log Output
10
-
11
- TestDriver logs every action and decision during test execution:
12
-
13
- ```
14
- Test Execution Logs:
15
- ┌────────────────────────────────────────────────────┐
16
- │ [0:00] ℹ️ System info configured │
17
- │ [0:00] ℹ️ Response cache: /Users/.../cache.json │
18
- │ [0:05] ✓ Connected to sandbox i-0abc123def │
19
- │ [0:08] ℹ️ Browser launched: Chrome 120.0 │
20
- │ [0:12] ✓ Navigated to https://example.com │
21
- │ [0:15] 🔍 Finding: "login button" │
22
- │ [0:18] ✓ Cache hit: login button (fe68cfe...) │
23
- │ [0:18] ✓ Element found at (512, 387) │
24
- │ [0:19] ✓ Clicked login button │
25
- │ [0:22] 🔍 Finding: "email input" │
26
- │ [0:25] ⚡ Cache miss: analyzing with AI vision │
27
- │ [0:28] ✓ Element found at (450, 290) │
28
- │ [0:28] ℹ️ Cached for future runs │
29
- │ [0:29] ✓ Typed "user@example.com" │
30
- │ [0:32] ✓ Response was successful! │
31
- │ [0:35] ✓ Test completed: PASSED │
32
- └────────────────────────────────────────────────────┘
33
- ```
34
-
35
- ## Log Levels
36
-
37
- TestDriver uses standard log levels:
38
-
39
- <CardGroup cols={2}>
40
- <Card title="INFO" icon="circle-info" color="blue">
41
- General information about test execution
42
- - Configuration loaded
43
- - Sandbox connection
44
- - Navigation events
45
- - Cache operations
46
- </Card>
47
-
48
- <Card title="SUCCESS" icon="check" color="green">
49
- Successful operations
50
- - Element found
51
- - Action completed
52
- - Assertion passed
53
- - Test passed
54
- </Card>
55
-
56
- <Card title="WARNING" icon="triangle-exclamation" color="yellow">
57
- Non-critical issues
58
- - Slow operations
59
- - Retry attempts
60
- - Deprecated API usage
61
- - Cache near limit
62
- </Card>
63
-
64
- <Card title="ERROR" icon="circle-xmark" color="red">
65
- Failures and exceptions
66
- - Element not found
67
- - Timeout errors
68
- - Assertion failures
69
- - Test failures
70
- </Card>
71
-
72
- <Card title="DEBUG" icon="bug" color="gray">
73
- Detailed debugging information
74
- - AI vision analysis details
75
- - Screenshot hashes
76
- - Cache key generation
77
- - Internal SDK operations
78
- </Card>
79
- </CardGroup>
80
-
81
- ## AI Vision Analysis Logs
82
-
83
- See how TestDriver finds elements:
84
-
85
- ```
86
- AI Vision Analysis:
87
- ┌────────────────────────────────────────────────────┐
88
- │ [0:22] 🔍 Finding: "submit button in login form" │
89
- │ [0:23] ℹ️ Taking screenshot... │
90
- │ [0:24] ℹ️ Screenshot hash: a8f3c21b4e9d7f... │
91
- │ [0:24] ℹ️ Cache lookup: MISS │
92
- │ [0:25] ℹ️ Sending to AI vision model... │
93
- │ [0:26] ℹ️ AI analysis in progress... │
94
- │ [0:28] ✓ Element identified with 98.5% confidence │
95
- │ [0:28] ✓ Bounding box: (450, 370, 124, 34) │
96
- │ [0:28] ✓ Coordinates: (512, 387) │
97
- │ [0:28] ℹ️ Saving to cache (key: fe68cfe6...) │
98
- │ [0:29] ✓ Element found and ready for interaction │
99
- └────────────────────────────────────────────────────┘
100
- ```
101
-
102
- **Logged Information:**
103
- - Screenshot capture timing
104
- - Cache lookup results
105
- - AI model inference time
106
- - Confidence scores
107
- - Element coordinates
108
- - Cache storage
109
-
110
- ## Cache Hit/Miss Tracking
111
-
112
- Monitor cache performance in logs:
113
-
114
- ```
115
- Cache Performance Logs:
116
- ┌────────────────────────────────────────────────────┐
117
- │ [0:15] ⚡ Cache HIT: "login button" (12ms) │
118
- │ [0:22] ⚡ Cache MISS: "email input" (analyzing...) │
119
- │ [0:35] ⚡ Cache HIT: "password field" (8ms) │
120
- │ [0:42] ⚡ Cache HIT: "submit button" (10ms) │
121
- │ │
122
- │ Cache Summary: │
123
- │ • Hits: 3 (75%) │
124
- │ • Misses: 1 (25%) │
125
- │ • Time saved: ~6.2 seconds │
126
- └────────────────────────────────────────────────────┘
127
- ```
128
-
129
- ## Test Step Logs
130
-
131
- Detailed action execution:
132
-
133
- ```
134
- Action Execution:
135
- ┌────────────────────────────────────────────────────┐
136
- │ [0:19] ➤ testdriver.find('login button') │
137
- │ [0:19] ℹ️ Locating element... │
138
- │ [0:19] ✓ Found at (512, 387) │
139
- │ │
140
- │ [0:19] ➤ .click() │
141
- │ [0:19] ℹ️ Moving mouse to (512, 387) │
142
- │ [0:20] ℹ️ Mouse button down │
143
- │ [0:20] ℹ️ Mouse button up │
144
- │ [0:20] ✓ Click completed │
145
- │ │
146
- │ [0:22] ➤ testdriver.find('email input') │
147
- │ [0:25] ✓ Found at (450, 290) │
148
- │ │
149
- │ [0:25] ➤ .type('user@example.com') │
150
- │ [0:26] ℹ️ Typing: u │
151
- │ [0:26] ℹ️ Typing: s │
152
- │ [0:27] ℹ️ Typing: e │
153
- │ [0:27] ℹ️ Typing: r │
154
- │ ... (truncated for brevity) │
155
- │ [0:29] ✓ Typed 17 characters │
156
- └────────────────────────────────────────────────────┘
157
- ```
158
-
159
- ## Assertion Logs
160
-
161
- Track test assertions:
162
-
163
- ```
164
- Assertions:
165
- ┌────────────────────────────────────────────────────┐
166
- │ [0:32] ➤ testdriver.assert('login successful') │
167
- │ [0:32] ℹ️ Taking screenshot for assertion... │
168
- │ [0:33] ℹ️ Sending to AI for verification... │
169
- │ [0:35] ✓ Assertion passed with 96.2% confidence │
170
- │ [0:35] ℹ️ Evidence: "Welcome, User" text visible │
171
- │ │
172
- │ [0:40] ➤ testdriver.assert('error message shows') │
173
- │ [0:41] ℹ️ Taking screenshot for assertion... │
174
- │ [0:42] ℹ️ Sending to AI for verification... │
175
- │ [0:44] ✗ Assertion failed │
176
- │ [0:44] ℹ️ Reason: No error message found │
177
- │ [0:44] ℹ️ Screenshot saved for debugging │
178
- └────────────────────────────────────────────────────┘
179
- ```
180
-
181
- ## Error and Stack Traces
182
-
183
- Detailed error information:
184
-
185
- ```
186
- Error Details:
187
- ┌────────────────────────────────────────────────────┐
188
- │ [0:44] ✗ AssertionError: Element not found │
189
- │ │
190
- │ Expected: "error message" │
191
- │ Context: Login form after submission │
192
- │ Timeout: 30000ms │
193
- │ │
194
- │ Stack Trace: │
195
- │ at TestDriver.assert (sdk.js:456) │
196
- │ at login.test.js:23:18 │
197
- │ at async Test.fn (vitest/run.js:125) │
198
- │ │
199
- │ Screenshot: /tmp/screenshot-abc123.png │
200
- │ Replay URL: https://app.testdriver.ai/replay/... │
201
- └────────────────────────────────────────────────────┘
202
- ```
203
-
204
- ## Configuring Log Output
205
-
206
- Control log verbosity:
207
-
208
- ```javascript
209
- import { test } from 'vitest';
210
- import { chrome } from 'testdriverai/presets';
211
-
212
- test('with custom logging', async (context) => {
213
- const { testdriver } = await chrome(context, {
214
- url: 'https://example.com',
215
- logLevel: 'debug', // 'error' | 'warn' | 'info' | 'debug'
216
- verbose: true // Show detailed AI analysis logs
217
- });
218
-
219
- await testdriver.find('button').click();
220
- });
221
- ```
222
-
223
- ## Log Filtering
224
-
225
- Filter logs in the dashboard:
226
-
227
- <Tabs>
228
- <Tab title="By Level">
229
- ```
230
- Show only:
231
- ☑ Errors
232
- ☑ Warnings
233
- ☐ Info
234
- ☐ Debug
235
- ```
236
- </Tab>
237
-
238
- <Tab title="By Category">
239
- ```
240
- Filter by:
241
- ☑ AI Vision
242
- ☑ Cache Operations
243
- ☑ Actions
244
- ☑ Assertions
245
- ☐ Screenshots
246
- ```
247
- </Tab>
248
-
249
- <Tab title="By Timestamp">
250
- ```
251
- Time range:
252
- Full test duration
253
- Last 30 seconds
254
- Around error (±10s)
255
- Custom range
256
- ```
257
- </Tab>
258
-
259
- <Tab title="By Search">
260
- ```
261
- Search logs:
262
- "element not found"
263
- "cache hit"
264
- "assertion"
265
- Regular expressions supported
266
- ```
267
- </Tab>
268
- </Tabs>
269
-
270
- ## Export Logs
271
-
272
- Download application logs:
273
-
274
- <Tabs>
275
- <Tab title="Plain Text">
276
- ```
277
- [0:00] INFO System info configured
278
- [0:05] SUCCESS Connected to sandbox
279
- [0:15] INFO Finding: "login button"
280
- [0:18] SUCCESS Cache hit: login button
281
- [0:19] SUCCESS Clicked login button
282
- ```
283
- </Tab>
284
-
285
- <Tab title="JSON">
286
- ```json
287
- {
288
- "logs": [
289
- {
290
- "timestamp": "0:00",
291
- "level": "INFO",
292
- "message": "System info configured"
293
- },
294
- {
295
- "timestamp": "0:18",
296
- "level": "SUCCESS",
297
- "message": "Cache hit: login button",
298
- "metadata": {
299
- "cacheKey": "fe68cfe6...",
300
- "matchTime": "12ms"
301
- }
302
- }
303
- ]
304
- }
305
- ```
306
- </Tab>
307
-
308
- <Tab title="CSV">
309
- ```csv
310
- Timestamp,Level,Category,Message
311
- 0:00,INFO,System,System info configured
312
- 0:05,SUCCESS,Sandbox,Connected to sandbox
313
- 0:15,INFO,Vision,Finding: "login button"
314
- 0:18,SUCCESS,Cache,Cache hit: login button
315
- ```
316
- </Tab>
317
- </Tabs>
318
-
319
- ## Learn More
320
-
321
- <CardGroup cols={2}>
322
- <Card
323
- title="Browser Logs"
324
- icon="browser"
325
- href="/v7/features/browser-logs"
326
- >
327
- Console output and JavaScript errors
328
- </Card>
329
-
330
- <Card
331
- title="Network Monitoring"
332
- icon="network-wired"
333
- href="/v7/features/network-monitoring"
334
- >
335
- HTTP requests and responses
336
- </Card>
337
-
338
- <Card
339
- title="System Performance"
340
- icon="chart-line"
341
- href="/v7/features/system-performance"
342
- >
343
- CPU, memory, and resource usage
344
- </Card>
345
-
346
- <Card
347
- title="Test Replays"
348
- icon="video"
349
- href="/v7/features/test-replays"
350
- >
351
- Complete test execution videos
352
- </Card>
353
- </CardGroup>