@testdriverai/mcp 7.9.161-canary → 7.9.162-canary
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/docs.json +1 -2
- package/package.json +1 -1
- package/docs/v7/examples/ai.mdx +0 -73
package/docs/docs.json
CHANGED
|
@@ -20,12 +20,10 @@
|
|
|
20
20
|
"group": "Overview",
|
|
21
21
|
"pages": [
|
|
22
22
|
"/v7/quickstart",
|
|
23
|
-
"/v7/what-is-testdriver",
|
|
24
23
|
{
|
|
25
24
|
"group": "Examples",
|
|
26
25
|
"icon": "code",
|
|
27
26
|
"pages": [
|
|
28
|
-
"/v7/examples/ai",
|
|
29
27
|
"/v7/examples/assert",
|
|
30
28
|
"/v7/examples/chrome-extension",
|
|
31
29
|
"/v7/examples/element-not-found",
|
|
@@ -42,6 +40,7 @@
|
|
|
42
40
|
"/v7/examples/type"
|
|
43
41
|
]
|
|
44
42
|
},
|
|
43
|
+
"/v7/what-is-testdriver",
|
|
45
44
|
{
|
|
46
45
|
"group": "Deployment",
|
|
47
46
|
"icon": "server",
|
package/package.json
CHANGED
package/docs/v7/examples/ai.mdx
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "AI Test Example"
|
|
3
|
-
sidebarTitle: "AI"
|
|
4
|
-
description: "Example test using the AI exploratory loop to automate complex multi-step interactions."
|
|
5
|
-
icon: "wand-magic-sparkles"
|
|
6
|
-
mode: "wide"
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Demo Test Run
|
|
10
|
-
|
|
11
|
-
Watch this test execute in a real sandbox environment:
|
|
12
|
-
|
|
13
|
-
{/* ai.test.mjs output */}
|
|
14
|
-
<iframe
|
|
15
|
-
src="https://console-test.testdriver.ai/replay/6a3c85bda377db15ec79a1cb?share=atuShrmwV3Td5vfB5wOXTw&embed=true"
|
|
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="ai.test.mjs" {17}
|
|
25
|
-
/**
|
|
26
|
-
* TestDriver SDK - AI Test (Vitest)
|
|
27
|
-
* Tests the AI exploratory loop (ai) functionality
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
import { describe, expect, it } from "vitest";
|
|
31
|
-
import { TestDriver } from "testdriverai/vitest/hooks";
|
|
32
|
-
|
|
33
|
-
describe("AI Test", () => {
|
|
34
|
-
it("should use ai to search for testdriver on Google", async (context) => {
|
|
35
|
-
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP});
|
|
36
|
-
|
|
37
|
-
// provision.chrome() automatically calls ready() and starts dashcam
|
|
38
|
-
await testdriver.provision.chrome({
|
|
39
|
-
url: 'https://duckduckgo.com',
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// Use ai to search for testdriver
|
|
43
|
-
let aiRes = await testdriver.ai("click on the empty search box, type 'testdriver', and hit enter.");
|
|
44
|
-
|
|
45
|
-
console.log("AI response:", aiRes);
|
|
46
|
-
|
|
47
|
-
// Assert the search results are displayed
|
|
48
|
-
const result = await testdriver.assert(
|
|
49
|
-
"search results for testdriver are visible",
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
expect(result).toBeTruthy();
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Running This Example
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
# Clone the TestDriver repository
|
|
61
|
-
git clone https://github.com/testdriverai/testdriverai
|
|
62
|
-
|
|
63
|
-
# Install dependencies
|
|
64
|
-
cd testdriverai
|
|
65
|
-
npm install
|
|
66
|
-
|
|
67
|
-
# Run this specific example
|
|
68
|
-
npx vitest run examples/ai.test.mjs
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
<Note>
|
|
72
|
-
Make sure you have `TD_API_KEY` set in your environment. Get one at [testdriver.ai](https://testdriver.ai).
|
|
73
|
-
</Note>
|