testdriverai 6.0.29 → 6.0.30-canary.ff65ed2.0
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.
|
@@ -6,6 +6,8 @@ description: In this guide, you'll setup your TestDriver account, create a new P
|
|
|
6
6
|
icon: "masks-theater"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
9
11
|
`@testdriver.ai/playwright` is a backwards-compatible wrapper around `@playwright/test` that uses TestDriver's Vision AI to:
|
|
10
12
|
|
|
11
13
|
- Make [natural language assertions](#assertions-with-expect-tomatchprompt)
|
|
@@ -13,6 +15,30 @@ icon: "masks-theater"
|
|
|
13
15
|
- [Perform actions](#performing-actions-with-testdriver-act) with a prompt
|
|
14
16
|
- Test with an [automated agent](#agentic-tests-with-test-agent)
|
|
15
17
|
|
|
18
|
+
We'll be incrementally converting Playwright's example test from imperactive code:
|
|
19
|
+
|
|
20
|
+
```typescript icon="square-js" title="tests/example.spec.ts"
|
|
21
|
+
// Before
|
|
22
|
+
test("get started link", async ({ page, testdriver }) => {
|
|
23
|
+
await page.goto("https://playwright.dev/");
|
|
24
|
+
await testdriver(page).act("Click the 'Get started' link");
|
|
25
|
+
await expect(page).toMatchPrompt("'Installation' heading is visible");
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
To using natural language:
|
|
30
|
+
|
|
31
|
+
```typescript icon="square-js" title="tests/example.spec.ts"
|
|
32
|
+
// After
|
|
33
|
+
test.describe("get started link", () => {
|
|
34
|
+
test.beforeEach(async ({ page }) => page.goto("https://playwright.dev/"));
|
|
35
|
+
test.agent(`
|
|
36
|
+
- Click the 'Get started' link
|
|
37
|
+
- Verify the 'Installation' heading is visible
|
|
38
|
+
`);
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
16
42
|
## Prerequisites
|
|
17
43
|
|
|
18
44
|
<Steps>
|