@argos-ci/playwright 7.3.0 → 7.3.4
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 +50 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</a>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
<p align="center"><strong>The open source visual testing
|
|
10
|
+
<p align="center"><strong>The open source visual testing platform for AI-native engineering teams.</strong></p>
|
|
11
11
|
|
|
12
12
|
# Official Argos Playwright integration
|
|
13
13
|
|
|
@@ -15,9 +15,56 @@
|
|
|
15
15
|
[](https://www.npmjs.com/package/@argos-ci/playwright)
|
|
16
16
|
[](https://www.npmjs.com/package/@argos-ci/playwright)
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Capture stable Argos screenshots from your [Playwright](https://playwright.dev/) tests, and report failure screenshots and traces to Argos.
|
|
19
|
+
|
|
20
|
+
Visit the [Playwright SDK documentation](https://argos-ci.com/docs/sdks-reference/playwright) for guides, the API reference, and more.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install --save-dev @argos-ci/playwright
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
Set up the Argos reporter in your Playwright config:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// playwright.config.ts
|
|
34
|
+
import { defineConfig } from "@playwright/test";
|
|
35
|
+
import { createArgosReporterOptions } from "@argos-ci/playwright/reporter";
|
|
36
|
+
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
// ... other configuration
|
|
39
|
+
reporter: [
|
|
40
|
+
// Use "dot" reporter on CI, "list" otherwise (Playwright default).
|
|
41
|
+
process.env.CI ? ["dot"] : ["list"],
|
|
42
|
+
|
|
43
|
+
// Add the Argos reporter.
|
|
44
|
+
[
|
|
45
|
+
"@argos-ci/playwright/reporter",
|
|
46
|
+
// Upload the screenshots to Argos only on CI.
|
|
47
|
+
createArgosReporterOptions({ uploadToArgos: !!process.env.CI }),
|
|
48
|
+
],
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Then capture stable screenshots with `argosScreenshot` in your tests:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
// tests/example.spec.ts
|
|
57
|
+
import { test } from "@playwright/test";
|
|
58
|
+
import { argosScreenshot } from "@argos-ci/playwright";
|
|
59
|
+
|
|
60
|
+
test("screenshot homepage", async ({ page }) => {
|
|
61
|
+
await page.goto("http://localhost:3000");
|
|
62
|
+
await argosScreenshot(page, "homepage");
|
|
63
|
+
});
|
|
64
|
+
```
|
|
19
65
|
|
|
20
66
|
## Links
|
|
21
67
|
|
|
22
|
-
- [Official SDK Docs](https://argos-ci.com/docs/)
|
|
68
|
+
- [Official SDK Docs](https://argos-ci.com/docs/sdks-reference/playwright)
|
|
69
|
+
- [Quickstart](https://argos-ci.com/docs/quickstart/playwright-quickstart)
|
|
23
70
|
- [Discord](https://argos-ci.com/discord)
|
package/dist/index.d.mts
CHANGED
|
@@ -143,7 +143,7 @@ type ArgosScreenshotOptions = {
|
|
|
143
143
|
*
|
|
144
144
|
* @example
|
|
145
145
|
* argosScreenshot(page, "my-screenshot")
|
|
146
|
-
* @see https://argos-ci.com/docs/playwright
|
|
146
|
+
* @see https://argos-ci.com/docs/sdks-reference/playwright
|
|
147
147
|
*/
|
|
148
148
|
declare function argosScreenshot(
|
|
149
149
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -425,7 +425,7 @@ const DEFAULT_SCREENSHOT_ROOT = "./screenshots";
|
|
|
425
425
|
*
|
|
426
426
|
* @example
|
|
427
427
|
* argosScreenshot(page, "my-screenshot")
|
|
428
|
-
* @see https://argos-ci.com/docs/playwright
|
|
428
|
+
* @see https://argos-ci.com/docs/sdks-reference/playwright
|
|
429
429
|
*/
|
|
430
430
|
async function argosScreenshot(handler, name, options = {}) {
|
|
431
431
|
const { element, has, hasText, hasNot, hasNotText, viewports, argosCSS: _argosCSS, root = DEFAULT_SCREENSHOT_ROOT, ariaSnapshot, disableHover = true, ...playwrightOptions } = options;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/playwright",
|
|
3
3
|
"description": "Playwright SDK for visual testing with Argos.",
|
|
4
|
-
"version": "7.3.
|
|
4
|
+
"version": "7.3.4",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/argos-ci/argos-javascript.git",
|
|
10
10
|
"directory": "packages/playwright"
|
|
11
11
|
},
|
|
12
|
-
"homepage": "https://argos-ci.com/docs/playwright",
|
|
12
|
+
"homepage": "https://argos-ci.com/docs/sdks-reference/playwright",
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/argos-ci/argos-javascript/issues"
|
|
15
15
|
},
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"node": ">=22.0.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@argos-ci/browser": "6.4.
|
|
51
|
-
"@argos-ci/core": "6.
|
|
52
|
-
"@argos-ci/util": "4.0.
|
|
50
|
+
"@argos-ci/browser": "6.4.4",
|
|
51
|
+
"@argos-ci/core": "6.5.3",
|
|
52
|
+
"@argos-ci/util": "4.0.4",
|
|
53
53
|
"chalk": "^5.6.2",
|
|
54
54
|
"debug": "^4.4.3"
|
|
55
55
|
},
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"lint": "eslint .",
|
|
70
70
|
"test": "vitest src"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "1b25b7c1109a3d032d627c5f9d2f2c3937731aea"
|
|
73
73
|
}
|