testdriverai 7.9.10-test → 7.9.11-test
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.
- package/ai/agents/testdriver.md +0 -2
- package/ai/skills/testdriver-find/SKILL.md +11 -11
- package/ai/skills/testdriver-performing-actions/SKILL.md +0 -1
- package/ai/skills/testdriver-screenshot/SKILL.md +1 -1
- package/ai/skills/testdriver-scroll/SKILL.md +20 -150
- package/ai/skills/testdriver-test-writer/SKILL.md +0 -2
- package/ai/skills/testdriver-testdriver/SKILL.md +0 -2
- package/docs/_data/examples-manifest.json +42 -42
- package/docs/snippets/tests/scroll-yaml.mdx +2 -2
- package/docs/v6/commands/scroll-until-image.mdx +1 -1
- package/docs/v6/commands/scroll-until-text.mdx +2 -2
- package/docs/v6/commands/scroll.mdx +2 -2
- package/docs/v7/_drafts/agents.mdx +0 -4
- package/docs/v7/_drafts/commands/scroll-until-image.mdx +1 -1
- package/docs/v7/_drafts/commands/scroll-until-text.mdx +2 -2
- package/docs/v7/_drafts/commands/scroll.mdx +1 -1
- package/docs/v7/_drafts/readme.mdx +0 -1
- package/docs/v7/aws-setup.mdx +1 -1
- package/docs/v7/ci-cd.mdx +1 -1
- package/docs/v7/client.mdx +5 -5
- package/docs/v7/customizing-devices.mdx +1 -1
- package/docs/v7/device-config.mdx +5 -5
- package/docs/v7/examples/ai.mdx +1 -1
- package/docs/v7/examples/assert.mdx +1 -1
- package/docs/v7/examples/chrome-extension.mdx +1 -1
- package/docs/v7/examples/element-not-found.mdx +1 -1
- package/docs/v7/examples/exec-output.mdx +1 -1
- package/docs/v7/examples/exec-pwsh.mdx +1 -1
- package/docs/v7/examples/findall-coffee-icons.mdx +1 -1
- package/docs/v7/examples/focus-window.mdx +1 -1
- package/docs/v7/examples/hover-image.mdx +1 -1
- package/docs/v7/examples/hover-text-with-description.mdx +1 -1
- package/docs/v7/examples/hover-text.mdx +1 -1
- package/docs/v7/examples/installer.mdx +1 -1
- package/docs/v7/examples/launch-vscode-linux.mdx +1 -1
- package/docs/v7/examples/parse.mdx +1 -1
- package/docs/v7/examples/press-keys.mdx +1 -1
- package/docs/v7/examples/prompt.mdx +1 -1
- package/docs/v7/examples/scroll-keyboard.mdx +3 -3
- package/docs/v7/examples/scroll-until-image.mdx +3 -3
- package/docs/v7/examples/scroll.mdx +2 -2
- package/docs/v7/examples/type.mdx +1 -1
- package/docs/v7/examples/windows-installer.mdx +1 -1
- package/docs/v7/find.mdx +11 -11
- package/docs/v7/hosted.mdx +1 -1
- package/docs/v7/parse.mdx +1 -1
- package/docs/v7/performing-actions.mdx +0 -1
- package/docs/v7/reusable-code.mdx +3 -3
- package/docs/v7/running-tests.mdx +1 -1
- package/docs/v7/screenshot.mdx +5 -5
- package/docs/v7/scroll.mdx +30 -160
- package/package.json +1 -1
- package/sdk.d.ts +1 -1
|
@@ -67,7 +67,6 @@ v7/
|
|
|
67
67
|
- `pressKeys()` - Keyboard shortcuts and special keys
|
|
68
68
|
- `click()` / `hover()` - Coordinate-based mouse actions
|
|
69
69
|
- `scroll()` - Page scrolling
|
|
70
|
-
- `scrollUntilText()` / `scrollUntilImage()` - Scroll until found
|
|
71
70
|
- Keyboard key reference
|
|
72
71
|
|
|
73
72
|
#### Assertions (`/v7/api/assertions.mdx`)
|
package/docs/v7/aws-setup.mdx
CHANGED
|
@@ -193,7 +193,7 @@ Tests should use `context.ip || process.env.TD_IP` for the IP configuration:
|
|
|
193
193
|
|
|
194
194
|
```javascript
|
|
195
195
|
import { describe, it } from "vitest";
|
|
196
|
-
import { TestDriver } from "testdriverai/
|
|
196
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
197
197
|
|
|
198
198
|
describe("My Test", () => {
|
|
199
199
|
it("should run on self-hosted instance", async (context) => {
|
package/docs/v7/ci-cd.mdx
CHANGED
|
@@ -572,7 +572,7 @@ When using multi-platform testing, read the `TD_OS` environment variable in your
|
|
|
572
572
|
|
|
573
573
|
```javascript tests/cross-platform.test.mjs
|
|
574
574
|
import { describe, expect, it } from "vitest";
|
|
575
|
-
import { TestDriver } from "testdriverai/
|
|
575
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
576
576
|
|
|
577
577
|
describe("Cross-platform tests", () => {
|
|
578
578
|
it("should work on both Linux and Windows", async (context) => {
|
package/docs/v7/client.mdx
CHANGED
|
@@ -45,7 +45,7 @@ const testdriver = new TestDriver(apiKey, options)
|
|
|
45
45
|
Enable or disable console logging
|
|
46
46
|
</ParamField>
|
|
47
47
|
|
|
48
|
-
<ParamField path="autoScreenshots" type="boolean" default="
|
|
48
|
+
<ParamField path="autoScreenshots" type="boolean" default="false">
|
|
49
49
|
Automatically capture screenshots before and after each command. Screenshots are saved to `.testdriver/screenshots/<test>/` with descriptive filenames that include the line number and action name. Format: `<seq>-<action>-<phase>-L<line>-<description>.png`
|
|
50
50
|
</ParamField>
|
|
51
51
|
|
|
@@ -57,10 +57,6 @@ const testdriver = new TestDriver(apiKey, options)
|
|
|
57
57
|
Reconnect to the last used sandbox instead of creating a new one. When `true`, provision methods (`chrome`, `vscode`, `installer`, etc.) will be skipped since the application is already running. Throws error if no previous sandbox exists.
|
|
58
58
|
</ParamField>
|
|
59
59
|
|
|
60
|
-
<ParamField path="keepAlive" type="number" default="60000">
|
|
61
|
-
Keep sandbox alive for the specified number of milliseconds after disconnect. Set to `0` to terminate immediately on disconnect. Useful for debugging or reconnecting to the same sandbox.
|
|
62
|
-
</ParamField>
|
|
63
|
-
|
|
64
60
|
<ParamField path="preview" type="string" default="browser">
|
|
65
61
|
Preview mode for live test visualization:
|
|
66
62
|
- `"browser"` — Opens debugger in default browser (default)
|
|
@@ -275,6 +271,10 @@ await testdriver.connect(options)
|
|
|
275
271
|
<ParamField path="headless" type="boolean" default="false">
|
|
276
272
|
**Deprecated**: Use `preview: "none"` instead. Run in headless mode without opening the debugger.
|
|
277
273
|
</ParamField>
|
|
274
|
+
|
|
275
|
+
<ParamField path="keepAlive" type="number" default="60000">
|
|
276
|
+
Keep sandbox alive for the specified number of milliseconds after disconnect. Set to `0` to terminate immediately on disconnect. Useful for debugging or reconnecting to the same sandbox.
|
|
277
|
+
</ParamField>
|
|
278
278
|
</Expandable>
|
|
279
279
|
</ParamField>
|
|
280
280
|
|
|
@@ -39,7 +39,7 @@ const testdriver = TestDriver(context, {
|
|
|
39
39
|
|
|
40
40
|
// === Recording & Screenshots ===
|
|
41
41
|
dashcam: true, // Enable/disable Dashcam video recording (default: true)
|
|
42
|
-
autoScreenshots: true, // Capture screenshots before/after each command (default:
|
|
42
|
+
autoScreenshots: true, // Capture screenshots before/after each command (default: false)
|
|
43
43
|
|
|
44
44
|
// === AI Configuration ===
|
|
45
45
|
ai: { // Global AI sampling configuration
|
|
@@ -28,7 +28,7 @@ await testdriver.provision.chrome({
|
|
|
28
28
|
|
|
29
29
|
```javascript
|
|
30
30
|
import { describe, expect, it } from "vitest";
|
|
31
|
-
import { TestDriver } from "testdriverai/
|
|
31
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
32
32
|
|
|
33
33
|
describe("Login Flow", () => {
|
|
34
34
|
it("should log in successfully", async (context) => {
|
|
@@ -113,7 +113,7 @@ await testdriver.provision.chromeExtension({
|
|
|
113
113
|
|
|
114
114
|
```javascript
|
|
115
115
|
import { describe, expect, it } from "vitest";
|
|
116
|
-
import { TestDriver } from "testdriverai/
|
|
116
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
117
117
|
|
|
118
118
|
describe("Chrome Extension Test", () => {
|
|
119
119
|
it("should load and interact with extension", async (context) => {
|
|
@@ -187,7 +187,7 @@ const filePath = await testdriver.provision.installer({
|
|
|
187
187
|
|
|
188
188
|
```javascript
|
|
189
189
|
import { describe, expect, it } from "vitest";
|
|
190
|
-
import { TestDriver } from "testdriverai/
|
|
190
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
191
191
|
|
|
192
192
|
describe("Desktop App Test", () => {
|
|
193
193
|
it("should install and launch app", async (context) => {
|
|
@@ -209,7 +209,7 @@ describe("Desktop App Test", () => {
|
|
|
209
209
|
|
|
210
210
|
```javascript
|
|
211
211
|
import { describe, expect, it } from "vitest";
|
|
212
|
-
import { TestDriver } from "testdriverai/
|
|
212
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
213
213
|
|
|
214
214
|
describe("Windows App Test", () => {
|
|
215
215
|
it("should install on Windows", async (context) => {
|
|
@@ -276,7 +276,7 @@ await testdriver.provision.vscode({
|
|
|
276
276
|
|
|
277
277
|
```javascript
|
|
278
278
|
import { describe, expect, it } from "vitest";
|
|
279
|
-
import { TestDriver } from "testdriverai/
|
|
279
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
280
280
|
|
|
281
281
|
describe("VS Code Test", () => {
|
|
282
282
|
it("should open workspace with extensions", async (context) => {
|
package/docs/v7/examples/ai.mdx
CHANGED
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* ai.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb90a248d4e274f31c130/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* assert.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8f7248d4e274f31c128/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* chrome-extension.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8df248d4e274f31c11b/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* element-not-found.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb907248d4e274f31c12f/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* exec-output.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8eb248d4e274f31c121/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* exec-pwsh.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8e1248d4e274f31c11c/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -18,7 +18,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
18
18
|
|
|
19
19
|
{/* findall-coffee-icons.test.mjs output */}
|
|
20
20
|
<iframe
|
|
21
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
21
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8fa248d4e274f31c129/replay"
|
|
22
22
|
width="100%"
|
|
23
23
|
height="600"
|
|
24
24
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* focus-window.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb902248d4e274f31c12d/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* hover-image.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8ed248d4e274f31c122/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -18,7 +18,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
18
18
|
|
|
19
19
|
{/* hover-text-with-description.test.mjs output */}
|
|
20
20
|
<iframe
|
|
21
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
21
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8e4248d4e274f31c11d/replay"
|
|
22
22
|
width="100%"
|
|
23
23
|
height="600"
|
|
24
24
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* hover-text.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb90c248d4e274f31c131/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* installer.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8f0248d4e274f31c123/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* launch-vscode-linux.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8e6248d4e274f31c11e/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -17,7 +17,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
17
17
|
|
|
18
18
|
{/* parse.test.mjs output */}
|
|
19
19
|
<iframe
|
|
20
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
20
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb90e248d4e274f31c132/replay"
|
|
21
21
|
width="100%"
|
|
22
22
|
height="600"
|
|
23
23
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* press-keys.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8f5248d4e274f31c127/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -17,7 +17,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
17
17
|
|
|
18
18
|
{/* prompt.test.mjs output */}
|
|
19
19
|
<iframe
|
|
20
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
20
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb900248d4e274f31c12c/replay"
|
|
21
21
|
width="100%"
|
|
22
22
|
height="600"
|
|
23
23
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll-keyboard.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8fc248d4e274f31c12a/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -46,12 +46,12 @@ describe("Scroll Keyboard Test", () => {
|
|
|
46
46
|
await testdriver.type("https://www.webhamster.com/");
|
|
47
47
|
await testdriver.pressKeys(["enter"]);
|
|
48
48
|
|
|
49
|
-
// Scroll down
|
|
49
|
+
// Scroll down 10 clicks
|
|
50
50
|
const heading = await testdriver.find(
|
|
51
51
|
"The Hamster Dance, large heading at top of page",
|
|
52
52
|
);
|
|
53
53
|
await heading.click();
|
|
54
|
-
await testdriver.scroll("down", { amount:
|
|
54
|
+
await testdriver.scroll("down", { amount: 10 });
|
|
55
55
|
|
|
56
56
|
// Assert the page is scrolled down
|
|
57
57
|
const result = await testdriver.assert("The text 'The Hamster Dance' is not visible on the webpage content. It's ok if it's visible in the tab title.");
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll-until-image.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8fe248d4e274f31c12b/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -51,8 +51,8 @@ describe("Scroll Until Image Test", () => {
|
|
|
51
51
|
);
|
|
52
52
|
await heading.click();
|
|
53
53
|
|
|
54
|
-
// Scroll
|
|
55
|
-
await testdriver.
|
|
54
|
+
// Scroll down the page
|
|
55
|
+
await testdriver.scroll("down", { amount: 100 });
|
|
56
56
|
|
|
57
57
|
// Assert image of brown colored house appears on screen
|
|
58
58
|
const result = await testdriver.assert(
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb905248d4e274f31c12e/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -45,7 +45,7 @@ describe("Scroll Test", () => {
|
|
|
45
45
|
await heading.click();
|
|
46
46
|
|
|
47
47
|
// Scroll down
|
|
48
|
-
await testdriver.scroll("down", { amount:
|
|
48
|
+
await testdriver.scroll("down", { amount: 10 });
|
|
49
49
|
|
|
50
50
|
// Assert page is scrolled
|
|
51
51
|
const result = await testdriver.assert("The text 'The Hamster Dance' is not visible on the webpage content. It's ok if it's visible in the tab title.");
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* type.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8f2248d4e274f31c126/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* windows-installer.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69cdb8e8248d4e274f31c120/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
package/docs/v7/find.mdx
CHANGED
|
@@ -50,8 +50,8 @@ const element = await testdriver.find(description, options)
|
|
|
50
50
|
- `"any"` — No wrapping, uses the description as-is (default behavior)
|
|
51
51
|
</ParamField>
|
|
52
52
|
|
|
53
|
-
<ParamField path="zoom" type="boolean" default={
|
|
54
|
-
Two-phase zoom mode for better precision in crowded UIs with many similar elements.
|
|
53
|
+
<ParamField path="zoom" type="boolean" default={false}>
|
|
54
|
+
Two-phase zoom mode for better precision in crowded UIs with many similar elements. Disabled by default.
|
|
55
55
|
</ParamField>
|
|
56
56
|
|
|
57
57
|
<ParamField path="ai" type="object">
|
|
@@ -335,17 +335,17 @@ The `timeout` option:
|
|
|
335
335
|
|
|
336
336
|
## Zoom Mode
|
|
337
337
|
|
|
338
|
-
Zoom mode is **
|
|
338
|
+
Zoom mode is **disabled by default**. It uses a two-phase approach for better precision when locating elements, especially in crowded UIs with many similar elements.
|
|
339
339
|
|
|
340
|
-
To
|
|
340
|
+
To enable zoom for a specific find call, pass `zoom: true`:
|
|
341
341
|
|
|
342
342
|
```javascript
|
|
343
|
-
//
|
|
344
|
-
const extensionsBtn = await testdriver.find('extensions puzzle icon in Chrome toolbar');
|
|
343
|
+
// Enable zoom for better precision in crowded UIs
|
|
344
|
+
const extensionsBtn = await testdriver.find('extensions puzzle icon in Chrome toolbar', { zoom: true });
|
|
345
345
|
await extensionsBtn.click();
|
|
346
346
|
|
|
347
|
-
//
|
|
348
|
-
const largeButton = await testdriver.find('big hero button'
|
|
347
|
+
// Without zoom (default)
|
|
348
|
+
const largeButton = await testdriver.find('big hero button');
|
|
349
349
|
```
|
|
350
350
|
|
|
351
351
|
### How Zoom Mode Works
|
|
@@ -358,9 +358,9 @@ const largeButton = await testdriver.find('big hero button', { zoom: false });
|
|
|
358
358
|
This two-phase approach gives the AI a higher-resolution view of the target area, improving accuracy when multiple similar elements are close together.
|
|
359
359
|
|
|
360
360
|
<Tip>
|
|
361
|
-
You may want to
|
|
362
|
-
- Targeting
|
|
363
|
-
- You
|
|
361
|
+
You may want to enable zoom with `zoom: true` when:
|
|
362
|
+
- Targeting small elements in crowded UIs with many similar elements
|
|
363
|
+
- You need extra precision for closely spaced UI elements
|
|
364
364
|
</Tip>
|
|
365
365
|
|
|
366
366
|
## Cache Options
|
package/docs/v7/hosted.mdx
CHANGED
|
@@ -77,7 +77,7 @@ To prevent tests from failing due to exceeding your license slot limit, we recom
|
|
|
77
77
|
|
|
78
78
|
```javascript vitest.config.mjs
|
|
79
79
|
import { defineConfig } from 'vitest/config';
|
|
80
|
-
import
|
|
80
|
+
import TestDriver from 'testdriverai/vitest';
|
|
81
81
|
|
|
82
82
|
export default defineConfig({
|
|
83
83
|
test: {
|
package/docs/v7/parse.mdx
CHANGED
|
@@ -121,7 +121,7 @@ console.log(`Found ${buttons.length} buttons`);
|
|
|
121
121
|
|
|
122
122
|
```javascript
|
|
123
123
|
import { describe, expect, it } from "vitest";
|
|
124
|
-
import { TestDriver } from "testdriverai/
|
|
124
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
125
125
|
|
|
126
126
|
describe("Login Page", () => {
|
|
127
127
|
it("should have expected form elements", async (context) => {
|
|
@@ -49,7 +49,7 @@ Now import and use these helpers in any test:
|
|
|
49
49
|
|
|
50
50
|
```javascript test/checkout.test.mjs
|
|
51
51
|
import { describe, expect, it } from "vitest";
|
|
52
|
-
import { TestDriver } from "testdriverai/
|
|
52
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
53
53
|
import { login } from './helpers/auth.js';
|
|
54
54
|
|
|
55
55
|
describe("Checkout", () => {
|
|
@@ -120,7 +120,7 @@ Use the page object in your tests:
|
|
|
120
120
|
|
|
121
121
|
```javascript test/auth.test.mjs
|
|
122
122
|
import { describe, expect, it } from "vitest";
|
|
123
|
-
import { TestDriver } from "testdriverai/
|
|
123
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
124
124
|
import { LoginPage } from './pages/LoginPage.js';
|
|
125
125
|
|
|
126
126
|
describe("Authentication", () => {
|
|
@@ -190,7 +190,7 @@ export async function setupAuthenticatedSession(testdriver, user = testUsers.reg
|
|
|
190
190
|
|
|
191
191
|
```javascript test/admin.test.mjs
|
|
192
192
|
import { describe, expect, it } from "vitest";
|
|
193
|
-
import { TestDriver } from "testdriverai/
|
|
193
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
194
194
|
import { testUsers, testUrls, setupAuthenticatedSession } from './fixtures/index.js';
|
|
195
195
|
|
|
196
196
|
describe("Admin Panel", () => {
|
|
@@ -101,7 +101,7 @@ Set `maxConcurrency` in your Vitest config to match your license slot limit:
|
|
|
101
101
|
|
|
102
102
|
```javascript vitest.config.mjs
|
|
103
103
|
import { defineConfig } from 'vitest/config';
|
|
104
|
-
import
|
|
104
|
+
import TestDriver from 'testdriverai/vitest';
|
|
105
105
|
|
|
106
106
|
export default defineConfig({
|
|
107
107
|
test: {
|
package/docs/v7/screenshot.mdx
CHANGED
|
@@ -10,7 +10,7 @@ icon: "camera"
|
|
|
10
10
|
Capture a screenshot of the current screen and automatically save it to a local file. Screenshots are organized by test file for easy debugging and review.
|
|
11
11
|
|
|
12
12
|
<Note>
|
|
13
|
-
**Automatic Screenshots
|
|
13
|
+
**Automatic Screenshots**: TestDriver can automatically capture screenshots before and after every command (click, type, find, etc.). These are saved with descriptive filenames like `001-click-before-L42-submit-button.png` that include the line number from your test file. Enable this with `autoScreenshots: true` in your TestDriver options.
|
|
14
14
|
</Note>
|
|
15
15
|
|
|
16
16
|
## Syntax
|
|
@@ -51,7 +51,7 @@ Screenshots are automatically saved to `.testdriver/screenshots/<test-file-name>
|
|
|
51
51
|
|
|
52
52
|
### Automatic Screenshot Naming
|
|
53
53
|
|
|
54
|
-
When `autoScreenshots` is enabled
|
|
54
|
+
When `autoScreenshots` is enabled, filenames follow this format:
|
|
55
55
|
|
|
56
56
|
`<seq>-<action>-<phase>-L<line>-<description>.png`
|
|
57
57
|
|
|
@@ -92,7 +92,7 @@ await testdriver.screenshot("after-click");
|
|
|
92
92
|
|
|
93
93
|
```javascript
|
|
94
94
|
import { describe, expect, it } from "vitest";
|
|
95
|
-
import { TestDriver } from "testdriverai/
|
|
95
|
+
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
96
96
|
|
|
97
97
|
describe("Login Flow", () => {
|
|
98
98
|
it("should log in successfully", async (context) => {
|
|
@@ -154,7 +154,7 @@ Automatic screenshots are taken around these commands:
|
|
|
154
154
|
- `find()` / `findAll()`
|
|
155
155
|
- `click()` / `hover()` / `doubleClick()` / `rightClick()`
|
|
156
156
|
- `type()` / `pressKeys()`
|
|
157
|
-
- `scroll()`
|
|
157
|
+
- `scroll()`
|
|
158
158
|
- `waitForText()` / `waitForImage()`
|
|
159
159
|
- `focusApplication()`
|
|
160
160
|
- `assert()` / `extract()` / `exec()`
|
|
@@ -189,7 +189,7 @@ If an error occurs, the phase will be `error` instead of `after`.
|
|
|
189
189
|
|
|
190
190
|
<AccordionGroup>
|
|
191
191
|
<Accordion title="Let automatic screenshots do the work">
|
|
192
|
-
With `autoScreenshots: true
|
|
192
|
+
With `autoScreenshots: true`, you get comprehensive coverage without adding manual `screenshot()` calls. Only add manual screenshots for specific named checkpoints.
|
|
193
193
|
</Accordion>
|
|
194
194
|
|
|
195
195
|
<Accordion title="Use screenshots for debugging flaky tests">
|