@snapvisor/puppeteer 6.0.23
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/LICENSE +8 -0
- package/README.md +55 -0
- package/package.json +70 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Copyright 2026 Devino Solutions Inc. (Snapvisor modifications)
|
|
2
|
+
Copyright 2022 Smooth Code
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://argos-ci.com/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/github-readme-logo-dark.png">
|
|
5
|
+
<img alt="Argos" src="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/github-readme-logo-light.png" width="360" height="70">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center"><strong>The open source visual testing platform for AI-native engineering teams.</strong></p>
|
|
11
|
+
|
|
12
|
+
# Official Argos Puppeteer integration
|
|
13
|
+
|
|
14
|
+
[](https://www.npmjs.com/package/@snapvisor/puppeteer)
|
|
15
|
+
[](https://www.npmjs.com/package/@snapvisor/puppeteer)
|
|
16
|
+
[](https://www.npmjs.com/package/@snapvisor/puppeteer)
|
|
17
|
+
|
|
18
|
+
Capture stable Argos screenshots from your [Puppeteer](https://github.com/puppeteer/puppeteer) tests.
|
|
19
|
+
|
|
20
|
+
Visit the [Puppeteer SDK documentation](https://argos-ci.com/docs/reference/puppeteer) for guides, the API reference, and more.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
Install the SDK alongside the [Argos CLI](https://argos-ci.com/docs/reference/argos-command-line-interface-cli), which uploads the screenshots to Argos:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install --save-dev @snapvisor/puppeteer @snapvisor/cli
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
Use `argosScreenshot` to stabilize the UI and capture a screenshot:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import puppeteer from "puppeteer";
|
|
36
|
+
import { argosScreenshot } from "@snapvisor/puppeteer";
|
|
37
|
+
|
|
38
|
+
const browser = await puppeteer.launch();
|
|
39
|
+
const page = await browser.newPage();
|
|
40
|
+
await page.goto("http://localhost:3000");
|
|
41
|
+
await argosScreenshot(page, "homepage");
|
|
42
|
+
await browser.close();
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Screenshots are saved locally (in `./screenshots/argos` by default). Upload them to Argos with the Argos CLI, usually at the end of your CI job:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
npx @snapvisor/cli upload ./screenshots
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Links
|
|
52
|
+
|
|
53
|
+
- [Official SDK Docs](https://argos-ci.com/docs/reference/puppeteer)
|
|
54
|
+
- [Quickstart](https://argos-ci.com/docs/quickstart/puppeteer-quickstart)
|
|
55
|
+
- [Discord](https://argos-ci.com/discord)
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@snapvisor/puppeteer",
|
|
3
|
+
"description": "Puppeteer SDK for visual testing with Argos.",
|
|
4
|
+
"version": "6.0.23",
|
|
5
|
+
"author": "Smooth Code",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/argos-ci/argos-javascript.git",
|
|
10
|
+
"directory": "packages/puppeteer"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://argos-ci.com/docs/reference/puppeteer",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/argos-ci/argos-javascript/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"puppeteer",
|
|
18
|
+
"argos",
|
|
19
|
+
"testing",
|
|
20
|
+
"visual testing",
|
|
21
|
+
"regression",
|
|
22
|
+
"visual regression"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"types": "./dist/index.d.mts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.mts",
|
|
32
|
+
"import": "./dist/index.mjs",
|
|
33
|
+
"require": "./dist/index.cjs",
|
|
34
|
+
"default": "./dist/index.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=22.0.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"puppeteer": ">=1"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@snapvisor/browser": "6.4.4",
|
|
46
|
+
"@snapvisor/util": "4.0.4"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@snapvisor/cli": "6.4.1",
|
|
50
|
+
"@types/jest": "^30.0.0",
|
|
51
|
+
"@types/node": "catalog:",
|
|
52
|
+
"expect-puppeteer": "^11.0.0",
|
|
53
|
+
"jest": "^30.4.2",
|
|
54
|
+
"jest-light-runner": "^0.7.12",
|
|
55
|
+
"jest-puppeteer": "^11.0.0",
|
|
56
|
+
"puppeteer": "^25.1.0"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsdown && cp ./src/index.cjs ./dist",
|
|
60
|
+
"jest": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
61
|
+
"test-e2e": "pnpm run jest --runInBand",
|
|
62
|
+
"argos-upload": "argos upload screenshots --build-name \"argos-puppeteer-e2e-node-$NODE_VERSION-$OS\"",
|
|
63
|
+
"build-e2e": "puppeteer browsers install chrome",
|
|
64
|
+
"e2e": "pnpm run test-e2e && pnpm run argos-upload",
|
|
65
|
+
"check-types": "tsc",
|
|
66
|
+
"check-format": "prettier --check --ignore-unknown --ignore-path=../../.gitignore --ignore-path=../../.prettierignore .",
|
|
67
|
+
"lint": "eslint ."
|
|
68
|
+
},
|
|
69
|
+
"gitHead": "345976da3198487edbaacc29641a3c0d8a233299"
|
|
70
|
+
}
|