@testdriverai/agent 7.9.0-test.33 → 7.9.0-test.34

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.
@@ -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/69c5d036058ffe89003c6ada/replay"
15
+ src="https://api.testdriver.ai/api/v1/testdriver/testcase/69c5d036058ffe89003c6ada/replay"
16
16
  width="100%"
17
17
  height="390"
18
18
  style={{ border: "1px solid #333", borderRadius: "8px" }}
@@ -23,7 +23,8 @@ Watch this test execute in a real sandbox environment:
23
23
 
24
24
  ```javascript title="press-keys.test.mjs" {17,24,36}
25
25
  /**
26
- * TestDriver SDK - Press Keys Test
26
+ * TestDriver SDK - Press Keys Test (Vitest)
27
+ * Converted from: testdriver/acceptance/press-keys.yaml
27
28
  */
28
29
 
29
30
  import { describe, expect, it } from "vitest";
@@ -43,23 +44,16 @@ describe("Press Keys Test", () => {
43
44
  await testdriver.pressKeys(["ctrl", "t"]);
44
45
 
45
46
  // Poll for "Learn more" to appear
46
- let learnMore = await testdriver.find("Learn more");
47
- for (let i = 0; i < 10; i++) {
48
- learnMore = await learnMore.find();
49
- if (learnMore.found()) break;
50
- await new Promise((resolve) => setTimeout(resolve, 500));
51
- }
47
+ let imagesLink = await testdriver.find("Images", {timeout: 5000});
48
+
49
+ expect(imagesLink.found()).toBeTruthy();
52
50
 
53
51
  // Open DevTools
54
52
  await testdriver.pressKeys(["ctrl", "shift", "i"]);
55
53
 
56
54
  // Poll for "Elements" to appear
57
- let elements = await testdriver.find("Elements");
58
- for (let i = 0; i < 10; i++) {
59
- elements = await elements.find();
60
- if (elements.found()) break;
61
- await new Promise((resolve) => setTimeout(resolve, 500));
62
- }
55
+ let elements = await testdriver.find("Elements", {timeout: 5000});
56
+ expect(elements.found()).toBeTruthy();
63
57
 
64
58
  // Open another tab and navigate
65
59
  await testdriver.pressKeys(["ctrl", "t"]);
@@ -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/69c5d03da0a3ef8239de474f/replay"
15
+ src="https://api.testdriver.ai/api/v1/testdriver/testcase/69c5d03da0a3ef8239de474f/replay"
16
16
  width="100%"
17
17
  height="390"
18
18
  style={{ border: "1px solid #333", borderRadius: "8px" }}
@@ -23,7 +23,8 @@ Watch this test execute in a real sandbox environment:
23
23
 
24
24
  ```javascript title="scroll-keyboard.test.mjs" {26}
25
25
  /**
26
- * TestDriver SDK - Scroll Keyboard Test
26
+ * TestDriver SDK - Scroll Keyboard Test (Vitest)
27
+ * Converted from: testdriver/acceptance/scroll-keyboard.yaml
27
28
  */
28
29
 
29
30
  import { describe, expect, it } from "vitest";
@@ -38,7 +39,7 @@ describe("Scroll Keyboard Test", () => {
38
39
  // Navigate to https://www.webhamster.com/
39
40
  await testdriver.focusApplication("Google Chrome");
40
41
  const urlBar = await testdriver.find(
41
- "testdriver-sandbox.vercel.app/login, the URL in the omnibox showing the current page", {zoom: true}
42
+ "the URL in the omnibox", {zoom: true}
42
43
  );
43
44
  await urlBar.click();
44
45
  await testdriver.pressKeys(["ctrl", "a"]);
@@ -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/69c5d03f0201196437256cda/replay"
15
+ src="https://api.testdriver.ai/api/v1/testdriver/testcase/69c5d03f0201196437256cda/replay"
16
16
  width="100%"
17
17
  height="390"
18
18
  style={{ border: "1px solid #333", borderRadius: "8px" }}
@@ -23,7 +23,8 @@ Watch this test execute in a real sandbox environment:
23
23
 
24
24
  ```javascript title="scroll-until-image.test.mjs" {26}
25
25
  /**
26
- * TestDriver SDK - Scroll Until Image Test
26
+ * TestDriver SDK - Scroll Until Image Test (Vitest)
27
+ * Converted from: testdriver/acceptance/scroll-until-image.yaml
27
28
  */
28
29
 
29
30
  import { describe, expect, it } from "vitest";
@@ -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/69c5d043058ffe89003c6ae0/replay"
15
+ src="https://api.testdriver.ai/api/v1/testdriver/testcase/69c5d043058ffe89003c6ae0/replay"
16
16
  width="100%"
17
17
  height="390"
18
18
  style={{ border: "1px solid #333", borderRadius: "8px" }}
@@ -23,7 +23,10 @@ Watch this test execute in a real sandbox environment:
23
23
 
24
24
  ```javascript title="scroll.test.mjs" {29}
25
25
  /**
26
- * TestDriver SDK - Scroll Test
26
+ * TestDriver SDK - Scroll Test (Vitest)
27
+ * Converted from: testdriver/acceptance/scroll.yaml
28
+ *
29
+ * UPDATED: Now using chrome preset for automatic setup
27
30
  */
28
31
 
29
32
  import { describe, expect, it } from "vitest";
@@ -32,19 +35,8 @@ import { TestDriver } from "testdriverai/vitest/hooks";
32
35
  describe("Scroll Test", () => {
33
36
  it("should navigate and scroll down the page", async (context) => {
34
37
  const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, headless: true });
35
- await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
38
+ await testdriver.provision.chrome({ url: 'https://www.webhamster.com/' });
36
39
 
37
- // Give Chrome a moment to fully render the UI
38
- await new Promise(resolve => setTimeout(resolve, 2000));
39
-
40
- // Navigate to webhamster.com - just look for the domain, not the full path
41
- const urlBar = await testdriver.find(
42
- "testdriver-sandbox.vercel.app, the URL in the address bar",
43
- );
44
- await urlBar.click();
45
- await testdriver.pressKeys(["ctrl", "a"]);
46
- await testdriver.type("https://www.webhamster.com/");
47
- await testdriver.pressKeys(["enter"]);
48
40
 
49
41
  // Wait for page to load and click heading
50
42
  const heading = await testdriver.find(
@@ -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/69c5d034c2e6e9493388676c/replay"
15
+ src="https://api.testdriver.ai/api/v1/testdriver/testcase/69c5d034c2e6e9493388676c/replay"
16
16
  width="100%"
17
17
  height="390"
18
18
  style={{ border: "1px solid #333", borderRadius: "8px" }}
@@ -22,10 +22,6 @@ Watch this test execute in a real sandbox environment:
22
22
  ## Source Code
23
23
 
24
24
  ```javascript title="type.test.mjs" {13}
25
- /**
26
- * TestDriver SDK - Type Test
27
- */
28
-
29
25
  import { describe, expect, it } from "vitest";
30
26
  import { TestDriver } from "testdriverai/vitest/hooks";
31
27
 
@@ -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/69c5d02ce8a04db4b705cbe9/replay"
15
+ src="https://api.testdriver.ai/api/v1/testdriver/testcase/69c5d02ce8a04db4b705cbe9/replay"
16
16
  width="100%"
17
17
  height="390"
18
18
  style={{ border: "1px solid #333", borderRadius: "8px" }}
@@ -23,7 +23,14 @@ Watch this test execute in a real sandbox environment:
23
23
 
24
24
  ```javascript title="windows-installer.test.mjs" {22-25}
25
25
  /**
26
- * TestDriver SDK - Windows Installer Example
26
+ * TestDriver SDK - Windows Installer Example (Vitest)
27
+ *
28
+ * This example demonstrates how to download and install a Windows application
29
+ * using PowerShell commands, then launch and interact with it.
30
+ *
31
+ * Based on the v6 GitButler provisioning workflow.
32
+ *
33
+ * Run: TD_OS=windows vitest run examples/windows-installer.test.mjs
27
34
  */
28
35
 
29
36
  import { describe, it } from "vitest";
@@ -35,8 +42,7 @@ describe("Windows App Installation", () => {
35
42
 
36
43
  it.skipIf(isLinux)("should download, install, and launch GitButler on Windows", async (context) => {
37
44
  // Alternative approach using provision.installer helper
38
- const testdriver = TestDriver(context, {
39
- ip: context.ip || process.env.TD_IP,
45
+ const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP,
40
46
  os: 'windows'
41
47
  });
42
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testdriverai/agent",
3
- "version": "7.9.0-test.33",
3
+ "version": "7.9.0-test.34",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "sdk.js",
6
6
  "types": "sdk.d.ts",