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
@@ -0,0 +1,120 @@
1
+ ---
2
+ title: "Cloud Plan"
3
+ sidebarTitle: "Cloud"
4
+ description: "The fastest way to get started with TestDriver. Just set your API key and start testing."
5
+ icon: "cloud"
6
+ ---
7
+
8
+ Cloud pricing is based on **device-seconds**: the amount of time your tests run on **our infrastructure**.
9
+
10
+ - **Zero Setup** — Start testing immediately. No DevOps required.
11
+ - **Free Tier** — Get started with a limited preview at no cost.
12
+ - **Pay As You Go** — Only pay for the device-seconds you use.
13
+
14
+ ## Get Started
15
+ Cloud is the default when you follow the Quickstart guide.
16
+ <Card
17
+ title="Try the Quickstart"
18
+ icon="play"
19
+ href="/v7/quickstart"
20
+ >
21
+ Set your API key and start testing in minutes.
22
+ </Card>
23
+
24
+ ## Parallel Testing Limits
25
+
26
+ Your account has a set number of **license slots** that determine how many devices can run simultaneously. You can view your available slots in the [TestDriver Dashboard](https://console.testdriver.ai).
27
+
28
+ <Info>
29
+ **When is a slot in use?** A license slot is occupied when a test client is connected. As soon as your device is destroyed the slot becomes available immediately.
30
+ </Info>
31
+
32
+ ## Avoiding Slot Conflicts
33
+
34
+ To prevent tests from failing due to exceeding your license slot limit, we recommend two key configurations:
35
+
36
+ <AccordionGroup>
37
+ <Accordion title="Set Maximum Concurrency in Vitest">
38
+ Limit concurrent tests to match your available license slots:
39
+
40
+ ```javascript vitest.config.mjs
41
+ import { defineConfig } from 'vitest/config';
42
+ import { TestDriver } from 'testdriverai/vitest';
43
+
44
+ export default defineConfig({
45
+ test: {
46
+ testTimeout: 900000,
47
+ hookTimeout: 900000,
48
+ maxConcurrency: 5, // Set to your license slot limit
49
+ reporters: ['default', TestDriver()],
50
+ setupFiles: ['testdriverai/vitest/setup'],
51
+ },
52
+ });
53
+ ```
54
+
55
+ <Tip>
56
+ Check your slot count at [console.testdriver.ai](https://console.testdriver.ai) and set `maxConcurrency` to that number or lower.
57
+ </Tip>
58
+ </Accordion>
59
+
60
+ <Accordion title="Use GitHub Concurrency Keys">
61
+ Prevent multiple workflow runs from competing for the same slots by using [GitHub's concurrency controls](https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs):
62
+
63
+ ```yaml .github/workflows/test.yml
64
+ name: Tests
65
+
66
+ on:
67
+ push:
68
+ branches: [main]
69
+ pull_request:
70
+
71
+ # Prevent concurrent runs from competing for license slots
72
+ concurrency:
73
+ group: ${{ github.workflow }}-${{ github.ref }}
74
+ cancel-in-progress: true
75
+
76
+ jobs:
77
+ test:
78
+ runs-on: ubuntu-latest
79
+ steps:
80
+ - uses: actions/checkout@v4
81
+
82
+ - name: Setup Node.js
83
+ uses: actions/setup-node@v4
84
+ with:
85
+ node-version: '20'
86
+
87
+ - name: Install dependencies
88
+ run: npm install
89
+
90
+ - name: Run tests
91
+ run: npx vitest run
92
+ env:
93
+ TD_API_KEY: ${{ secrets.TD_API_KEY }}
94
+ ```
95
+
96
+ The `concurrency` block ensures:
97
+ - Only one workflow run per branch runs at a time
98
+ - New pushes cancel in-progress runs on the same branch
99
+ - Different branches/PRs can run in parallel (up to your slot limit)
100
+ </Accordion>
101
+ </AccordionGroup>
102
+
103
+ ## When to Consider Self-Hosted
104
+
105
+ Cloud is perfect for getting started and for teams that want zero infrastructure management. However, you might consider [Self-Hosted](/v7/self-hosted) if you:
106
+
107
+ - Want to escape per-second billing with a flat license fee
108
+ - Require greater concurrency than offered in Cloud plans
109
+ - Need full control over your infrastructure and privacy
110
+ - Want to use your own AI API keys
111
+ - Require custom hardware configurations
112
+ - Have high test volumes that make self-hosting more economical
113
+
114
+ <Card
115
+ title="Explore Self-Hosted"
116
+ icon="server"
117
+ href="/v7/self-hosted"
118
+ >
119
+ Learn about self-hosting for unlimited test execution at a flat rate.
120
+ </Card>
@@ -0,0 +1,129 @@
1
+ ---
2
+ title: "Customizing Devices"
3
+ description: "Configure TestDriver sandbox options and environment settings"
4
+ icon: "computer"
5
+ ---
6
+
7
+ ## TestDriver Options
8
+
9
+ Configure TestDriver behavior with options passed to the `TestDriver()` function:
10
+
11
+ ```javascript
12
+ const testdriver = TestDriver(context, {
13
+ headless: false,
14
+ reconnect: false,
15
+ });
16
+ ```
17
+
18
+ ### Headless Mode
19
+
20
+ Run tests without a visible browser window. Useful for CI/CD pipeline or spawning multiple tests locally:
21
+
22
+ ```javascript
23
+ const testdriver = TestDriver(context, {
24
+ headless: true, // No visible browser window
25
+ });
26
+ ```
27
+
28
+ ### IP Target
29
+
30
+ If self-hosting TestDriver, use `ip` to specify the device IP. See [Self-Hosting TestDriver](../self-hosting.md) for details.
31
+
32
+ ```javascript
33
+ const testdriver = TestDriver(context, {
34
+ newSandbox: true,
35
+ ip: "203.0.113.42", // Your allowlisted IP
36
+ });
37
+ ```
38
+
39
+ ### Operating System
40
+
41
+ Set the `os` property to run tests on a specific operating system. Available options are `linux` (default) and `windows`.
42
+
43
+ ```javascript
44
+ const testdriver = TestDriver(context, {
45
+ os: "windows", // Run on Windows sandbox
46
+ });
47
+ ```
48
+
49
+ #### Using Environment Variables
50
+
51
+ You can make the operating system configurable via environment variables. This requires adding code to read from `process.env` in your test:
52
+
53
+ ```javascript
54
+ const testdriver = TestDriver(context, {
55
+ os: process.env.TD_OS || "linux", // Read from env, default to Linux
56
+ });
57
+ ```
58
+
59
+ Then pass the variable when running tests:
60
+
61
+ ```bash
62
+ # Run tests on Windows
63
+ TD_OS=windows npx vitest run
64
+
65
+ # Run tests on Linux (default)
66
+ TD_OS=linux npx vitest run
67
+ ```
68
+
69
+ This pattern is useful for running the same test suite across multiple operating systems in CI/CD:
70
+
71
+ ```yaml
72
+ # Example GitHub Actions matrix
73
+ strategy:
74
+ matrix:
75
+ os: [linux, windows]
76
+ steps:
77
+ - run: TD_OS=${{ matrix.os }} npx vitest run
78
+ ```
79
+
80
+ ## Keepalive
81
+
82
+ By default, sandboxes terminate immediately when the test finishes. Set this value to keep the sandbox alive for reconnection.
83
+
84
+ The `keepAlive` param enables you to keep the sandbox running after the test completes for debugging or reconnection. This will allow you to use the debugger to inspect the state of the device after the test has finished.
85
+
86
+ ```javascript
87
+ const testdriver = TestDriver(context, {
88
+ keepAlive: 300000, // Keep sandbox alive for 5 minutes after test
89
+ });
90
+ ```
91
+
92
+ ### Reconnecting to Existing Sandbox
93
+
94
+ Speed up test development by reconnecting to an existing sandbox instead of starting fresh each time. This lets you iterate quickly on failing steps without re-running the entire test from the beginning.
95
+
96
+ Split your test into two files: one for known-good steps that set up the desired state, and another for work-in-progress steps you want to debug.
97
+
98
+ ```javascript known-good.test.mjs
99
+ const testdriver = TestDriver(context, {
100
+ newSandbox: true,
101
+ headless: false,
102
+ keepAlive: 60000, // Keep sandbox alive for 60 seconds after test
103
+ });
104
+ ```
105
+
106
+ ```javascript work-in-progress.test.mjs
107
+ // Second test file: experiment.test.mjs (run within keepAlive window)
108
+ const testdriver = TestDriver(context, {
109
+ newSandbox: true,
110
+ headless: false,
111
+ reconnect: true, // Reconnect to existing sandbox
112
+ });
113
+ ```
114
+
115
+ Then, you can run both tests in sequence:
116
+
117
+ ```bash
118
+ npx vitest run -t known-good.test.mjs -t work-in-progress.test.mjs
119
+ ```
120
+
121
+ And as you make changes to `work-in-progress.test.mjs`, you can re-run just that file to quickly iterate on the failing steps.
122
+
123
+ ```bash
124
+ npx vitest run work-in-progress.test.mjs
125
+ ```
126
+
127
+ <Warning>
128
+ Reconnect only works if run within the `keepAlive` window of the previous test.
129
+ </Warning>
@@ -417,81 +417,3 @@ On Linux/Mac, Dashcam uses shell commands:
417
417
  // Unix-specific paths
418
418
  await dashcam.addFileLog('/tmp/testdriver.log', 'TestDriver Log');
419
419
  ```
420
-
421
- ## Troubleshooting
422
-
423
- ### No Replay URL Returned
424
-
425
- If `stop()` returns `null`:
426
-
427
- 1. Check that recording was started with `start()`
428
- 2. Verify authentication succeeded
429
- 3. Ensure dashcam CLI is installed in the environment
430
- 4. Check console output for error messages
431
-
432
- ### Recording Not Starting
433
-
434
- If recording doesn't start:
435
-
436
- 1. Verify API key is correct
437
- 2. Check `auth()` completed successfully
438
- 3. Ensure dashcam CLI is installed globally
439
- 4. Check `isRecording()` to verify state
440
-
441
- ### Logs Not Appearing
442
-
443
- If logs aren't visible in replay:
444
-
445
- 1. Add logs before calling `start()`
446
- 2. Verify log file paths are correct
447
- 3. Ensure log files exist and are accessible
448
- 4. Check file permissions
449
-
450
- ## Best Practices
451
-
452
- <AccordionGroup>
453
- <Accordion title="Always authenticate before starting">
454
- ```javascript
455
- await dashcam.auth();
456
- await dashcam.start();
457
- ```
458
- </Accordion>
459
-
460
- <Accordion title="Add logs before starting recording">
461
- ```javascript
462
- await dashcam.addFileLog('/tmp/app.log', 'App Log');
463
- await dashcam.start();
464
- ```
465
- </Accordion>
466
-
467
- <Accordion title="Always stop recording">
468
- Use try/finally to ensure recording stops:
469
-
470
- ```javascript
471
- try {
472
- await dashcam.start();
473
- // Test code
474
- } finally {
475
- await dashcam.stop();
476
- }
477
- ```
478
- </Accordion>
479
-
480
- <Accordion title="Check for replay URL">
481
- ```javascript
482
- const url = await dashcam.stop();
483
- if (url) {
484
- console.log('Replay:', url);
485
- } else {
486
- console.warn('No replay URL available');
487
- }
488
- ```
489
- </Accordion>
490
- </AccordionGroup>
491
-
492
- ## See Also
493
-
494
- - [Chrome Preset](/v7/presets/chrome) - Automatic Dashcam setup for web apps
495
- - [VS Code Extensions](/v7/presets/vscode) - Dashcam with VS Code testing
496
- - [Desktop Apps](/v7/presets/electron) - Dashcam with Electron apps
497
- - [Lifecycle Helpers](/v7/guides/lifecycle) - Prerun/postrun with Dashcam
@@ -95,8 +95,8 @@ expect(selectedText).toBe('TestDriver');
95
95
 
96
96
  ## Related Methods
97
97
 
98
- - [`click()`](/v7/api/click) - Single click on an element
99
- - [`rightClick()`](/v7/api/rightClick) - Right-click to open context menu
100
- - [`mouseDown()`](/v7/api/mouseDown) - Press mouse button without releasing
101
- - [`mouseUp()`](/v7/api/mouseUp) - Release mouse button
102
- - [`hover()`](/v7/api/hover) - Move mouse over element without clicking
98
+ - [`click()`](/v7/click) - Single click on an element
99
+ - [`rightClick()`](/v7/right-click) - Right-click to open context menu
100
+ - [`mouseDown()`](/v7/mouse-down) - Press mouse button without releasing
101
+ - [`mouseUp()`](/v7/mouse-up) - Release mouse button
102
+ - [`hover()`](/v7/hover) - Move mouse over element without clicking
@@ -496,47 +496,6 @@ const elementData = JSON.stringify(element);
496
496
  Use JSON serialization when you need to log element data or when debugging why an element wasn't found. The serialized output excludes large binary data (screenshots) and circular references.
497
497
  </Tip>
498
498
 
499
- ## Polling for Elements
500
-
501
- Use polling to wait for elements that may not be immediately visible:
502
-
503
- ```javascript
504
- // Poll until element appears
505
- let loginButton;
506
- const maxAttempts = 30;
507
-
508
- for (let i = 0; i < maxAttempts; i++) {
509
- loginButton = await testdriver.find('login button');
510
- if (loginButton.found()) break;
511
- await new Promise(resolve => setTimeout(resolve, 1000));
512
- }
513
-
514
- if (loginButton.found()) {
515
- await loginButton.click();
516
- } else {
517
- throw new Error('Login button never appeared');
518
- }
519
- ```
520
-
521
- **Helper function for polling:**
522
- ```javascript
523
- async function waitForElement(testdriver, description, timeout = 30000) {
524
- const startTime = Date.now();
525
-
526
- while (Date.now() - startTime < timeout) {
527
- const element = await testdriver.find(description);
528
- if (element.found()) return element;
529
- await new Promise(resolve => setTimeout(resolve, 1000));
530
- }
531
-
532
- throw new Error(`Element "${description}" not found after ${timeout}ms`);
533
- }
534
-
535
- // Usage
536
- const button = await waitForElement(testdriver, 'submit button', 10000);
537
- await button.click();
538
- ```
539
-
540
499
  ## Examples
541
500
 
542
501
  ### Basic Element Interaction
@@ -627,19 +586,7 @@ if (notification.found()) {
627
586
  await element.click();
628
587
  ```
629
588
  </Accordion>
630
-
631
- <Accordion title="Use polling for dynamic content">
632
- Don't assume elements are immediately visible:
633
-
634
- ```javascript
635
- let element;
636
- for (let i = 0; i < 30; i++) {
637
- element = await testdriver.find('loading complete message');
638
- if (element.found()) break;
639
- await new Promise(resolve => setTimeout(resolve, 1000));
640
- }
641
- ```
642
- </Accordion>
589
+
643
590
 
644
591
  <Accordion title="Reuse element references when possible">
645
592
  If you need to interact with the same element multiple times, reuse the reference:
@@ -0,0 +1,116 @@
1
+ ---
2
+ title: "Enterprise"
3
+ sidebarTitle: "Enterprise"
4
+ description: "Air-gapped security and full customization for demanding environments"
5
+ icon: "building"
6
+ ---
7
+
8
+
9
+ ## Why Enterprise?
10
+
11
+ <CardGroup cols={2}>
12
+ <Card title="Air-Gapped Security" icon="shield-check">
13
+ Deploy everything in your environment. No data leaves your network. Complete isolation from external services.
14
+ </Card>
15
+ <Card title="Full Customization" icon="gear">
16
+ Custom integrations, dedicated infrastructure, and tailored solutions for your unique requirements.
17
+ </Card>
18
+ <Card title="Self-Hosted Dashboard & API" icon="server">
19
+ Run the entire TestDriver stack — dashboard, API, and test infrastructure — within your own environment.
20
+ </Card>
21
+ <Card title="Dedicated Support" icon="headset">
22
+ Direct access to our engineering team for implementation, customization, and ongoing support.
23
+ </Card>
24
+ </CardGroup>
25
+
26
+ ## Who Needs Enterprise?
27
+
28
+ Enterprise is designed for organizations that:
29
+
30
+ - **Require air-gapped deployments** — Regulated industries, government, defense, or strict compliance requirements
31
+ - **Cannot use external APIs** — Data must never leave your network perimeter
32
+ - **Need custom integrations** — Unique CI/CD systems, internal tools, or specialized workflows
33
+ - **Want dedicated support** — Direct engineering support for complex implementations
34
+
35
+ ## What's Included
36
+
37
+ ### Fully Self-Hosted Stack
38
+
39
+ Unlike [Self-Hosted](/v7/self-hosted) (which uses TestDriver's hosted dashboard and API), Enterprise deploys everything in your environment:
40
+
41
+ | Component | Self-Hosted | Enterprise |
42
+ |-----------|-------------|------------|
43
+ | Test Sandboxes | Your infrastructure | Your infrastructure |
44
+ | Dashboard | TestDriver hosted | Your infrastructure |
45
+ | API | TestDriver hosted | Your infrastructure |
46
+ | AI Processing | Your API keys | Your infrastructure |
47
+ | Data Storage | Your AWS account | Your infrastructure |
48
+
49
+ ### Custom Contract Terms
50
+
51
+ - Volume-based pricing
52
+ - Custom SLAs
53
+ - Dedicated support channels
54
+ - Professional services for implementation
55
+ - Training for your team
56
+
57
+ ## Implementation Process
58
+
59
+ <Steps>
60
+ <Step title="Discovery Call">
61
+ Discuss your requirements, security constraints, and integration needs with our team.
62
+ </Step>
63
+
64
+ <Step title="Architecture Review">
65
+ Our engineers design a deployment architecture that meets your security and compliance requirements.
66
+ </Step>
67
+
68
+ <Step title="Deployment">
69
+ We work with your team to deploy TestDriver within your environment, including dashboard, API, and test infrastructure.
70
+ </Step>
71
+
72
+ <Step title="Integration">
73
+ Connect TestDriver to your CI/CD pipelines, internal tools, and workflows.
74
+ </Step>
75
+
76
+ <Step title="Training & Handoff">
77
+ Comprehensive training for your team on operating and maintaining the deployment.
78
+ </Step>
79
+ </Steps>
80
+
81
+ ## Security & Compliance
82
+
83
+ Enterprise deployments support:
84
+
85
+ - **SOC 2** compliance requirements
86
+ - **HIPAA** for healthcare applications
87
+ - **FedRAMP** for government deployments
88
+ - **PCI DSS** for payment processing
89
+ - **Custom compliance frameworks** as needed
90
+
91
+ <Note>
92
+ All data remains within your network perimeter. TestDriver has no access to your test results, application data, or infrastructure.
93
+ </Note>
94
+
95
+ ## Comparison: Self-Hosted vs Enterprise
96
+
97
+ | Feature | Self-Hosted | Enterprise |
98
+ |---------|-------------|------------|
99
+ | **Test Infrastructure** | Your AWS | Your infrastructure (any) |
100
+ | **Dashboard** | TestDriver cloud | Your infrastructure |
101
+ | **API** | TestDriver cloud | Your infrastructure |
102
+ | **Data Location** | Your AWS + TestDriver | 100% your infrastructure |
103
+ | **Network Requirements** | Internet access | Can be fully air-gapped |
104
+ | **Cloud Providers** | AWS only | Any (AWS, Azure, GCP, on-prem) |
105
+ | **Support** | Standard | Dedicated engineering |
106
+ | **Contract** | Standard licensing | Custom terms |
107
+
108
+ ## Get Started
109
+
110
+ <Card
111
+ title="Schedule a Consultation"
112
+ icon="calendar"
113
+ href="https://calendly.com/d/cq23-qyn-3v6/testdriver-ai-demo"
114
+ >
115
+ Discuss your requirements with our team and get a custom proposal for your Enterprise deployment.
116
+ </Card>
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: "Examples"
3
+ url: "https://github.com/testdriverai/testdriverai/tree/main/test/testdriver"
4
+ icon: 'code'
5
+ ---
@@ -341,6 +341,6 @@ describe('Code Execution', () => {
341
341
 
342
342
  ## Related Methods
343
343
 
344
- - [`focusApplication()`](/v7/api/focusApplication) - Focus apps before exec
345
- - [`find()`](/v7/api/find) - Locate elements (alternative to DOM manipulation)
346
- - [`type()`](/v7/api/type) - Type text (alternative to JS form filling)
344
+ - [`focusApplication()`](/v7/focus-application) - Focus apps before exec
345
+ - [`find()`](/v7/find) - Locate elements (alternative to DOM manipulation)
346
+ - [`type()`](/v7/type) - Type text (alternative to JS form filling)
@@ -101,7 +101,7 @@ The returned `Element` object provides:
101
101
  - `width`, `height` - Element dimensions
102
102
  - `boundingBox` - Complete bounding box
103
103
 
104
- See [Elements Reference](/v7/api/elements) for complete details.
104
+ See [Elements Reference](/v7/elements) for complete details.
105
105
 
106
106
  ### JSON Serialization
107
107
 
@@ -188,27 +188,23 @@ This is useful for:
188
188
 
189
189
  ## Polling for Dynamic Elements
190
190
 
191
- For elements that may not be immediately visible:
191
+ For elements that may not be immediately visible, use the `timeout` option to automatically poll:
192
192
 
193
193
  ```javascript
194
- // Poll until element appears
195
- let loginButton;
196
- const maxAttempts = 30;
197
-
198
- for (let i = 0; i < maxAttempts; i++) {
199
- loginButton = await testdriver.find('login button');
200
- if (loginButton.found()) break;
201
- await new Promise(r => setTimeout(r, 1000));
202
- }
194
+ // Poll for element (retries every 5 seconds until found or timeout)
195
+ const element = await testdriver.find('login button', { timeout: 30000 });
196
+ await element.click();
197
+ ```
203
198
 
204
- if (!loginButton.found()) {
205
- throw new Error('Login button never appeared');
206
- }
199
+ The `timeout` option:
200
+ - Retries finding the element every 5 seconds
201
+ - Stops when the element is found or the timeout expires
202
+ - Logs progress during polling
203
+ - Returns the element (check `element.found()` if not throwing on failure)
207
204
 
208
- await loginButton.click();
209
- ```
205
+ ### Manual Polling (Alternative)
210
206
 
211
- ### Helper Function
207
+ If you need custom polling logic:
212
208
 
213
209
  ```javascript
214
210
  async function waitForElement(testdriver, description, timeout = 30000) {
@@ -348,10 +344,10 @@ describe('Element Finding', () => {
348
344
 
349
345
  ## Related Methods
350
346
 
351
- - [`click()`](/v7/api/click) - Click on found elements
352
- - [`hover()`](/v7/api/hover) - Hover over elements
353
- - [`assert()`](/v7/api/assert) - Verify element states
354
- - [Elements Reference](/v7/api/elements) - Complete Element API
347
+ - [`click()`](/v7/click) - Click on found elements
348
+ - [`hover()`](/v7/hover) - Hover over elements
349
+ - [`assert()`](/v7/assert) - Verify element states
350
+ - [Elements Reference](/v7/elements) - Complete Element API
355
351
 
356
352
  ---
357
353
 
@@ -289,6 +289,6 @@ describe('Multi-Application Workflow', () => {
289
289
 
290
290
  ## Related Methods
291
291
 
292
- - [`exec()`](/v7/api/exec) - Launch applications with PowerShell
293
- - [`pressKeys()`](/v7/api/pressKeys) - Use Alt+Tab to switch windows
294
- - [`find()`](/v7/api/find) - Locate elements in the focused window
292
+ - [`exec()`](/v7/exec) - Launch applications with PowerShell
293
+ - [`pressKeys()`](/v7/press-keys) - Use Alt+Tab to switch windows
294
+ - [`find()`](/v7/find) - Locate elements in the focused window
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: "Generating Tests"
3
+ description: "Use AI coding agents and exploration mode to generate TestDriver tests"
4
+ icon: "wand-magic-sparkles"
5
+ ---
6
+
7
+ ## Instructions for Coding Agents
8
+
9
+ We recommend starting with [our quickstart](./quickstart) then supplying your coding agent with our agents.md file.
10
+
11
+ <Card title="Agents.md" icon="link" arrow="true" horizontal href="https://github.com/testdriverai/testdriverai/blob/main/agents.md?plain=1">
12
+ Copy the current version of agents.md to provide your coding agent with up-to-date instructions on how to generate TestDriver tests.
13
+ </Card>
14
+
15
+ Then, you can prompt your coding agent to generate tests. Here is an example prompt:
16
+
17
+ ```md
18
+ Make me a TestDriver test that does the following steps:
19
+
20
+ Navigate to practicetestautomation.com
21
+ Type username student into Username field
22
+ Type password Password123 into Password field
23
+ Push Submit button
24
+ Verify new page contains expected text 'logged in'
25
+ ```
26
+
27
+ ## AI Exploration Mode
28
+
29
+ Within a test, the `ai()` method lets TestDriver autonomously figure out how to accomplish a task. It's useful for dynamic or unpredictable UIs where explicit actions may be difficult to define.
30
+
31
+ ```javascript
32
+ // Handle dynamic or unpredictable UI
33
+ await testdriver.ai('dismiss any popups or modals that appear');
34
+ ```
35
+
36
+ <Info>Explicit commands are preferred for production tests, as they are cheaper, faster, and more reliable.</Info>
@@ -274,6 +274,6 @@ describe('Hover Interactions', () => {
274
274
 
275
275
  ## Related Methods
276
276
 
277
- - [`find()`](/v7/api/find) - Locate elements to hover
278
- - [`click()`](/v7/api/click) - Click after hovering
279
- - [`mouseDown()`](/v7/api/click) - Start drag operations
277
+ - [`find()`](/v7/find) - Locate elements to hover
278
+ - [`click()`](/v7/click) - Click after hovering
279
+ - [`mouseDown()`](/v7/click) - Start drag operations