@testdriverai/agent 7.9.0-test.33 → 7.9.0-test.35
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/skills/testdriver-enterprise/SKILL.md +2 -109
- package/ai/skills/testdriver-hosted/SKILL.md +156 -0
- package/ai/skills/testdriver-mcp/SKILL.md +2 -2
- package/ai/skills/testdriver-quickstart/SKILL.md +30 -2
- package/ai/skills/testdriver-self-hosted/SKILL.md +125 -43
- package/ai/skills/testdriver-test-results-json/SKILL.md +257 -0
- package/docs/_scripts/generate-examples.js +127 -60
- package/docs/docs.json +27 -28
- package/docs/v7/examples/ai.mdx +4 -3
- package/docs/v7/examples/assert.mdx +19 -4
- package/docs/v7/examples/chrome-extension.mdx +36 -29
- package/docs/v7/examples/element-not-found.mdx +2 -1
- package/docs/v7/examples/exec-output.mdx +3 -4
- package/docs/v7/examples/exec-pwsh.mdx +3 -4
- package/docs/v7/examples/findall-coffee-icons.mdx +88 -0
- package/docs/v7/examples/focus-window.mdx +3 -4
- package/docs/v7/examples/hover-image.mdx +4 -3
- package/docs/v7/examples/hover-text-with-description.mdx +104 -0
- package/docs/v7/examples/hover-text.mdx +4 -3
- package/docs/v7/examples/installer.mdx +5 -4
- package/docs/v7/examples/launch-vscode-linux.mdx +3 -7
- package/docs/v7/examples/match-image.mdx +3 -2
- package/docs/v7/examples/parse.mdx +66 -0
- package/docs/v7/examples/press-keys.mdx +8 -14
- package/docs/v7/examples/scroll-keyboard.mdx +4 -3
- package/docs/v7/examples/scroll-until-image.mdx +3 -2
- package/docs/v7/examples/scroll.mdx +6 -14
- package/docs/v7/examples/type.mdx +1 -5
- package/docs/v7/examples/windows-installer.mdx +10 -4
- package/package.json +1 -1
- package/setup/aws/spawn-runner.sh +1 -1
|
@@ -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
|
|
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
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
"
|
|
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
|
|
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
|
|
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: '
|
|
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
|
|
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
|
|
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
|
@@ -282,7 +282,7 @@ else
|
|
|
282
282
|
"Write-Host 'Installing npm dependencies...'",
|
|
283
283
|
"npm install --omit=dev 2>&1 | Write-Host",
|
|
284
284
|
"Write-Host 'Ensuring scheduled task exists...'",
|
|
285
|
-
"if (-not (Get-ScheduledTask -TaskName RunTestDriverAgent -ErrorAction SilentlyContinue)) { \$agentScript = if (Test-Path 'C:\\\\testdriver\\\\sandbox-agent\\\\sandbox-agent.js') { 'sandbox-agent.js' } else { 'node_modules/@testdriverai/runner/sandbox-agent.js' }; @(\"Set-Location 'C:\\\\testdriver\\\\sandbox-agent'\", \"while (
|
|
285
|
+
"if (-not (Get-ScheduledTask -TaskName RunTestDriverAgent -ErrorAction SilentlyContinue)) { \$agentScript = if (Test-Path 'C:\\\\testdriver\\\\sandbox-agent\\\\sandbox-agent.js') { 'sandbox-agent.js' } else { 'node_modules/@testdriverai/runner/sandbox-agent.js' }; @(\"Set-Location 'C:\\\\testdriver\\\\sandbox-agent'\", \"while (\`\$true) { & node \$agentScript 2>&1 | Tee-Object -Append -FilePath C:\\\\testdriver\\\\logs\\\\sandbox-agent.log; Start-Sleep -Seconds 2 }\") | Set-Content 'C:\\\\testdriver\\\\run_testdriver.ps1'; \$a = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File C:\\\\testdriver\\\\run_testdriver.ps1'; \$t = New-ScheduledTaskTrigger -AtLogOn -User 'testdriver'; \$p = New-ScheduledTaskPrincipal -UserId 'testdriver' -RunLevel Highest; \$s = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -StartWhenAvailable; Register-ScheduledTask -TaskName RunTestDriverAgent -Action \$a -Trigger \$t -Principal \$p -Settings \$s -Force }",
|
|
286
286
|
"Write-Host 'Restarting RunTestDriverAgent scheduled task...'",
|
|
287
287
|
"Start-ScheduledTask -TaskName RunTestDriverAgent -ErrorAction SilentlyContinue",
|
|
288
288
|
"Write-Host '=== Runner install complete (npm pack) ==='"
|