@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.
Files changed (100) hide show
  1. package/docs/_data/examples-manifest.json +16 -16
  2. package/docs/_scripts/generate-examples.js +38 -45
  3. package/docs/agent.mdx +174 -93
  4. package/docs/assert.mdx +73 -269
  5. package/docs/aws-setup.mdx +196 -314
  6. package/docs/bring-your-own-machine.mdx +139 -206
  7. package/docs/cache.mdx +144 -151
  8. package/docs/caching.mdx +99 -89
  9. package/docs/captcha.mdx +126 -111
  10. package/docs/ci-cd.mdx +154 -543
  11. package/docs/click.mdx +74 -229
  12. package/docs/client.mdx +177 -231
  13. package/docs/copilot/auto-healing.mdx +86 -370
  14. package/docs/copilot/running-tests.mdx +121 -930
  15. package/docs/customizing-devices.mdx +74 -251
  16. package/docs/dashcam.mdx +72 -405
  17. package/docs/debugging-with-screenshots.mdx +105 -371
  18. package/docs/docs.json +79 -22
  19. package/docs/double-click.mdx +48 -68
  20. package/docs/errors.mdx +102 -176
  21. package/docs/events.mdx +170 -327
  22. package/docs/examples/{hover-text-with-description.mdx → add-to-cart.mdx} +30 -35
  23. package/docs/examples/assert.mdx +28 -41
  24. package/docs/examples/click-button.mdx +71 -0
  25. package/docs/examples/{hover-image.mdx → click-icon.mdx} +32 -28
  26. package/docs/examples/element-not-found.mdx +27 -26
  27. package/docs/examples/findall-coffee-icons.mdx +28 -32
  28. package/docs/examples/installer.mdx +61 -25
  29. package/docs/examples/launch-vscode-linux.mdx +28 -51
  30. package/docs/examples/navigate-and-scroll.mdx +82 -0
  31. package/docs/examples/parse.mdx +24 -28
  32. package/docs/examples/press-keys.mdx +28 -25
  33. package/docs/examples/scroll.mdx +25 -27
  34. package/docs/examples/type.mdx +26 -21
  35. package/docs/exec.mdx +92 -256
  36. package/docs/extract.mdx +69 -170
  37. package/docs/find.mdx +140 -736
  38. package/docs/focus-application.mdx +69 -246
  39. package/docs/generating-tests.mdx +103 -137
  40. package/docs/guide/best-practices-polling.mdx +65 -141
  41. package/docs/hosted.mdx +80 -144
  42. package/docs/hover.mdx +62 -235
  43. package/docs/locating-elements.mdx +74 -369
  44. package/docs/making-assertions.mdx +116 -74
  45. package/docs/mcp-setup.mdx +80 -63
  46. package/docs/mouse-down.mdx +48 -125
  47. package/docs/mouse-up.mdx +47 -129
  48. package/docs/options.mdx +75 -48
  49. package/docs/parse.mdx +95 -184
  50. package/docs/performing-actions.mdx +104 -94
  51. package/docs/press-keys.mdx +59 -299
  52. package/docs/provision.mdx +137 -182
  53. package/docs/quickstart-claude.mdx +85 -0
  54. package/docs/quickstart-github.mdx +62 -32
  55. package/docs/quickstart-manual.mdx +60 -33
  56. package/docs/quickstart-vscode.mdx +97 -0
  57. package/docs/quickstart.mdx +26 -9
  58. package/docs/redraw.mdx +101 -165
  59. package/docs/reusable-code.mdx +97 -200
  60. package/docs/right-click.mdx +47 -89
  61. package/docs/screenshot.mdx +47 -201
  62. package/docs/screenshots.mdx +87 -137
  63. package/docs/scroll.mdx +71 -154
  64. package/docs/secrets.mdx +96 -91
  65. package/docs/self-hosted.mdx +83 -142
  66. package/docs/snippets/enterprise.mdx +15 -0
  67. package/docs/styles.css +68 -0
  68. package/docs/test-results-json.mdx +167 -204
  69. package/docs/type.mdx +56 -304
  70. package/docs/variables.mdx +121 -81
  71. package/docs/wait.mdx +33 -31
  72. package/docs/what-is-testdriver.mdx +80 -32
  73. package/examples/{hover-text-with-description.test.mjs → add-to-cart.test.mjs} +4 -5
  74. package/examples/assert.test.mjs +3 -20
  75. package/examples/{hover-text.test.mjs → click-button.test.mjs} +3 -4
  76. package/examples/{hover-image.test.mjs → click-icon.test.mjs} +5 -6
  77. package/examples/element-not-found.test.mjs +3 -5
  78. package/examples/findall-coffee-icons.test.mjs +3 -3
  79. package/examples/installer.test.mjs +1 -1
  80. package/examples/launch-vscode-linux.test.mjs +6 -33
  81. package/examples/{scroll-keyboard.test.mjs → navigate-and-scroll.test.mjs} +4 -5
  82. package/examples/parse.test.mjs +1 -2
  83. package/examples/press-keys.test.mjs +4 -4
  84. package/examples/scroll.test.mjs +3 -6
  85. package/examples/type.test.mjs +5 -2
  86. package/lib/provision.js +6 -2
  87. package/package.json +1 -1
  88. package/sdk.d.ts +4 -2
  89. package/sdk.js +1 -1
  90. package/docs/claude-mcp-plugin.mdx +0 -244
  91. package/docs/elements.mdx +0 -606
  92. package/docs/examples/ai.mdx +0 -78
  93. package/docs/examples/captcha-api.mdx +0 -92
  94. package/docs/examples/chrome-extension.mdx +0 -156
  95. package/docs/examples/drag-and-drop.mdx +0 -100
  96. package/docs/examples/formatted-logging.mdx +0 -74
  97. package/docs/examples/hover-text.mdx +0 -70
  98. package/docs/examples/match-image.mdx +0 -97
  99. package/docs/examples/scroll-keyboard.mdx +0 -80
  100. 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>