@stablyai/playwright-test 2.0.0-next.2 โ 2.0.1
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/README.md +57 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,22 +1,69 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://stably.ai">
|
|
3
|
+
<h3 align="center">Stably</h3>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Code. Ship. <s>Test.</s>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://docs.stably.ai/"><strong>Documentation</strong></a> ยท
|
|
13
|
+
<a href="https://stably.ai/"><strong>Homepage</strong></a>
|
|
14
|
+
</p>
|
|
15
|
+
<br/>
|
|
16
|
+
|
|
1
17
|
# Stably Playwright Test
|
|
2
|
-
|
|
18
|
+
|
|
19
|
+
This package extends Playwright to add new AI functionality.
|
|
20
|
+
To get started quickly, please see [AI-assisted setup guide](https://docs.stably.ai/getting-started/sdk-setup-guide). Otherwise continue to read below.
|
|
3
21
|
|
|
4
22
|
## Installation
|
|
5
|
-
First ensure you remove any previous playwright/playwright-test installation
|
|
6
|
-
```shell
|
|
7
|
-
npm remove playwright @playwright/test
|
|
8
|
-
```
|
|
9
23
|
|
|
10
|
-
|
|
24
|
+
We assume you already have Playwright installed. If so you can run:
|
|
25
|
+
|
|
11
26
|
```shell
|
|
12
27
|
npm install @stablyai/playwright-test
|
|
13
28
|
```
|
|
14
29
|
|
|
15
|
-
##
|
|
30
|
+
## SDK
|
|
31
|
+
|
|
32
|
+
### Setup
|
|
33
|
+
|
|
16
34
|
Make sure you also get your [api-key](https://auth.stably.ai/account/api_keys) to use the AI features.
|
|
17
|
-
Either set the `
|
|
35
|
+
Either set the `STABLY_API_KEY` environment variable or programtically call `setApiKey` from `"@stablyai/playwright-test"`
|
|
36
|
+
|
|
37
|
+
### Usage
|
|
18
38
|
|
|
19
|
-
## Usage
|
|
20
39
|
1. Replace "@playwright/test" with "@stablyai/playwright-test"
|
|
21
40
|
1. Ex: imports should look like: import { test, expect } from "@stablyai/playwright-test";
|
|
22
|
-
2. Simply run tests with `npx playwright test` as you would normally using Playwright
|
|
41
|
+
2. Simply run tests with `npx playwright test` as you would normally using Playwright
|
|
42
|
+
|
|
43
|
+
### New Methods
|
|
44
|
+
|
|
45
|
+
The SDK adds new methods with AI visual assertions, full agent mode, and text extraction. See our [docs](https://docs.stably.ai/stably-sdk/ai-assertions) for more information.
|
|
46
|
+
|
|
47
|
+
## Stably Playwright Reporter
|
|
48
|
+
|
|
49
|
+
The [Stably Playwright Reporter](https://docs.stably.ai/reports-analytics#reports-and-analytics) also comes bundled with this package. Most users will find value in using this reporter for recording test results and having AI diagnostics.
|
|
50
|
+
|
|
51
|
+
### Setup
|
|
52
|
+
|
|
53
|
+
First, ensure you have your `STABLY_API_KEY` (secret). If you don't have it, you can get it [here](https://auth.stably.ai/account/api_keys).
|
|
54
|
+
Second, ensure that you have your Stably project ID (not a secret). You can get this from your web-app dashboard under settings
|
|
55
|
+
|
|
56
|
+
In your `playwright.config.ts/js` file add:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { defineConfig } from '@playwright/test';
|
|
60
|
+
import { stablyReporter } from '@stablyai/playwright-test';
|
|
61
|
+
|
|
62
|
+
export default defineConfig({
|
|
63
|
+
..., // your other config options go here
|
|
64
|
+
reporter: [
|
|
65
|
+
..., // (optional) other reporters go here
|
|
66
|
+
stablyReporter({ apiKey: process.env.STABLY_API_KEY, projectId: 'abc123' }), // ๐ Stably Reporter
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stablyai/playwright-test",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Playwright Test wrapper with Stably AI matchers",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@stablyai/playwright": "2.0.
|
|
25
|
-
"@stablyai/playwright-base": "2.0.
|
|
26
|
-
"@stablyai/playwright-reporter": "1.
|
|
24
|
+
"@stablyai/playwright": "2.0.1",
|
|
25
|
+
"@stablyai/playwright-base": "2.0.1",
|
|
26
|
+
"@stablyai/playwright-reporter": "1.3.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@playwright/test": "^1.52.0"
|