@testdriverai/agent 7.11.229-canary → 7.11.232-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/docs/_data/examples-manifest.json +16 -16
- package/docs/_scripts/generate-examples.js +38 -45
- package/docs/agent.mdx +174 -93
- package/docs/assert.mdx +73 -269
- package/docs/aws-setup.mdx +196 -314
- package/docs/bring-your-own-machine.mdx +139 -206
- package/docs/cache.mdx +144 -151
- package/docs/caching.mdx +99 -89
- package/docs/captcha.mdx +126 -111
- package/docs/ci-cd.mdx +154 -543
- package/docs/click.mdx +74 -229
- package/docs/client.mdx +177 -231
- package/docs/copilot/auto-healing.mdx +86 -370
- package/docs/copilot/running-tests.mdx +121 -930
- package/docs/customizing-devices.mdx +74 -251
- package/docs/dashcam.mdx +72 -405
- package/docs/debugging-with-screenshots.mdx +105 -371
- package/docs/docs.json +79 -22
- package/docs/double-click.mdx +48 -68
- package/docs/errors.mdx +102 -176
- package/docs/events.mdx +170 -327
- package/docs/examples/{hover-text-with-description.mdx → add-to-cart.mdx} +30 -35
- package/docs/examples/assert.mdx +28 -41
- package/docs/examples/click-button.mdx +71 -0
- package/docs/examples/{hover-image.mdx → click-icon.mdx} +32 -28
- package/docs/examples/element-not-found.mdx +27 -26
- package/docs/examples/findall-coffee-icons.mdx +28 -32
- package/docs/examples/installer.mdx +61 -25
- package/docs/examples/launch-vscode-linux.mdx +28 -51
- package/docs/examples/navigate-and-scroll.mdx +82 -0
- package/docs/examples/parse.mdx +24 -28
- package/docs/examples/press-keys.mdx +28 -25
- package/docs/examples/scroll.mdx +25 -27
- package/docs/examples/type.mdx +26 -21
- package/docs/exec.mdx +92 -256
- package/docs/extract.mdx +69 -170
- package/docs/find.mdx +140 -736
- package/docs/focus-application.mdx +69 -246
- package/docs/generating-tests.mdx +103 -137
- package/docs/guide/best-practices-polling.mdx +65 -141
- package/docs/hosted.mdx +80 -144
- package/docs/hover.mdx +62 -235
- package/docs/locating-elements.mdx +74 -369
- package/docs/making-assertions.mdx +116 -74
- package/docs/mcp-setup.mdx +80 -63
- package/docs/mouse-down.mdx +48 -125
- package/docs/mouse-up.mdx +47 -129
- package/docs/options.mdx +75 -48
- package/docs/parse.mdx +95 -184
- package/docs/performing-actions.mdx +104 -94
- package/docs/press-keys.mdx +59 -299
- package/docs/provision.mdx +137 -182
- package/docs/quickstart-claude.mdx +85 -0
- package/docs/quickstart-github.mdx +62 -32
- package/docs/quickstart-manual.mdx +60 -33
- package/docs/quickstart-vscode.mdx +97 -0
- package/docs/quickstart.mdx +26 -9
- package/docs/redraw.mdx +101 -165
- package/docs/reusable-code.mdx +97 -200
- package/docs/right-click.mdx +47 -89
- package/docs/screenshot.mdx +47 -201
- package/docs/screenshots.mdx +87 -137
- package/docs/scroll.mdx +71 -154
- package/docs/secrets.mdx +96 -91
- package/docs/self-hosted.mdx +83 -142
- package/docs/snippets/enterprise.mdx +15 -0
- package/docs/styles.css +68 -0
- package/docs/test-results-json.mdx +167 -204
- package/docs/type.mdx +56 -304
- package/docs/variables.mdx +121 -81
- package/docs/wait.mdx +33 -31
- package/docs/what-is-testdriver.mdx +80 -32
- package/examples/{hover-text-with-description.test.mjs → add-to-cart.test.mjs} +4 -5
- package/examples/assert.test.mjs +3 -20
- package/examples/{hover-text.test.mjs → click-button.test.mjs} +3 -4
- package/examples/{hover-image.test.mjs → click-icon.test.mjs} +5 -6
- package/examples/element-not-found.test.mjs +3 -5
- package/examples/findall-coffee-icons.test.mjs +3 -3
- package/examples/installer.test.mjs +1 -1
- package/examples/launch-vscode-linux.test.mjs +6 -33
- package/examples/{scroll-keyboard.test.mjs → navigate-and-scroll.test.mjs} +4 -5
- package/examples/parse.test.mjs +1 -2
- package/examples/press-keys.test.mjs +4 -4
- package/examples/scroll.test.mjs +3 -6
- package/examples/type.test.mjs +5 -2
- package/lib/provision.js +6 -2
- package/package.json +1 -1
- package/sdk.d.ts +4 -2
- package/sdk.js +1 -1
- package/docs/claude-mcp-plugin.mdx +0 -244
- package/docs/elements.mdx +0 -606
- package/docs/examples/ai.mdx +0 -78
- package/docs/examples/captcha-api.mdx +0 -92
- package/docs/examples/chrome-extension.mdx +0 -156
- package/docs/examples/drag-and-drop.mdx +0 -100
- package/docs/examples/formatted-logging.mdx +0 -74
- package/docs/examples/hover-text.mdx +0 -70
- package/docs/examples/match-image.mdx +0 -97
- package/docs/examples/scroll-keyboard.mdx +0 -80
- package/docs/examples/scroll-until-text.mdx +0 -109
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Scroll Until Text Test Example"
|
|
3
|
-
sidebarTitle: "Scroll Until Text"
|
|
4
|
-
description: "Example test demonstrating how to scroll a page until specific text becomes visible."
|
|
5
|
-
icon: "scroll"
|
|
6
|
-
mode: "wide"
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Demo Test Run
|
|
10
|
-
|
|
11
|
-
Watch this test execute in a real sandbox environment:
|
|
12
|
-
|
|
13
|
-
{/* scroll-until-text.test.mjs output */}
|
|
14
|
-
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/69a62b99dc33133fc0da9440/replay"
|
|
16
|
-
width="100%"
|
|
17
|
-
height="390"
|
|
18
|
-
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
19
|
-
allow="fullscreen"
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
-
## Source Code
|
|
23
|
-
|
|
24
|
-
```javascript title="scroll-until-text.test.mjs" {41-51}
|
|
25
|
-
/**
|
|
26
|
-
* TestDriver SDK - Scroll Until Text Test
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
import { describe, expect, it } from "vitest";
|
|
30
|
-
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Perform login flow for SauceLabs demo app
|
|
34
|
-
* @param {TestDriver} client - TestDriver client
|
|
35
|
-
* @param {string} username - Username (default: 'standard_user')
|
|
36
|
-
*/
|
|
37
|
-
async function performLogin(client, username = "standard_user") {
|
|
38
|
-
await client.focusApplication("Google Chrome");
|
|
39
|
-
const password = await client.extract("the password");
|
|
40
|
-
const usernameField = await client.find(
|
|
41
|
-
"username input",
|
|
42
|
-
);
|
|
43
|
-
await usernameField.click();
|
|
44
|
-
await client.type(username);
|
|
45
|
-
await client.pressKeys(["tab"]);
|
|
46
|
-
await client.type(password, { secret: true });
|
|
47
|
-
await client.pressKeys(["tab"]);
|
|
48
|
-
await client.pressKeys(["enter"]);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
describe("Scroll Until Text Test", () => {
|
|
52
|
-
it('should scroll until "testdriver socks" appears', async (context) => {
|
|
53
|
-
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, headless: true });
|
|
54
|
-
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
// Perform login first
|
|
58
|
-
await performLogin(testdriver);
|
|
59
|
-
|
|
60
|
-
// Scroll until text appears
|
|
61
|
-
await testdriver.focusApplication("Google Chrome");
|
|
62
|
-
|
|
63
|
-
await testdriver.find('TestDriver.ai Sandbox heading').click();
|
|
64
|
-
|
|
65
|
-
// Scroll until text appears
|
|
66
|
-
let found = false;
|
|
67
|
-
let scrollCount = 0;
|
|
68
|
-
const maxScrolls = 10;
|
|
69
|
-
|
|
70
|
-
while (!found && scrollCount < maxScrolls) {
|
|
71
|
-
const findResult = await testdriver.find("testdriver socks product text is fully visible");
|
|
72
|
-
|
|
73
|
-
if (findResult.found()) {
|
|
74
|
-
found = true;
|
|
75
|
-
} else {
|
|
76
|
-
await testdriver.scroll();
|
|
77
|
-
scrollCount++;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (!found) {
|
|
82
|
-
throw new Error(`Failed to find "testdriver socks" after ${maxScrolls} scrolls`);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Assert testdriver socks appears on screen
|
|
86
|
-
await testdriver.focusApplication("Google Chrome");
|
|
87
|
-
const result = await testdriver.assert("TestDriver Socks appears on screen");
|
|
88
|
-
expect(result).toBeTruthy();
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Running This Example
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# Clone the TestDriver repository
|
|
97
|
-
git clone https://github.com/testdriverai/testdriverai
|
|
98
|
-
|
|
99
|
-
# Install dependencies
|
|
100
|
-
cd testdriverai
|
|
101
|
-
npm install
|
|
102
|
-
|
|
103
|
-
# Run this specific example
|
|
104
|
-
vitest run examples/scroll-until-text.test.mjs
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
<Note>
|
|
108
|
-
Make sure you have `TD_API_KEY` set in your environment. Get one at [testdriver.ai](https://testdriver.ai).
|
|
109
|
-
</Note>
|