testdriverai 7.3.5 → 7.3.6
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/CHANGELOG.md +4 -0
- package/docs/_data/examples-manifest.json +50 -50
- package/docs/v7/examples/ai.mdx +1 -1
- package/docs/v7/examples/assert.mdx +1 -1
- package/docs/v7/examples/captcha-api.mdx +1 -1
- package/docs/v7/examples/chrome-extension.mdx +1 -1
- package/docs/v7/examples/drag-and-drop.mdx +1 -1
- package/docs/v7/examples/element-not-found.mdx +1 -1
- package/docs/v7/examples/hover-image.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/match-image.mdx +1 -1
- package/docs/v7/examples/press-keys.mdx +1 -1
- package/docs/v7/examples/scroll-keyboard.mdx +1 -1
- package/docs/v7/examples/scroll-until-image.mdx +1 -1
- package/docs/v7/examples/scroll-until-text.mdx +1 -1
- package/docs/v7/examples/scroll.mdx +1 -1
- package/docs/v7/examples/type.mdx +1 -1
- package/docs/v7/examples/windows-installer.mdx +1 -1
- package/examples/ai.test.mjs +2 -1
- package/examples/assert.test.mjs +2 -2
- package/examples/captcha-api.test.mjs +3 -2
- package/examples/chrome-extension.test.mjs +3 -2
- package/examples/config.mjs +5 -0
- package/examples/drag-and-drop.test.mjs +2 -1
- package/examples/element-not-found.test.mjs +2 -1
- package/examples/exec-output.test.mjs +2 -1
- package/examples/exec-pwsh.test.mjs +2 -1
- package/examples/focus-window.test.mjs +2 -1
- package/examples/formatted-logging.test.mjs +2 -1
- package/examples/hover-image.test.mjs +2 -1
- package/examples/hover-text-with-description.test.mjs +2 -1
- package/examples/hover-text.test.mjs +2 -1
- package/examples/installer.test.mjs +3 -2
- package/examples/launch-vscode-linux.test.mjs +3 -2
- package/examples/match-image.test.mjs +2 -1
- package/examples/no-provision.test.mjs +2 -3
- package/examples/press-keys.test.mjs +7 -13
- package/examples/prompt.test.mjs +2 -1
- package/examples/scroll-keyboard.test.mjs +2 -1
- package/examples/scroll-until-image.test.mjs +2 -1
- package/examples/scroll-until-text.test.mjs +2 -1
- package/examples/scroll.test.mjs +2 -1
- package/examples/type.test.mjs +3 -2
- package/examples/windows-installer.test.mjs +2 -1
- package/package.json +1 -1
- package/sdk.js +49 -38
- package/vitest.config.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,104 +2,104 @@
|
|
|
2
2
|
"$schema": "./examples-manifest.schema.json",
|
|
3
3
|
"examples": {
|
|
4
4
|
"assert.test.mjs": {
|
|
5
|
-
"url": "https://console.testdriver.ai/runs/
|
|
6
|
-
"lastUpdated": "2026-02-
|
|
5
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7d756513c6b23f858ee6",
|
|
6
|
+
"lastUpdated": "2026-02-10T18:51:20.322Z"
|
|
7
7
|
},
|
|
8
8
|
"drag-and-drop.test.mjs": {
|
|
9
|
-
"url": "https://console.testdriver.ai/runs/
|
|
10
|
-
"lastUpdated": "2026-02-
|
|
9
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7bd411cc20acdd4ac828",
|
|
10
|
+
"lastUpdated": "2026-02-10T18:51:20.317Z"
|
|
11
11
|
},
|
|
12
12
|
"exec-pwsh.test.mjs": {
|
|
13
|
-
"url": "https://console.testdriver.ai/runs/
|
|
14
|
-
"lastUpdated": "2026-02-
|
|
13
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7bd5297b1f49cee2a55f",
|
|
14
|
+
"lastUpdated": "2026-02-10T18:51:20.317Z"
|
|
15
15
|
},
|
|
16
16
|
"match-image.test.mjs": {
|
|
17
|
-
"url": "https://console.testdriver.ai/runs/
|
|
18
|
-
"lastUpdated": "2026-02-
|
|
17
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7bd7297b1f49cee2a560",
|
|
18
|
+
"lastUpdated": "2026-02-10T18:51:20.317Z"
|
|
19
19
|
},
|
|
20
20
|
"scroll-until-text.test.mjs": {
|
|
21
|
-
"url": "https://console.testdriver.ai/runs/
|
|
22
|
-
"lastUpdated": "2026-02-
|
|
21
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7c4d4f24dc8fa701f5ba",
|
|
22
|
+
"lastUpdated": "2026-02-10T18:51:20.319Z"
|
|
23
23
|
},
|
|
24
24
|
"hover-text-with-description.test.mjs": {
|
|
25
|
-
"url": "https://console.testdriver.ai/runs/
|
|
26
|
-
"lastUpdated": "2026-02-
|
|
25
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7c4a11cc20acdd4ac838",
|
|
26
|
+
"lastUpdated": "2026-02-10T18:51:20.318Z"
|
|
27
27
|
},
|
|
28
28
|
"windows-installer.test.mjs": {
|
|
29
|
-
"url": "https://console.testdriver.ai/runs/
|
|
30
|
-
"lastUpdated": "2026-02-
|
|
29
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7c4f4f24dc8fa701f5bb",
|
|
30
|
+
"lastUpdated": "2026-02-10T18:51:20.319Z"
|
|
31
31
|
},
|
|
32
32
|
"exec-output.test.mjs": {
|
|
33
|
-
"url": "https://console.testdriver.ai/runs/
|
|
34
|
-
"lastUpdated": "2026-02-
|
|
33
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7c504f24dc8fa701f5bc",
|
|
34
|
+
"lastUpdated": "2026-02-10T18:51:20.319Z"
|
|
35
35
|
},
|
|
36
36
|
"chrome-extension.test.mjs": {
|
|
37
|
-
"url": "https://console.testdriver.ai/runs/
|
|
38
|
-
"lastUpdated": "2026-02-
|
|
37
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7ca711cc20acdd4ac83d",
|
|
38
|
+
"lastUpdated": "2026-02-10T18:51:20.319Z"
|
|
39
39
|
},
|
|
40
40
|
"launch-vscode-linux.test.mjs": {
|
|
41
|
-
"url": "https://console.testdriver.ai/runs/
|
|
42
|
-
"lastUpdated": "2026-02-
|
|
41
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7cb811cc20acdd4ac83e",
|
|
42
|
+
"lastUpdated": "2026-02-10T18:51:20.319Z"
|
|
43
43
|
},
|
|
44
44
|
"hover-image.test.mjs": {
|
|
45
|
-
"url": "https://console.testdriver.ai/runs/
|
|
46
|
-
"lastUpdated": "2026-02-
|
|
45
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7c9211cc20acdd4ac83c",
|
|
46
|
+
"lastUpdated": "2026-02-10T18:51:20.319Z"
|
|
47
47
|
},
|
|
48
48
|
"installer.test.mjs": {
|
|
49
|
-
"url": "https://console.testdriver.ai/runs/
|
|
50
|
-
"lastUpdated": "2026-02-
|
|
49
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7ce511cc20acdd4ac844",
|
|
50
|
+
"lastUpdated": "2026-02-10T18:51:20.320Z"
|
|
51
51
|
},
|
|
52
52
|
"type.test.mjs": {
|
|
53
|
-
"url": "https://console.testdriver.ai/runs/
|
|
54
|
-
"lastUpdated": "2026-02-
|
|
53
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7d364f24dc8fa701f5e7",
|
|
54
|
+
"lastUpdated": "2026-02-10T18:51:20.321Z"
|
|
55
55
|
},
|
|
56
56
|
"press-keys.test.mjs": {
|
|
57
|
-
"url": "https://console.testdriver.ai/runs/
|
|
58
|
-
"lastUpdated": "2026-02-
|
|
57
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7cf911cc20acdd4ac84a",
|
|
58
|
+
"lastUpdated": "2026-02-10T18:51:20.321Z"
|
|
59
59
|
},
|
|
60
60
|
"scroll-keyboard.test.mjs": {
|
|
61
|
-
"url": "https://console.testdriver.ai/runs/
|
|
62
|
-
"lastUpdated": "2026-02-
|
|
61
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7d92297b1f49cee2a5b2",
|
|
62
|
+
"lastUpdated": "2026-02-10T18:51:20.322Z"
|
|
63
63
|
},
|
|
64
64
|
"scroll.test.mjs": {
|
|
65
|
-
"url": "https://console.testdriver.ai/runs/
|
|
66
|
-
"lastUpdated": "2026-02-
|
|
65
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7d39297b1f49cee2a5a7",
|
|
66
|
+
"lastUpdated": "2026-02-10T18:51:20.322Z"
|
|
67
67
|
},
|
|
68
68
|
"scroll-until-image.test.mjs": {
|
|
69
|
-
"url": "https://console.testdriver.ai/runs/
|
|
70
|
-
"lastUpdated": "2026-02-
|
|
69
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7d76297b1f49cee2a5b0",
|
|
70
|
+
"lastUpdated": "2026-02-10T18:51:20.322Z"
|
|
71
71
|
},
|
|
72
72
|
"prompt.test.mjs": {
|
|
73
|
-
"url": "https://console.testdriver.ai/runs/
|
|
74
|
-
"lastUpdated": "2026-02-
|
|
73
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7d774f24dc8fa701f5f0",
|
|
74
|
+
"lastUpdated": "2026-02-10T18:51:20.322Z"
|
|
75
75
|
},
|
|
76
76
|
"focus-window.test.mjs": {
|
|
77
|
-
"url": "https://console.testdriver.ai/runs/
|
|
78
|
-
"lastUpdated": "2026-02-
|
|
77
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7d794f24dc8fa701f5f1",
|
|
78
|
+
"lastUpdated": "2026-02-10T18:51:20.322Z"
|
|
79
79
|
},
|
|
80
80
|
"captcha-api.test.mjs": {
|
|
81
|
-
"url": "https://console.testdriver.ai/runs/
|
|
82
|
-
"lastUpdated": "2026-02-
|
|
81
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7da36513c6b23f858eee",
|
|
82
|
+
"lastUpdated": "2026-02-10T18:51:20.322Z"
|
|
83
83
|
},
|
|
84
84
|
"element-not-found.test.mjs": {
|
|
85
|
-
"url": "https://console.testdriver.ai/runs/
|
|
86
|
-
"lastUpdated": "2026-02-
|
|
85
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7dd44f24dc8fa701f5fc",
|
|
86
|
+
"lastUpdated": "2026-02-10T18:51:20.323Z"
|
|
87
87
|
},
|
|
88
88
|
"formatted-logging.test.mjs": {
|
|
89
|
-
"url": "https://console.testdriver.ai/runs/
|
|
90
|
-
"lastUpdated": "2026-02-
|
|
89
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7dd0297b1f49cee2a5b7",
|
|
90
|
+
"lastUpdated": "2026-02-10T18:51:20.323Z"
|
|
91
91
|
},
|
|
92
92
|
"hover-text.test.mjs": {
|
|
93
|
-
"url": "https://console.testdriver.ai/runs/
|
|
94
|
-
"lastUpdated": "2026-02-
|
|
93
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7e186513c6b23f858efc",
|
|
94
|
+
"lastUpdated": "2026-02-10T18:51:20.324Z"
|
|
95
95
|
},
|
|
96
96
|
"no-provision.test.mjs": {
|
|
97
|
-
"url": "https://console.testdriver.ai/runs/
|
|
98
|
-
"lastUpdated": "2026-02-
|
|
97
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7e024f24dc8fa701f601",
|
|
98
|
+
"lastUpdated": "2026-02-10T18:51:20.323Z"
|
|
99
99
|
},
|
|
100
100
|
"ai.test.mjs": {
|
|
101
|
-
"url": "https://console.testdriver.ai/runs/
|
|
102
|
-
"lastUpdated": "2026-02-
|
|
101
|
+
"url": "https://console.testdriver.ai/runs/698b7bd24f24dc8fa701f584/698b7e1e297b1f49cee2a5ba",
|
|
102
|
+
"lastUpdated": "2026-02-10T18:51:20.324Z"
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
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://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7e1e297b1f49cee2a5ba/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://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7d756513c6b23f858ee6/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
|
{/* captcha-api.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7da36513c6b23f858eee/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://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7ca711cc20acdd4ac83d/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
|
{/* drag-and-drop.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7bd411cc20acdd4ac828/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://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7dd44f24dc8fa701f5fc/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://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7c9211cc20acdd4ac83c/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-text.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7e186513c6b23f858efc/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://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7ce511cc20acdd4ac844/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://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7cb811cc20acdd4ac83e/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
|
{/* match-image.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7bd7297b1f49cee2a560/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
|
{/* press-keys.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7cf911cc20acdd4ac84a/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
|
{/* scroll-keyboard.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7d92297b1f49cee2a5b2/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
|
{/* scroll-until-image.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7d76297b1f49cee2a5b0/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
|
{/* scroll-until-text.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7c4d4f24dc8fa701f5ba/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
|
{/* scroll.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7d39297b1f49cee2a5a7/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
|
{/* type.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7d364f24dc8fa701f5e7/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://testdriver-api.onrender.com/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://testdriver-api.onrender.com/api/v1/testdriver/testcase/698b7c4f4f24dc8fa701f5bb/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
package/examples/ai.test.mjs
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("AI Test", () => {
|
|
10
11
|
it("should use ai to search for testdriver on Google", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
12
13
|
|
|
13
14
|
// provision.chrome() automatically calls ready() and starts dashcam
|
|
14
15
|
await testdriver.provision.chrome({
|
package/examples/assert.test.mjs
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Assert Test", () => {
|
|
10
11
|
it("should assert the testdriver login page shows", async (context) => {
|
|
11
12
|
const testdriver = TestDriver(context, {
|
|
12
|
-
|
|
13
|
-
ip: context.ip || process.env.TD_IP,
|
|
13
|
+
...getDefaults(context),
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
// provision.chrome() automatically calls ready() and starts dashcam
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { describe, expect, it } from "vitest";
|
|
6
6
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
7
|
+
import { getDefaults } from "./config.mjs";
|
|
7
8
|
|
|
8
9
|
console.log("DEBUG: process.env.TD_OS:", process.env.TD_OS);
|
|
9
10
|
|
|
10
11
|
describe("testdriver.captcha() API", () => {
|
|
11
12
|
it("should solve reCAPTCHA v3 with auto-detect", async (context) => {
|
|
12
|
-
const testdriver = TestDriver(context);
|
|
13
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
13
14
|
|
|
14
15
|
// Launch Chrome (remote debugging is enabled automatically on Linux)
|
|
15
16
|
await testdriver.provision.chrome({
|
|
@@ -30,7 +31,7 @@ describe("testdriver.captcha() API", () => {
|
|
|
30
31
|
}, 180000);
|
|
31
32
|
|
|
32
33
|
it("should solve Cloudflare Turnstile", async (context) => {
|
|
33
|
-
const testdriver = TestDriver(context);
|
|
34
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
34
35
|
|
|
35
36
|
await testdriver.provision.chrome({
|
|
36
37
|
url: "https://2captcha.com/demo/cloudflare-turnstile",
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
import { describe, expect, it } from "vitest";
|
|
11
11
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
12
|
+
import { getDefaults } from "./config.mjs";
|
|
12
13
|
|
|
13
14
|
describe("Chrome Extension Test", () => {
|
|
14
15
|
it("should load hello-world Chrome extension from local path", async (context) => {
|
|
15
16
|
|
|
16
17
|
console.log('connecting to', process.env.TD_IP)
|
|
17
18
|
|
|
18
|
-
const testdriver = TestDriver(context, {
|
|
19
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), cacheKey: new Date().getTime().toString() });
|
|
19
20
|
|
|
20
21
|
// Determine OS-specific paths and commands
|
|
21
22
|
const shell = testdriver.os === 'windows' ? 'pwsh' : 'sh';
|
|
@@ -65,7 +66,7 @@ describe("Chrome Extension Test", () => {
|
|
|
65
66
|
});
|
|
66
67
|
|
|
67
68
|
it("should load Loom from Chrome Web Store by extensionId", async (context) => {
|
|
68
|
-
const testdriver = TestDriver(context, {
|
|
69
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
69
70
|
|
|
70
71
|
// Launch Chrome with Loom loaded by its Chrome Web Store ID
|
|
71
72
|
// Loom ID: liecbddmkiiihnedobmlmillhodjkdmb
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
const isLinux = (process.env.TD_OS || "linux") === "linux";
|
|
10
11
|
|
|
@@ -12,7 +13,7 @@ describe("Drag and Drop Test", () => {
|
|
|
12
13
|
it.skipIf(isLinux)(
|
|
13
14
|
'should drag "New Text Document" to "Recycle Bin"',
|
|
14
15
|
async (context) => {
|
|
15
|
-
const testdriver = TestDriver(context, {
|
|
16
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
16
17
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
17
18
|
|
|
18
19
|
//
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Element Not Found Test", () => {
|
|
10
11
|
it("should handle non-existent element gracefully without timing out", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
12
13
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
14
|
|
|
14
15
|
//
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe.skip("Exec Output Test", () => {
|
|
10
11
|
it(
|
|
11
12
|
"should set date using PowerShell and navigate to calendar",
|
|
12
13
|
async (context) => {
|
|
13
|
-
const testdriver = TestDriver(context, {
|
|
14
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
14
15
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
15
16
|
|
|
16
17
|
//
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe.skip("Exec PowerShell Test", () => {
|
|
10
11
|
it(
|
|
11
12
|
"should generate random email using PowerShell and enter it",
|
|
12
13
|
async (context) => {
|
|
13
|
-
const testdriver = TestDriver(context, {
|
|
14
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
14
15
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
15
16
|
|
|
16
17
|
//
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Focus Window Test", () => {
|
|
10
11
|
it.skip(
|
|
11
12
|
"should click Microsoft Edge icon and focus Google Chrome",
|
|
12
13
|
async (context) => {
|
|
13
|
-
const testdriver = TestDriver(context, {
|
|
14
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
14
15
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
15
16
|
|
|
16
17
|
//
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Formatted Logging Test", () => {
|
|
10
11
|
it("should demonstrate formatted logs in dashcam replay", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
12
13
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
14
|
|
|
14
15
|
// Find and click - logs will be nicely formatted
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Perform login flow for SauceLabs demo app
|
|
@@ -27,7 +28,7 @@ async function performLogin(client, username = "standard_user") {
|
|
|
27
28
|
|
|
28
29
|
describe("Hover Image Test", () => {
|
|
29
30
|
it("should click on shopping cart icon and verify empty cart", async (context) => {
|
|
30
|
-
const testdriver = TestDriver(context, {
|
|
31
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
31
32
|
|
|
32
33
|
// provision.chrome() automatically calls ready() and starts dashcam
|
|
33
34
|
await testdriver.provision.chrome({
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Perform login flow for SauceLabs demo app
|
|
@@ -26,7 +27,7 @@ async function performLogin(client, username = "standard_user") {
|
|
|
26
27
|
describe("Hover Text With Description Test", () => {
|
|
27
28
|
it("should add TestDriver Hat to cart and verify", async (context) => {
|
|
28
29
|
const testdriver = TestDriver(context, {
|
|
29
|
-
|
|
30
|
+
...getDefaults(context),
|
|
30
31
|
headless: true,
|
|
31
32
|
});
|
|
32
33
|
await testdriver.provision.chrome({
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Hover Text Test", () => {
|
|
10
11
|
it("should click Sign In and verify error message", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
12
13
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
14
|
|
|
14
15
|
// Click on Sign In button using new find() API
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
const isLinux = (process.env.TD_OS || "linux") === "linux";
|
|
10
11
|
|
|
@@ -12,7 +13,7 @@ describe("Provision Installer", () => {
|
|
|
12
13
|
it.skipIf(!isLinux)(
|
|
13
14
|
"should download and install a .deb package on Linux",
|
|
14
15
|
async (context) => {
|
|
15
|
-
const testdriver = TestDriver(context, {
|
|
16
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
16
17
|
|
|
17
18
|
// Install bat (a cat clone with syntax highlighting) using provision.installer
|
|
18
19
|
const filePath = await testdriver.provision.installer({
|
|
@@ -30,7 +31,7 @@ describe("Provision Installer", () => {
|
|
|
30
31
|
it.skipIf(!isLinux)(
|
|
31
32
|
"should download a shell script and verify it exists",
|
|
32
33
|
async (context) => {
|
|
33
|
-
const testdriver = TestDriver(context, {
|
|
34
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
34
35
|
|
|
35
36
|
// Download a shell script (nvm installer)
|
|
36
37
|
const filePath = await testdriver.provision.installer({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
3
|
+
import { getDefaults } from "./config.mjs";
|
|
3
4
|
|
|
4
5
|
const isLinux = (process.env.TD_OS || "linux") === "linux";
|
|
5
6
|
|
|
@@ -7,7 +8,7 @@ describe("Launch VS Code on Linux", () => {
|
|
|
7
8
|
it.skipIf(!isLinux)(
|
|
8
9
|
"should launch VS Code on Debian/Ubuntu",
|
|
9
10
|
async (context) => {
|
|
10
|
-
const testdriver = TestDriver(context, {
|
|
11
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
11
12
|
|
|
12
13
|
// provision.vscode() automatically calls ready() and starts dashcam
|
|
13
14
|
await testdriver.provision.vscode();
|
|
@@ -24,7 +25,7 @@ describe("Launch VS Code on Linux", () => {
|
|
|
24
25
|
it.skipIf(!isLinux)(
|
|
25
26
|
"should install and use a VS Code extension",
|
|
26
27
|
async (context) => {
|
|
27
|
-
const testdriver = TestDriver(context, {
|
|
28
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
28
29
|
|
|
29
30
|
// Launch VS Code with the Prettier extension installed
|
|
30
31
|
await testdriver.provision.vscode({
|
|
@@ -7,6 +7,7 @@ import path, { dirname } from "path";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
import { describe, expect, it } from "vitest";
|
|
9
9
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
10
|
+
import { getDefaults } from "./config.mjs";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Perform login flow for SauceLabs demo app
|
|
@@ -33,7 +34,7 @@ const __dirname = dirname(__filename);
|
|
|
33
34
|
|
|
34
35
|
describe("Match Image Test", () => {
|
|
35
36
|
it.skip("should match shopping cart image and verify empty cart", async (context) => {
|
|
36
|
-
const testdriver = TestDriver(context, {
|
|
37
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
37
38
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
38
39
|
|
|
39
40
|
//
|
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Assert Test", () => {
|
|
10
11
|
it("should assert the testdriver login page shows", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
-
ip: context.ip || process.env.TD_IP,
|
|
13
|
-
});
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context) });
|
|
14
13
|
|
|
15
14
|
// Assert the TestDriver.ai Sandbox login page is displayed
|
|
16
15
|
const result = await testdriver.assert(
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Press Keys Test", () => {
|
|
10
11
|
it("should create tabs and navigate using keyboard shortcuts", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
12
13
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
14
|
|
|
14
15
|
const signInButton = await testdriver.find(
|
|
@@ -20,23 +21,16 @@ describe("Press Keys Test", () => {
|
|
|
20
21
|
await testdriver.pressKeys(["ctrl", "t"]);
|
|
21
22
|
|
|
22
23
|
// Poll for "Learn more" to appear
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (learnMore.found()) break;
|
|
27
|
-
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
28
|
-
}
|
|
24
|
+
let imagesLink = await testdriver.find("Images", {timeout: 5000});
|
|
25
|
+
|
|
26
|
+
expect(imagesLink.found()).toBeTruthy();
|
|
29
27
|
|
|
30
28
|
// Open DevTools
|
|
31
29
|
await testdriver.pressKeys(["ctrl", "shift", "i"]);
|
|
32
30
|
|
|
33
31
|
// Poll for "Elements" to appear
|
|
34
|
-
let elements = await testdriver.find("Elements");
|
|
35
|
-
|
|
36
|
-
elements = await elements.find();
|
|
37
|
-
if (elements.found()) break;
|
|
38
|
-
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
39
|
-
}
|
|
32
|
+
let elements = await testdriver.find("Elements", {timeout: 5000});
|
|
33
|
+
expect(elements.found()).toBeTruthy();
|
|
40
34
|
|
|
41
35
|
// Open another tab and navigate
|
|
42
36
|
await testdriver.pressKeys(["ctrl", "t"]);
|
package/examples/prompt.test.mjs
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe.skip("Prompt Test", () => {
|
|
10
11
|
it("should execute AI-driven prompts", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
12
13
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
14
|
|
|
14
15
|
//
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Scroll Keyboard Test", () => {
|
|
10
11
|
it("should navigate to webhamster.com and scroll with keyboard", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
12
13
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
14
|
|
|
14
15
|
//
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
describe("Scroll Until Image Test", () => {
|
|
10
11
|
it.skip("should scroll until brown colored house image appears", async (context) => {
|
|
11
|
-
const testdriver = TestDriver(context, {
|
|
12
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
12
13
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
14
|
|
|
14
15
|
//
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
import { getDefaults } from "./config.mjs";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Perform login flow for SauceLabs demo app
|
|
@@ -27,7 +28,7 @@ async function performLogin(client, username = "standard_user") {
|
|
|
27
28
|
|
|
28
29
|
describe("Scroll Until Text Test", () => {
|
|
29
30
|
it('should scroll until "testdriver socks" appears', async (context) => {
|
|
30
|
-
const testdriver = TestDriver(context, {
|
|
31
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
31
32
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
32
33
|
|
|
33
34
|
//
|
package/examples/scroll.test.mjs
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import { describe, expect, it } from "vitest";
|
|
9
9
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
10
|
+
import { getDefaults } from "./config.mjs";
|
|
10
11
|
|
|
11
12
|
describe("Scroll Test", () => {
|
|
12
13
|
it("should navigate and scroll down the page", async (context) => {
|
|
13
|
-
const testdriver = TestDriver(context, {
|
|
14
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
14
15
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
15
16
|
|
|
16
17
|
// Give Chrome a moment to fully render the UI
|
package/examples/type.test.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
3
|
+
import { getDefaults } from "./config.mjs";
|
|
3
4
|
|
|
4
5
|
describe("Type Test", () => {
|
|
5
6
|
it("should enter standard_user in username field", async (context) => {
|
|
6
|
-
const testdriver = TestDriver(context, {
|
|
7
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
7
8
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
8
9
|
|
|
9
10
|
//
|
|
@@ -20,7 +21,7 @@ describe("Type Test", () => {
|
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
it("should show validation message when clicking Sign In without password", async (context) => {
|
|
23
|
-
const testdriver = TestDriver(context, {
|
|
24
|
+
const testdriver = TestDriver(context, { ...getDefaults(context), headless: true });
|
|
24
25
|
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
25
26
|
|
|
26
27
|
// First fill in username
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import { describe, it } from "vitest";
|
|
13
13
|
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
14
|
+
import { getDefaults } from "./config.mjs";
|
|
14
15
|
|
|
15
16
|
const isLinux = (process.env.TD_OS || "linux") === "linux";
|
|
16
17
|
|
|
@@ -19,7 +20,7 @@ describe("Windows App Installation", () => {
|
|
|
19
20
|
it.skipIf(isLinux)("should download, install, and launch GitButler on Windows", async (context) => {
|
|
20
21
|
// Alternative approach using provision.installer helper
|
|
21
22
|
const testdriver = TestDriver(context, {
|
|
22
|
-
|
|
23
|
+
...getDefaults(context),
|
|
23
24
|
os: 'windows'
|
|
24
25
|
});
|
|
25
26
|
|
package/package.json
CHANGED
package/sdk.js
CHANGED
|
@@ -1567,6 +1567,51 @@ class TestDriverSDK {
|
|
|
1567
1567
|
return "C:\\PROGRA~1\\nodejs\\node_modules\\dashcam-chrome\\build";
|
|
1568
1568
|
}
|
|
1569
1569
|
|
|
1570
|
+
/**
|
|
1571
|
+
* Wait for Chrome DevTools Protocol debugger to be ready on port 9222,
|
|
1572
|
+
* then wait for a page to report loaded.
|
|
1573
|
+
* Works on both Windows (PowerShell) and Linux (sh).
|
|
1574
|
+
* @param {number} [timeoutMs=60000] - Maximum time to wait in ms
|
|
1575
|
+
* @returns {Promise<void>}
|
|
1576
|
+
*/
|
|
1577
|
+
async _waitForChromeDebuggerReady(timeoutMs = 60000) {
|
|
1578
|
+
const shell = this.os === "windows" ? "pwsh" : "sh";
|
|
1579
|
+
|
|
1580
|
+
if (this.os === "windows") {
|
|
1581
|
+
// Wait for port 9222 to be listening
|
|
1582
|
+
await this.exec(
|
|
1583
|
+
shell,
|
|
1584
|
+
`$timeout = ${Math.floor(timeoutMs / 1000)}; $elapsed = 0; while ($elapsed -lt $timeout) { try { $tcp = New-Object System.Net.Sockets.TcpClient; $tcp.Connect('127.0.0.1', 9222); $tcp.Close(); break } catch { Start-Sleep -Milliseconds 200; $elapsed += 0.2 } }`,
|
|
1585
|
+
timeoutMs,
|
|
1586
|
+
true,
|
|
1587
|
+
);
|
|
1588
|
+
|
|
1589
|
+
// Wait for a page target to appear via CDP
|
|
1590
|
+
await this.exec(
|
|
1591
|
+
shell,
|
|
1592
|
+
`$timeout = ${Math.floor(timeoutMs / 1000)}; $elapsed = 0; while ($elapsed -lt $timeout) { try { $r = Invoke-RestMethod -Uri 'http://localhost:9222/json' -TimeoutSec 2; if ($r | Where-Object { $_.type -eq 'page' }) { break } } catch {} Start-Sleep -Milliseconds 500; $elapsed += 0.5 }`,
|
|
1593
|
+
timeoutMs,
|
|
1594
|
+
true,
|
|
1595
|
+
);
|
|
1596
|
+
} else {
|
|
1597
|
+
// Wait for port 9222 to be listening
|
|
1598
|
+
await this.exec(
|
|
1599
|
+
shell,
|
|
1600
|
+
`timeout=${Math.floor(timeoutMs / 1000)}; elapsed=0; while [ $elapsed -lt $timeout ]; do nc -z localhost 9222 && break; sleep 0.2; elapsed=$((elapsed + 1)); done`,
|
|
1601
|
+
timeoutMs,
|
|
1602
|
+
true,
|
|
1603
|
+
);
|
|
1604
|
+
|
|
1605
|
+
// Wait for a page target to appear via CDP
|
|
1606
|
+
await this.exec(
|
|
1607
|
+
shell,
|
|
1608
|
+
`timeout=${Math.floor(timeoutMs / 1000)}; elapsed=0; while [ $elapsed -lt $timeout ]; do curl -s http://localhost:9222/json 2>/dev/null | grep -q '"type": "page"' && break; sleep 0.5; elapsed=$((elapsed + 1)); done`,
|
|
1609
|
+
timeoutMs,
|
|
1610
|
+
true,
|
|
1611
|
+
);
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1570
1615
|
_createProvisionAPI() {
|
|
1571
1616
|
const self = this;
|
|
1572
1617
|
|
|
@@ -1691,31 +1736,9 @@ class TestDriverSDK {
|
|
|
1691
1736
|
);
|
|
1692
1737
|
}
|
|
1693
1738
|
|
|
1694
|
-
// Wait for Chrome to be ready
|
|
1739
|
+
// Wait for Chrome debugger port and page to be ready
|
|
1740
|
+
await this._waitForChromeDebuggerReady();
|
|
1695
1741
|
await this.focusApplication("Google Chrome");
|
|
1696
|
-
|
|
1697
|
-
// Wait for URL to load
|
|
1698
|
-
try {
|
|
1699
|
-
const urlObj = new URL(url);
|
|
1700
|
-
const domain = urlObj.hostname;
|
|
1701
|
-
|
|
1702
|
-
for (let attempt = 0; attempt < 30; attempt++) {
|
|
1703
|
-
const result = await this.find(`${domain}`);
|
|
1704
|
-
|
|
1705
|
-
if (result.found()) {
|
|
1706
|
-
break;
|
|
1707
|
-
} else {
|
|
1708
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
await this.focusApplication("Google Chrome");
|
|
1713
|
-
} catch (e) {
|
|
1714
|
-
console.warn(
|
|
1715
|
-
`[provision.chrome] ⚠️ Could not parse URL "${url}":`,
|
|
1716
|
-
e.message,
|
|
1717
|
-
);
|
|
1718
|
-
}
|
|
1719
1742
|
},
|
|
1720
1743
|
|
|
1721
1744
|
/**
|
|
@@ -1977,20 +2000,8 @@ with zipfile.ZipFile(io.BytesIO(zip_data)) as zf:
|
|
|
1977
2000
|
);
|
|
1978
2001
|
}
|
|
1979
2002
|
|
|
1980
|
-
// Wait for Chrome to be ready
|
|
1981
|
-
await this.
|
|
1982
|
-
|
|
1983
|
-
// Wait for New Tab to appear
|
|
1984
|
-
for (let attempt = 0; attempt < 30; attempt++) {
|
|
1985
|
-
const result = await this.find("New Tab");
|
|
1986
|
-
|
|
1987
|
-
if (result.found()) {
|
|
1988
|
-
break;
|
|
1989
|
-
} else {
|
|
1990
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
|
|
2003
|
+
// Wait for Chrome debugger port and page to be ready
|
|
2004
|
+
await this._waitForChromeDebuggerReady();
|
|
1994
2005
|
await this.focusApplication("Google Chrome");
|
|
1995
2006
|
},
|
|
1996
2007
|
|