@argos-ci/cypress 7.0.15 → 7.0.19
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 +58 -4
- package/dist/support.d.mts +1 -1
- package/dist/support.mjs +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://argos-ci.com/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
-
|
|
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>
|
|
4
7
|
</a>
|
|
5
8
|
</p>
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
<p align="center"><strong>The open source visual testing platform for AI-native engineering teams.</strong></p>
|
|
8
11
|
|
|
9
12
|
# Official Argos Cypress integration
|
|
10
13
|
|
|
@@ -12,9 +15,60 @@ _Argos is a visual testing solution that fits in your workflow to avoid visual r
|
|
|
12
15
|
[](https://www.npmjs.com/package/@argos-ci/cypress)
|
|
13
16
|
[](https://www.npmjs.com/package/@argos-ci/cypress)
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
Capture stable Argos screenshots from your [Cypress](https://www.cypress.io/) tests.
|
|
19
|
+
|
|
20
|
+
Visit the [Cypress SDK documentation](https://argos-ci.com/docs/sdks-reference/cypress) for guides, the API reference, and more.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install --save-dev @argos-ci/cypress
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
Register the Argos task in your Cypress config:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// cypress.config.js
|
|
34
|
+
const { defineConfig } = require("cypress");
|
|
35
|
+
const { registerArgosTask } = require("@argos-ci/cypress/task");
|
|
36
|
+
|
|
37
|
+
module.exports = defineConfig({
|
|
38
|
+
e2e: {
|
|
39
|
+
setupNodeEvents(on, config) {
|
|
40
|
+
registerArgosTask(on, config, {
|
|
41
|
+
// Upload the screenshots to Argos only on CI.
|
|
42
|
+
uploadToArgos: !!process.env.CI,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return config;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Import the command in your support file:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// cypress/support/e2e.js
|
|
55
|
+
import "@argos-ci/cypress/support";
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then capture stable screenshots with `cy.argosScreenshot` in your tests:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
// cypress/e2e/example.cy.js
|
|
62
|
+
describe("Homepage", () => {
|
|
63
|
+
it("takes a screenshot", () => {
|
|
64
|
+
cy.visit("http://localhost:3000");
|
|
65
|
+
cy.argosScreenshot("homepage");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
```
|
|
16
69
|
|
|
17
70
|
## Links
|
|
18
71
|
|
|
19
|
-
- [Official SDK Docs](https://argos-ci.com/docs)
|
|
72
|
+
- [Official SDK Docs](https://argos-ci.com/docs/sdks-reference/cypress)
|
|
73
|
+
- [Quickstart](https://argos-ci.com/docs/quickstart/cypress-quickstart)
|
|
20
74
|
- [Discord](https://argos-ci.com/discord)
|
package/dist/support.d.mts
CHANGED
|
@@ -34,7 +34,7 @@ declare global {
|
|
|
34
34
|
/**
|
|
35
35
|
* Stabilize the UI and takes a screenshot of the application under test.
|
|
36
36
|
*
|
|
37
|
-
* @see https://argos-ci.com/docs/cypress
|
|
37
|
+
* @see https://argos-ci.com/docs/sdks-reference/cypress
|
|
38
38
|
* @example
|
|
39
39
|
* cy.argosScreenshot("my-screenshot")
|
|
40
40
|
* cy.get(".post").argosScreenshot()
|
package/dist/support.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import "cypress-wait-until";
|
|
|
2
2
|
import { getGlobalScript, resolveViewport } from "@argos-ci/browser";
|
|
3
3
|
import { getMetadataPath, getScreenshotName, validateThreshold } from "@argos-ci/util/browser";
|
|
4
4
|
//#region package.json
|
|
5
|
-
var version = "7.0.
|
|
5
|
+
var version = "7.0.16";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/shared.ts
|
|
8
8
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/cypress",
|
|
3
3
|
"description": "Cypress SDK for visual testing with Argos.",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.19",
|
|
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/cypress"
|
|
11
11
|
},
|
|
12
|
-
"homepage": "https://argos-ci.com/docs/cypress",
|
|
12
|
+
"homepage": "https://argos-ci.com/docs/sdks-reference/cypress",
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/argos-ci/argos-javascript/issues"
|
|
15
15
|
},
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"node": ">=22.0.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@argos-ci/browser": "6.4.
|
|
48
|
-
"@argos-ci/core": "6.
|
|
49
|
-
"@argos-ci/util": "4.0.
|
|
47
|
+
"@argos-ci/browser": "6.4.4",
|
|
48
|
+
"@argos-ci/core": "6.5.3",
|
|
49
|
+
"@argos-ci/util": "4.0.4",
|
|
50
50
|
"cypress-wait-until": "^3.0.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"check-format": "prettier --check --ignore-unknown --ignore-path=../../.gitignore --ignore-path=../../.prettierignore .",
|
|
67
67
|
"lint": "eslint ."
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "1b25b7c1109a3d032d627c5f9d2f2c3937731aea"
|
|
70
70
|
}
|