testdriverai 7.3.12 → 7.3.13

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 (133) hide show
  1. package/.github/skills/testdriver:ai/SKILL.md +204 -0
  2. package/.github/skills/testdriver:assert/SKILL.md +284 -0
  3. package/.github/skills/testdriver:aws-setup/SKILL.md +515 -0
  4. package/.github/skills/testdriver:caching/SKILL.md +124 -0
  5. package/.github/skills/testdriver:captcha/SKILL.md +159 -0
  6. package/.github/skills/testdriver:ci-cd/SKILL.md +602 -0
  7. package/.github/skills/testdriver:click/SKILL.md +286 -0
  8. package/.github/skills/testdriver:client/SKILL.md +339 -0
  9. package/.github/skills/testdriver:cloud/SKILL.md +119 -0
  10. package/.github/skills/testdriver:customizing-devices/SKILL.md +153 -0
  11. package/.github/skills/testdriver:dashcam/SKILL.md +418 -0
  12. package/.github/skills/testdriver:debugging-with-screenshots/SKILL.md +271 -0
  13. package/.github/skills/testdriver:device-config/SKILL.md +317 -0
  14. package/.github/skills/testdriver:double-click/SKILL.md +102 -0
  15. package/.github/skills/testdriver:elements/SKILL.md +605 -0
  16. package/.github/skills/testdriver:enterprise/SKILL.md +114 -0
  17. package/.github/skills/testdriver:examples/SKILL.md +7 -0
  18. package/.github/skills/testdriver:exec/SKILL.md +345 -0
  19. package/.github/skills/testdriver:find/SKILL.md +721 -0
  20. package/.github/skills/testdriver:focus-application/SKILL.md +293 -0
  21. package/.github/skills/testdriver:generating-tests/SKILL.md +36 -0
  22. package/.github/skills/testdriver:hover/SKILL.md +278 -0
  23. package/.github/skills/testdriver:locating-elements/SKILL.md +71 -0
  24. package/.github/skills/testdriver:making-assertions/SKILL.md +32 -0
  25. package/.github/skills/testdriver:mcp-workflow/SKILL.md +410 -0
  26. package/.github/skills/testdriver:mouse-down/SKILL.md +161 -0
  27. package/.github/skills/testdriver:mouse-up/SKILL.md +164 -0
  28. package/.github/skills/testdriver:performing-actions/SKILL.md +51 -0
  29. package/.github/skills/testdriver:press-keys/SKILL.md +348 -0
  30. package/.github/skills/testdriver:quickstart/SKILL.md +161 -0
  31. package/.github/skills/testdriver:reusable-code/SKILL.md +240 -0
  32. package/.github/skills/testdriver:right-click/SKILL.md +123 -0
  33. package/.github/skills/testdriver:running-tests/SKILL.md +181 -0
  34. package/.github/skills/testdriver:screenshot/SKILL.md +167 -0
  35. package/.github/skills/testdriver:scroll/SKILL.md +299 -0
  36. package/.github/skills/testdriver:secrets/SKILL.md +115 -0
  37. package/.github/skills/testdriver:self-hosted/SKILL.md +65 -0
  38. package/.github/skills/testdriver:test-writer/SKILL.md +451 -0
  39. package/.github/skills/testdriver:testdriver/SKILL.md +523 -0
  40. package/.github/skills/testdriver:testdriver-mechanic/SKILL.md +165 -0
  41. package/.github/skills/testdriver:type/SKILL.md +357 -0
  42. package/.github/skills/testdriver:variables/SKILL.md +111 -0
  43. package/.github/skills/testdriver:waiting-for-elements/SKILL.md +66 -0
  44. package/.github/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
  45. package/.github/workflows/acceptance-windows-scheduled.yaml +6 -1
  46. package/.github/workflows/acceptance.yaml +0 -36
  47. package/.github/workflows/update-examples.yaml +53 -0
  48. package/CHANGELOG.md +4 -0
  49. package/agent/events.js +1 -0
  50. package/agent/index.js +8 -0
  51. package/agent/lib/commands.js +48 -29
  52. package/agent/lib/redraw.js +3 -1
  53. package/agent/lib/sandbox.js +166 -14
  54. package/agent/lib/sdk.js +142 -3
  55. package/agent/lib/system.js +4 -6
  56. package/ai/skills/testdriver:ai/SKILL.md +204 -0
  57. package/ai/skills/testdriver:assert/SKILL.md +315 -0
  58. package/ai/skills/testdriver:aws-setup/SKILL.md +448 -0
  59. package/ai/skills/testdriver:caching/SKILL.md +124 -0
  60. package/ai/skills/testdriver:captcha/SKILL.md +159 -0
  61. package/ai/skills/testdriver:ci-cd/SKILL.md +602 -0
  62. package/ai/skills/testdriver:click/SKILL.md +286 -0
  63. package/ai/skills/testdriver:client/SKILL.md +372 -0
  64. package/ai/skills/testdriver:cloud/SKILL.md +119 -0
  65. package/ai/skills/testdriver:customizing-devices/SKILL.md +153 -0
  66. package/ai/skills/testdriver:dashcam/SKILL.md +418 -0
  67. package/ai/skills/testdriver:debugging-with-screenshots/SKILL.md +401 -0
  68. package/ai/skills/testdriver:device-config/SKILL.md +317 -0
  69. package/ai/skills/testdriver:double-click/SKILL.md +102 -0
  70. package/ai/skills/testdriver:elements/SKILL.md +605 -0
  71. package/ai/skills/testdriver:enterprise/SKILL.md +114 -0
  72. package/ai/skills/testdriver:examples/SKILL.md +7 -0
  73. package/ai/skills/testdriver:exec/SKILL.md +345 -0
  74. package/ai/skills/testdriver:find/SKILL.md +745 -0
  75. package/ai/skills/testdriver:focus-application/SKILL.md +293 -0
  76. package/ai/skills/testdriver:generating-tests/SKILL.md +36 -0
  77. package/ai/skills/testdriver:hover/SKILL.md +278 -0
  78. package/ai/skills/testdriver:locating-elements/SKILL.md +71 -0
  79. package/ai/skills/testdriver:making-assertions/SKILL.md +32 -0
  80. package/ai/skills/testdriver:mcp-workflow/SKILL.md +410 -0
  81. package/ai/skills/testdriver:mouse-down/SKILL.md +161 -0
  82. package/ai/skills/testdriver:mouse-up/SKILL.md +164 -0
  83. package/ai/skills/testdriver:ocr/SKILL.md +235 -0
  84. package/ai/skills/testdriver:performing-actions/SKILL.md +51 -0
  85. package/ai/skills/testdriver:press-keys/SKILL.md +348 -0
  86. package/ai/skills/testdriver:quickstart/SKILL.md +146 -0
  87. package/ai/skills/testdriver:reusable-code/SKILL.md +240 -0
  88. package/ai/skills/testdriver:right-click/SKILL.md +123 -0
  89. package/ai/skills/testdriver:running-tests/SKILL.md +185 -0
  90. package/ai/skills/testdriver:screenshot/SKILL.md +248 -0
  91. package/ai/skills/testdriver:scroll/SKILL.md +335 -0
  92. package/ai/skills/testdriver:secrets/SKILL.md +115 -0
  93. package/ai/skills/testdriver:self-hosted/SKILL.md +65 -0
  94. package/ai/skills/testdriver:test-writer/SKILL.md +451 -0
  95. package/ai/skills/testdriver:testdriver/SKILL.md +631 -0
  96. package/ai/skills/testdriver:testdriver-mechanic/SKILL.md +165 -0
  97. package/ai/skills/testdriver:type/SKILL.md +357 -0
  98. package/ai/skills/testdriver:variables/SKILL.md +111 -0
  99. package/ai/skills/testdriver:waiting-for-elements/SKILL.md +66 -0
  100. package/ai/skills/testdriver:what-is-testdriver/SKILL.md +54 -0
  101. package/debugger/index.html +12 -2
  102. package/docs/v7/examples/scroll-keyboard.mdx +1 -1
  103. package/docs/v7/find.mdx +1 -0
  104. package/examples/config.mjs +1 -1
  105. package/examples/findall-coffee-icons.test.mjs +42 -0
  106. package/examples/flake-diffthreshold-001.test.mjs +9 -0
  107. package/examples/flake-diffthreshold-01.test.mjs +9 -0
  108. package/examples/flake-diffthreshold-05.test.mjs +9 -0
  109. package/examples/{z_flake-noredraw-cache.test.mjs → flake-noredraw-cache.test.mjs} +2 -2
  110. package/examples/{z_flake-noredraw-nocache.test.mjs → flake-noredraw-nocache.test.mjs} +2 -2
  111. package/examples/{z_flake-redraw-cache.test.mjs → flake-redraw-cache.test.mjs} +2 -2
  112. package/examples/{z_flake-redraw-nocache.test.mjs → flake-redraw-nocache.test.mjs} +2 -2
  113. package/examples/flake-rocket-match.test.mjs +30 -0
  114. package/examples/{z_flake-shared.mjs → flake-shared.mjs} +2 -2
  115. package/examples/parse.test.mjs +19 -0
  116. package/examples/scroll-keyboard.test.mjs +1 -1
  117. package/interfaces/cli/lib/base.js +6 -0
  118. package/interfaces/logger.js +51 -13
  119. package/interfaces/vitest-plugin.mjs +137 -0
  120. package/lib/core/index.d.ts +22 -0
  121. package/lib/init-project.js +105 -6
  122. package/lib/vitest/hooks.mjs +2 -5
  123. package/lib/vitest/setup-disable-defender.mjs +52 -0
  124. package/package.json +2 -1
  125. package/sdk-log-formatter.js +90 -0
  126. package/sdk.d.ts +88 -51
  127. package/sdk.js +126 -18
  128. package/setup/aws/disable-defender.sh +42 -0
  129. package/vitest.config.mjs +1 -3
  130. package/examples/z_flake-diffthreshold-001.test.mjs +0 -9
  131. package/examples/z_flake-diffthreshold-01.test.mjs +0 -9
  132. package/examples/z_flake-diffthreshold-05.test.mjs +0 -9
  133. /package/{examples → manual}/captcha-api.test.mjs +0 -0
@@ -0,0 +1,317 @@
1
+ ---
2
+ name: testdriver:device-config
3
+ description: Launch browsers, desktop apps, and extensions in your TestDriver sandbox
4
+ ---
5
+ <!-- Generated from device-config.mdx. DO NOT EDIT. -->
6
+
7
+ Provision methods are the starting point for most tests. They launch applications in your sandbox and prepare the environment for testing.
8
+
9
+ ## Chrome Browser
10
+
11
+ The most common starting point for web testing. Launches Chrome browser and navigates to a URL.
12
+
13
+ ```javascript
14
+ await testdriver.provision.chrome({
15
+ url: 'https://example.com',
16
+ });
17
+ ```
18
+
19
+ ### Options
20
+
21
+ | Option | Type | Default | Description |
22
+ |--------|------|---------|-------------|
23
+ | `url` | string | `'http://testdriver-sandbox.vercel.app/'` | URL to navigate to |
24
+ | `maximized` | boolean | `true` | Start browser maximized |
25
+ | `guest` | boolean | `false` | Use guest mode (no profile) |
26
+
27
+ ### Example: Basic Web Test
28
+
29
+ ```javascript
30
+ import { describe, expect, it } from "vitest";
31
+ import { TestDriver } from "testdriverai/lib/vitest/hooks.mjs";
32
+
33
+ describe("Login Flow", () => {
34
+ it("should log in successfully", async (context) => {
35
+ const testdriver = TestDriver(context);
36
+
37
+ await testdriver.provision.chrome({
38
+ url: 'https://myapp.com/login',
39
+ });
40
+
41
+ await testdriver.find("Email input").click();
42
+ await testdriver.type("user@example.com");
43
+
44
+ await testdriver.find("Password input").click();
45
+ await testdriver.type("password123");
46
+
47
+ await testdriver.find("Sign In button").click();
48
+
49
+ const result = await testdriver.assert("the dashboard is visible");
50
+ expect(result).toBeTruthy();
51
+ });
52
+ });
53
+ ```
54
+
55
+ <Info>
56
+ `provision.chrome()` automatically starts Dashcam recording and waits for Chrome to be ready before returning.
57
+ </Info>
58
+
59
+ ---
60
+
61
+ ## Chrome Extensions
62
+
63
+ Launch Chrome with a custom extension loaded. Supports both local extensions and Chrome Web Store extensions.
64
+
65
+ ### Load from Local Path
66
+
67
+ Clone or create an extension locally, then load it:
68
+
69
+ ```javascript
70
+ // First, get the extension onto the sandbox
71
+ await testdriver.exec(
72
+ 'sh',
73
+ 'git clone https://github.com/user/my-extension.git /tmp/my-extension',
74
+ 60000
75
+ );
76
+
77
+ // Launch Chrome with the extension
78
+ await testdriver.provision.chromeExtension({
79
+ extensionPath: '/tmp/my-extension',
80
+ url: 'https://example.com'
81
+ });
82
+ ```
83
+
84
+ ### Load from Chrome Web Store
85
+
86
+ Load any published extension by its Chrome Web Store ID:
87
+
88
+ ```javascript
89
+ await testdriver.provision.chromeExtension({
90
+ extensionId: 'cjpalhdlnbpafiamejdnhcphjbkeiagm', // uBlock Origin
91
+ url: 'https://example.com'
92
+ });
93
+ ```
94
+
95
+ <Tip>
96
+ Find the extension ID in the Chrome Web Store URL. For example, `https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm` → ID is `cjpalhdlnbpafiamejdnhcphjbkeiagm`
97
+ </Tip>
98
+
99
+ ### Options
100
+
101
+ | Option | Type | Default | Description |
102
+ |--------|------|---------|-------------|
103
+ | `extensionPath` | string | - | Local path to unpacked extension directory |
104
+ | `extensionId` | string | - | Chrome Web Store extension ID |
105
+ | `url` | string | - | URL to navigate to after launch |
106
+ | `maximized` | boolean | `true` | Start browser maximized |
107
+
108
+ <Warning>
109
+ You must provide either `extensionPath` or `extensionId`, but not both.
110
+ </Warning>
111
+
112
+ ### Example: Testing a Chrome Extension
113
+
114
+ ```javascript
115
+ import { describe, expect, it } from "vitest";
116
+ import { TestDriver } from "testdriverai/lib/vitest/hooks.mjs";
117
+
118
+ describe("Chrome Extension Test", () => {
119
+ it("should load and interact with extension", async (context) => {
120
+ const testdriver = TestDriver(context);
121
+
122
+ // Clone extension from GitHub
123
+ await testdriver.exec(
124
+ 'sh',
125
+ 'git clone https://github.com/user/my-extension.git /tmp/my-extension',
126
+ 60000,
127
+ true
128
+ );
129
+
130
+ // Launch Chrome with extension loaded
131
+ await testdriver.provision.chromeExtension({
132
+ extensionPath: '/tmp/my-extension',
133
+ url: 'https://testdriver.ai'
134
+ });
135
+
136
+ // Click extensions puzzle icon
137
+ const extensionsButton = await testdriver.find("puzzle-shaped icon in Chrome toolbar");
138
+ await extensionsButton.click();
139
+
140
+ // Interact with your extension
141
+ const myExtension = await testdriver.find("My Extension in the dropdown");
142
+ await myExtension.click();
143
+
144
+ const result = await testdriver.assert("extension popup is visible");
145
+ expect(result).toBeTruthy();
146
+ });
147
+ });
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Desktop Apps
153
+
154
+ Download and install desktop applications. Supports `.deb`, `.rpm`, `.msi`, `.exe`, `.AppImage`, `.dmg`, `.pkg`, and shell scripts.
155
+
156
+ ```javascript
157
+ const filePath = await testdriver.provision.installer({
158
+ url: 'https://example.com/app.deb',
159
+ appName: 'MyApp', // Focus this app after install
160
+ launch: true, // Auto-launch after install
161
+ });
162
+ ```
163
+
164
+ ### Options
165
+
166
+ | Option | Type | Default | Description |
167
+ |--------|------|---------|-------------|
168
+ | `url` | string | **required** | URL to download the installer from |
169
+ | `filename` | string | auto-detected | Filename to save as |
170
+ | `appName` | string | - | Application name to focus after install |
171
+ | `launch` | boolean | `true` | Launch the app after installation |
172
+
173
+ ### Supported File Types
174
+
175
+ | Extension | OS | Install Method |
176
+ |-----------|-----|----------------|
177
+ | `.deb` | Linux | `dpkg -i` + `apt-get install -f` |
178
+ | `.rpm` | Linux | `rpm -i` |
179
+ | `.AppImage` | Linux | `chmod +x` |
180
+ | `.sh` | Linux | `chmod +x` + execute |
181
+ | `.msi` | Windows | `msiexec /i /quiet` |
182
+ | `.exe` | Windows | Silent install (`/S`) |
183
+ | `.dmg` | macOS | Mount + copy to Applications |
184
+ | `.pkg` | macOS | `installer -pkg` |
185
+
186
+ ### Example: Install and Test a Desktop App
187
+
188
+ ```javascript
189
+ import { describe, expect, it } from "vitest";
190
+ import { TestDriver } from "testdriverai/lib/vitest/hooks.mjs";
191
+
192
+ describe("Desktop App Test", () => {
193
+ it("should install and launch app", async (context) => {
194
+ const testdriver = TestDriver(context);
195
+
196
+ // Download and install
197
+ const installerPath = await testdriver.provision.installer({
198
+ url: 'https://github.com/sharkdp/bat/releases/download/v0.24.0/bat_0.24.0_amd64.deb',
199
+ });
200
+
201
+ // Verify installation
202
+ const output = await testdriver.exec('sh', 'bat --version', 5000);
203
+ expect(output).toContain('bat');
204
+ });
205
+ });
206
+ ```
207
+
208
+ ### Example: Windows Installer
209
+
210
+ ```javascript
211
+ import { describe, expect, it } from "vitest";
212
+ import { TestDriver } from "testdriverai/lib/vitest/hooks.mjs";
213
+
214
+ describe("Windows App Test", () => {
215
+ it("should install on Windows", async (context) => {
216
+ const testdriver = TestDriver(context, {
217
+ os: 'windows'
218
+ });
219
+
220
+ // Download MSI installer
221
+ const installerPath = await testdriver.provision.installer({
222
+ url: 'https://example.com/app.msi',
223
+ launch: false, // Don't auto-launch
224
+ });
225
+
226
+ // Custom installation if needed
227
+ await testdriver.exec(
228
+ 'pwsh',
229
+ `Start-Process msiexec.exe -ArgumentList "/i", "${installerPath}", "/qn" -Wait`,
230
+ 120000
231
+ );
232
+
233
+ // Verify installation
234
+ const result = await testdriver.assert("application is installed");
235
+ expect(result).toBeTruthy();
236
+ });
237
+ });
238
+ ```
239
+
240
+ ### Manual Installation
241
+
242
+ Set `launch: false` to download without auto-installing:
243
+
244
+ ```javascript
245
+ const filePath = await testdriver.provision.installer({
246
+ url: 'https://example.com/custom-script.sh',
247
+ launch: false,
248
+ });
249
+
250
+ // Run custom install commands
251
+ await testdriver.exec('sh', `chmod +x "${filePath}"`, 5000);
252
+ await testdriver.exec('sh', `"${filePath}" --custom-flag`, 60000);
253
+ ```
254
+
255
+ ---
256
+
257
+ ## VS Code
258
+
259
+ Launch Visual Studio Code with optional workspace and extensions.
260
+
261
+ ```javascript
262
+ await testdriver.provision.vscode({
263
+ workspace: '/home/testdriver/my-project',
264
+ extensions: ['ms-python.python', 'esbenp.prettier-vscode'],
265
+ });
266
+ ```
267
+
268
+ ### Options
269
+
270
+ | Option | Type | Default | Description |
271
+ |--------|------|---------|-------------|
272
+ | `workspace` | string | - | Workspace folder to open |
273
+ | `extensions` | string[] | `[]` | Extensions to install (by ID) |
274
+
275
+ ### Example: VS Code Extension Test
276
+
277
+ ```javascript
278
+ import { describe, expect, it } from "vitest";
279
+ import { TestDriver } from "testdriverai/lib/vitest/hooks.mjs";
280
+
281
+ describe("VS Code Test", () => {
282
+ it("should open workspace with extensions", async (context) => {
283
+ const testdriver = TestDriver(context);
284
+
285
+ // Create a test project
286
+ await testdriver.exec('sh', 'mkdir -p /tmp/test-project && echo "print(1)" > /tmp/test-project/test.py', 10000);
287
+
288
+ // Launch VS Code
289
+ await testdriver.provision.vscode({
290
+ workspace: '/tmp/test-project',
291
+ extensions: ['ms-python.python'],
292
+ });
293
+
294
+ // Verify VS Code is ready
295
+ const result = await testdriver.assert("VS Code is open with the project");
296
+ expect(result).toBeTruthy();
297
+
298
+ // Open the Python file
299
+ await testdriver.find("test.py in the explorer").click();
300
+ });
301
+ });
302
+ ```
303
+
304
+ ---
305
+
306
+ ## Choosing the Right Provision Method
307
+
308
+ | Use Case | Method |
309
+ |----------|--------|
310
+ | Testing a website | `provision.chrome` |
311
+ | Testing a Chrome extension | `provision.chromeExtension` |
312
+ | Testing a desktop app (needs installation) | `provision.installer` |
313
+ | Testing VS Code or VS Code extensions | `provision.vscode` |
314
+
315
+ <Tip>
316
+ All provision methods automatically start Dashcam recording and wait for the application to be ready before returning. You don't need to call `dashcam.start()` manually.
317
+ </Tip>
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: testdriver:double-click
3
+ description: Perform a double-click action on an element or at specific coordinates
4
+ ---
5
+ <!-- Generated from double-click.mdx. DO NOT EDIT. -->
6
+
7
+ ## Overview
8
+
9
+ The `doubleClick()` method performs a double-click action on an element. You can either call it on an [`Element`](/v7/core-concepts/elements) instance or use it directly with a selector.
10
+
11
+ ## Syntax
12
+
13
+ ```javascript
14
+ // Double-click on an element
15
+ await element.doubleClick();
16
+
17
+ // Double-click using a selector
18
+ await ai.doubleClick('selector');
19
+ ```
20
+
21
+ ## Parameters
22
+
23
+ When called on an `Element`, no parameters are required.
24
+
25
+ When called directly on the AI client:
26
+
27
+ | Parameter | Type | Description |
28
+ |-----------|------|-------------|
29
+ | `selector` | `string` | The selector describing the element to double-click |
30
+
31
+ ## Returns
32
+
33
+ Returns a `Promise<void>` that resolves when the double-click action completes.
34
+
35
+ ## Examples
36
+
37
+ ### Double-Click on Found Element
38
+
39
+ ```javascript
40
+ const fileItem = await ai.find('README.md file');
41
+ await fileItem.doubleClick();
42
+ ```
43
+
44
+ ### Direct Double-Click with Selector
45
+
46
+ ```javascript
47
+ await ai.doubleClick('README.md in the file list');
48
+ ```
49
+
50
+ ### Opening Files in VS Code
51
+
52
+ ```javascript
53
+ import { test } from 'vitest';
54
+ import { vscode } from '@testdriver/sdk';
55
+
56
+ test('opens a file by double-clicking', async () => {
57
+ const { ai } = await vscode();
58
+
59
+ // Double-click to open a file in the explorer
60
+ await ai.doubleClick('package.json in the file explorer');
61
+
62
+ // Verify the file opened
63
+ const editor = await ai.find('text editor showing package.json');
64
+ expect(editor).toBeTruthy();
65
+ });
66
+ ```
67
+
68
+ ### Opening Folders in File Manager
69
+
70
+ ```javascript
71
+ import { test } from 'vitest';
72
+ import { chrome } from '@testdriver/sdk';
73
+
74
+ test('navigates folders in Google Drive', async () => {
75
+ const { ai } = await chrome('https://drive.google.com');
76
+
77
+ // Double-click to open a folder
78
+ await ai.doubleClick('Documents folder');
79
+
80
+ // Wait for folder to open
81
+ await ai.find('breadcrumb showing Documents');
82
+ });
83
+ ```
84
+
85
+ ### Selecting Text with Double-Click
86
+
87
+ ```javascript
88
+ // Double-click to select a word
89
+ await ai.doubleClick('word "TestDriver" in the paragraph');
90
+
91
+ // Verify selection
92
+ const selectedText = await ai.exec('window.getSelection().toString()');
93
+ expect(selectedText).toBe('TestDriver');
94
+ ```
95
+
96
+ ## Related Methods
97
+
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