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.
Files changed (142) hide show
  1. package/.github/workflows/publish.yaml +15 -7
  2. package/.github/workflows/testdriver.yml +163 -0
  3. package/.testdriver/last-sandbox +7 -0
  4. package/agent/events.js +1 -0
  5. package/agent/index.js +99 -163
  6. package/agent/lib/sandbox.js +11 -1
  7. package/agents.md +393 -0
  8. package/bin/testdriverai.js +8 -0
  9. package/debug/01-table-initial.png +0 -0
  10. package/debug/02-after-ai-explore.png +0 -0
  11. package/debug/02-after-scroll.png +0 -0
  12. package/debugger/index.html +37 -0
  13. package/docs/docs.json +93 -125
  14. package/docs/v7/_drafts/architecture.mdx +1 -26
  15. package/docs/v7/_drafts/caching.mdx +2 -2
  16. package/docs/v7/{getting-started → _drafts}/installation.mdx +0 -66
  17. package/docs/v7/{features/coverage.mdx → _drafts/powerful.mdx} +1 -90
  18. package/docs/v7/_drafts/quick-start-test-recording.mdx +0 -1
  19. package/docs/v7/{features → _drafts}/scalable.mdx +126 -4
  20. package/docs/v7/_drafts/screenshot.mdx +155 -0
  21. package/docs/v7/_drafts/test-recording.mdx +0 -6
  22. package/docs/v7/_drafts/writing-tests.mdx +25 -0
  23. package/docs/v7/{api/act.mdx → ai.mdx} +28 -27
  24. package/docs/v7/{api/assert.mdx → assert.mdx} +3 -3
  25. package/docs/v7/aws-setup.mdx +338 -0
  26. package/docs/v7/caching.mdx +128 -0
  27. package/docs/v7/ci-cd.mdx +605 -0
  28. package/docs/v7/{api/click.mdx → click.mdx} +4 -4
  29. package/docs/v7/cloud.mdx +120 -0
  30. package/docs/v7/customizing-devices.mdx +129 -0
  31. package/docs/v7/{api/doubleClick.mdx → double-click.mdx} +5 -5
  32. package/docs/v7/enterprise.mdx +135 -0
  33. package/docs/v7/examples.mdx +5 -0
  34. package/docs/v7/{api/exec.mdx → exec.mdx} +3 -3
  35. package/docs/v7/{api/find.mdx → find.mdx} +17 -21
  36. package/docs/v7/{api/focusApplication.mdx → focus-application.mdx} +3 -3
  37. package/docs/v7/generating-tests.mdx +32 -0
  38. package/docs/v7/{api/hover.mdx → hover.mdx} +3 -3
  39. package/docs/v7/locating-elements.mdx +71 -0
  40. package/docs/v7/making-assertions.mdx +32 -0
  41. package/docs/v7/{api/mouseDown.mdx → mouse-down.mdx} +7 -7
  42. package/docs/v7/{api/mouseUp.mdx → mouse-up.mdx} +8 -8
  43. package/docs/v7/performing-actions.mdx +51 -0
  44. package/docs/v7/{api/pressKeys.mdx → press-keys.mdx} +3 -3
  45. package/docs/v7/quickstart.mdx +162 -0
  46. package/docs/v7/reusable-code.mdx +240 -0
  47. package/docs/v7/{api/rightClick.mdx → right-click.mdx} +5 -5
  48. package/docs/v7/running-tests.mdx +181 -0
  49. package/docs/v7/{api/scroll.mdx → scroll.mdx} +3 -3
  50. package/docs/v7/secrets.mdx +115 -0
  51. package/docs/v7/self-hosted.mdx +66 -0
  52. package/docs/v7/{api/type.mdx → type.mdx} +3 -3
  53. package/docs/v7/variables.mdx +111 -0
  54. package/docs/v7/waiting-for-elements.mdx +66 -0
  55. package/docs/v7/what-is-testdriver.mdx +54 -0
  56. package/interfaces/cli/commands/init.js +33 -19
  57. package/interfaces/cli/lib/base.js +24 -0
  58. package/interfaces/cli.js +8 -1
  59. package/interfaces/logger.js +8 -3
  60. package/interfaces/vitest-plugin.mjs +16 -71
  61. package/lib/sentry.js +343 -0
  62. package/lib/vitest/hooks.mjs +81 -81
  63. package/package.json +4 -3
  64. package/sdk-log-formatter.js +41 -0
  65. package/sdk.d.ts +22 -9
  66. package/sdk.js +344 -100
  67. package/test/manual/reconnect-provision.test.mjs +49 -0
  68. package/test/manual/reconnect-signin.test.mjs +41 -0
  69. package/test/testdriver/act.test.mjs +30 -0
  70. package/test/testdriver/ai.test.mjs +30 -0
  71. package/test/testdriver/assert.test.mjs +1 -1
  72. package/test/testdriver/hover-text.test.mjs +1 -1
  73. package/test/testdriver/setup/testHelpers.mjs +8 -119
  74. package/test/testdriver/windows-installer.test.mjs +61 -0
  75. package/tests/example.test.js +33 -0
  76. package/tests/login.js +28 -0
  77. package/tests/table-sort-enrollments.test.mjs +72 -0
  78. package/tests/table-sort-experiment.test.mjs +42 -0
  79. package/tests/table-sort-setup.test.mjs +59 -0
  80. package/vitest.config.mjs +3 -1
  81. package/agent/lib/cache.js +0 -142
  82. package/docs/v7/api/assertions.mdx +0 -403
  83. package/docs/v7/features/ai-native.mdx +0 -413
  84. package/docs/v7/features/application-logs.mdx +0 -353
  85. package/docs/v7/features/browser-logs.mdx +0 -414
  86. package/docs/v7/features/cache-management.mdx +0 -402
  87. package/docs/v7/features/continuous-testing.mdx +0 -346
  88. package/docs/v7/features/data-driven-testing.mdx +0 -441
  89. package/docs/v7/features/easy-to-write.mdx +0 -280
  90. package/docs/v7/features/enterprise.mdx +0 -656
  91. package/docs/v7/features/fast.mdx +0 -406
  92. package/docs/v7/features/managed-sandboxes.mdx +0 -384
  93. package/docs/v7/features/network-monitoring.mdx +0 -568
  94. package/docs/v7/features/parallel-execution.mdx +0 -381
  95. package/docs/v7/features/powerful.mdx +0 -531
  96. package/docs/v7/features/sandbox-customization.mdx +0 -229
  97. package/docs/v7/features/stable.mdx +0 -473
  98. package/docs/v7/features/system-performance.mdx +0 -616
  99. package/docs/v7/features/test-analytics.mdx +0 -373
  100. package/docs/v7/features/test-cases.mdx +0 -393
  101. package/docs/v7/features/test-replays.mdx +0 -408
  102. package/docs/v7/features/test-reports.mdx +0 -308
  103. package/docs/v7/getting-started/debugging-tests.mdx +0 -382
  104. package/docs/v7/getting-started/quickstart.mdx +0 -90
  105. package/docs/v7/getting-started/running-tests.mdx +0 -173
  106. package/docs/v7/getting-started/setting-up-in-ci.mdx +0 -612
  107. package/docs/v7/getting-started/writing-tests.mdx +0 -534
  108. package/docs/v7/overview/what-is-testdriver.mdx +0 -386
  109. package/docs/v7/presets/chrome-extension.mdx +0 -248
  110. package/docs/v7/presets/chrome.mdx +0 -300
  111. package/docs/v7/presets/electron.mdx +0 -460
  112. package/docs/v7/presets/vscode.mdx +0 -417
  113. package/docs/v7/presets/webapp.mdx +0 -393
  114. /package/docs/v7/{commands → _drafts/commands}/assert.mdx +0 -0
  115. /package/docs/v7/{commands → _drafts/commands}/exec.mdx +0 -0
  116. /package/docs/v7/{commands → _drafts/commands}/focus-application.mdx +0 -0
  117. /package/docs/v7/{commands → _drafts/commands}/hover-image.mdx +0 -0
  118. /package/docs/v7/{commands → _drafts/commands}/hover-text.mdx +0 -0
  119. /package/docs/v7/{commands → _drafts/commands}/if.mdx +0 -0
  120. /package/docs/v7/{commands → _drafts/commands}/match-image.mdx +0 -0
  121. /package/docs/v7/{commands → _drafts/commands}/press-keys.mdx +0 -0
  122. /package/docs/v7/{commands → _drafts/commands}/remember.mdx +0 -0
  123. /package/docs/v7/{commands → _drafts/commands}/run.mdx +0 -0
  124. /package/docs/v7/{commands → _drafts/commands}/scroll-until-image.mdx +0 -0
  125. /package/docs/v7/{commands → _drafts/commands}/scroll-until-text.mdx +0 -0
  126. /package/docs/v7/{commands → _drafts/commands}/scroll.mdx +0 -0
  127. /package/docs/v7/{commands → _drafts/commands}/type.mdx +0 -0
  128. /package/docs/v7/{commands → _drafts/commands}/wait-for-image.mdx +0 -0
  129. /package/docs/v7/{commands → _drafts/commands}/wait-for-text.mdx +0 -0
  130. /package/docs/v7/{commands → _drafts/commands}/wait.mdx +0 -0
  131. /package/docs/v7/{getting-started → _drafts}/configuration.mdx +0 -0
  132. /package/docs/v7/{features → _drafts}/observable.mdx +0 -0
  133. /package/docs/v7/{platforms → _drafts/platforms}/linux.mdx +0 -0
  134. /package/docs/v7/{platforms → _drafts/platforms}/macos.mdx +0 -0
  135. /package/docs/v7/{platforms → _drafts/platforms}/windows.mdx +0 -0
  136. /package/docs/v7/{playwright.mdx → _drafts/playwright.mdx} +0 -0
  137. /package/docs/v7/{overview → _drafts}/readme.mdx +0 -0
  138. /package/docs/v7/{features → _drafts}/reports.mdx +0 -0
  139. /package/docs/v7/{api/client.mdx → client.mdx} +0 -0
  140. /package/docs/v7/{api/dashcam.mdx → dashcam.mdx} +0 -0
  141. /package/docs/v7/{api/elements.mdx → elements.mdx} +0 -0
  142. /package/docs/v7/{api/sandbox.mdx → sandbox.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>
@@ -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
@@ -0,0 +1,135 @@
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>
117
+
118
+ ## Related
119
+
120
+ <CardGroup cols={2}>
121
+ <Card
122
+ title="Cloud"
123
+ icon="cloud"
124
+ href="/v7/cloud"
125
+ >
126
+ Zero-setup testing with device-seconds billing
127
+ </Card>
128
+ <Card
129
+ title="Self-Hosted"
130
+ icon="server"
131
+ href="/v7/self-hosted"
132
+ >
133
+ Flat-rate licensing with your AWS infrastructure
134
+ </Card>
135
+ </CardGroup>
@@ -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,32 @@
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](https://github.com/testdriverai/testdriverai/agents.md) file.
10
+
11
+ Then, you can prompt your coding agent to generate tests:
12
+
13
+ ```md
14
+ Make me a TestDriver test that does the following steps:
15
+
16
+ Navigate to practicetestautomation.com
17
+ Type username student into Username field
18
+ Type password Password123 into Password field
19
+ Push Submit button
20
+ Verify new page contains expected text 'logged in'
21
+ ```
22
+
23
+ ## AI Exploration Mode
24
+
25
+ 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.
26
+
27
+ ```javascript
28
+ // Handle dynamic or unpredictable UI
29
+ await testdriver.ai('dismiss any popups or modals that appear');
30
+ ```
31
+
32
+ <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
@@ -0,0 +1,71 @@
1
+ ---
2
+ title: "Locating Elements"
3
+ description: "Find UI elements using natural language descriptions"
4
+ icon: "crosshairs"
5
+ ---
6
+
7
+ ## Locating Single Elements
8
+
9
+ Use natural language to describe elements. Descriptions should be specific enough to locate the element, but not too-specific that they break with minor UI changes. For example:
10
+
11
+ ```javascript
12
+ await testdriver.find('email input field');
13
+ await testdriver.find('first product card in the grid');
14
+ await testdriver.find('dropdown menu labeled "Country"');
15
+ ```
16
+
17
+ <Info>TestDriver will cache found elements for improved performance on subsequent calls. Learn more about [element caching here](/v7/caching).</Info>
18
+
19
+ ## Debugging Found Elements
20
+
21
+ After finding an element, you can inspect its properties for debugging:
22
+
23
+ ```javascript
24
+ const button = await testdriver.find('submit button');
25
+ console.log(button);
26
+ ```
27
+
28
+ This outputs all element properties:
29
+
30
+ ```javascript
31
+ {
32
+ description: 'submit button',
33
+ found: true,
34
+ x: 150,
35
+ y: 300,
36
+ coordinates: { x: 150, y: 300, centerX: 200, centerY: 320 },
37
+ threshold: 0.8,
38
+ confidence: 0.95,
39
+ similarity: 0.92,
40
+ selector: 'button[type="submit"]',
41
+ cache: {
42
+ hit: true,
43
+ strategy: 'pixel-diff',
44
+ createdAt: '2025-01-15T10:30:00Z',
45
+ diffPercent: 0.02,
46
+ imageUrl: 'https://...'
47
+ }
48
+ }
49
+ ```
50
+
51
+ ## Working with Multiple Elements
52
+
53
+ Find and interact with multiple elements:
54
+
55
+ ```javascript
56
+ // Find all matching elements
57
+ const products = await testdriver.findAll('product card');
58
+ console.log(`Found ${products.length} products`);
59
+
60
+ // Interact with each
61
+ for (const product of products) {
62
+ const title = await product.find('title text');
63
+ console.log('Product:', title.text);
64
+
65
+ await product.find('add to cart button').click();
66
+ }
67
+
68
+ // Or find specific element
69
+ const firstProduct = products[0];
70
+ await firstProduct.click();
71
+ ```
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: "Making Assertions"
3
+ description: "Verify application state with AI-powered assertions"
4
+ icon: "check-double"
5
+ ---
6
+
7
+ ## Making Assertions
8
+
9
+ Use AI-powered assertions to verify application state:
10
+
11
+ ```javascript
12
+ // Verify visibility
13
+ await testdriver.assert('login page is displayed');
14
+ await testdriver.assert('submit button is visible');
15
+ await testdriver.assert('loading spinner is not visible');
16
+
17
+ // Verify content
18
+ await testdriver.assert('page title is "Welcome"');
19
+ await testdriver.assert('success message says "Account created"');
20
+ await testdriver.assert('error message contains "Invalid email"');
21
+
22
+ // Verify state
23
+ await testdriver.assert('checkbox is checked');
24
+ await testdriver.assert('dropdown shows "United States"');
25
+ await testdriver.assert('button is disabled');
26
+
27
+ // Verify visual appearance
28
+ await testdriver.assert('submit button is blue');
29
+ await testdriver.assert('form has red border');
30
+ ```
31
+
32
+ <Info>Assertions are not cached and always re-evaluated to ensure accuracy.</Info>
@@ -147,15 +147,15 @@ test('resizes panel', async () => {
147
147
 
148
148
  ## Important Notes
149
149
 
150
- - Always pair `mouseDown()` with [`mouseUp()`](/v7/api/mouseUp) to complete the gesture
150
+ - Always pair `mouseDown()` with [`mouseUp()`](/v7/mouse-up) to complete the gesture
151
151
  - The mouse button remains pressed until `mouseUp()` is called
152
- - Use [`hover()`](/v7/api/hover) to move the mouse while the button is pressed
152
+ - Use [`hover()`](/v7/hover) to move the mouse while the button is pressed
153
153
  - For simple drag operations, consider using `ai()` with a natural language description like `"drag file to folder"`
154
154
 
155
155
  ## Related Methods
156
156
 
157
- - [`mouseUp()`](/v7/api/mouseUp) - Release the mouse button
158
- - [`hover()`](/v7/api/hover) - Move mouse to element
159
- - [`click()`](/v7/api/click) - Full click (mouseDown + mouseUp)
160
- - [`doubleClick()`](/v7/api/doubleClick) - Double-click on element
161
- - [`rightClick()`](/v7/api/rightClick) - Right-click for context menu
157
+ - [`mouseUp()`](/v7/mouse-up) - Release the mouse button
158
+ - [`hover()`](/v7/hover) - Move mouse to element
159
+ - [`click()`](/v7/click) - Full click (mouseDown + mouseUp)
160
+ - [`doubleClick()`](/v7/double-click) - Double-click on element
161
+ - [`rightClick()`](/v7/right-click) - Right-click for context menu