@argos-ci/cypress 0.0.4 → 0.0.6
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 +12 -54
- package/package.json +1 -1
- package/support.js +4 -0
package/README.md
CHANGED
|
@@ -1,62 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://argos-ci.com/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/logo-github-readme.png" alt="Argos" width="300" height="61">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
_Argos is a visual testing solution that fits in your workflow to avoid visual regression. Takes screenshots on each commit and be notified if something changes._
|
|
8
|
+
|
|
9
|
+
# Official Argos Cypress integration
|
|
4
10
|
|
|
5
11
|
[](https://www.npmjs.com/package/@argos-ci/cypress)
|
|
6
12
|
[](https://www.npmjs.com/package/@argos-ci/cypress)
|
|
7
13
|
[](https://www.npmjs.com/package/@argos-ci/cypress)
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
npm install --save-dev @argos-ci/cypress
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
And add this line to your `cypress/support/index.js` file.
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
import "@argos-ci/cypress/support";
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
`cy.argosScreenshot` command stabilizes the UI and takes a screenshot.
|
|
24
|
-
|
|
25
|
-
_How to take a screenshot with `cy.argosScreenshot` command_
|
|
26
|
-
|
|
27
|
-
```js
|
|
28
|
-
describe("Homepage", () => {
|
|
29
|
-
it("should be stable", () => {
|
|
30
|
-
// Screenshot a full page
|
|
31
|
-
cy.argosScreenshot("home");
|
|
32
|
-
|
|
33
|
-
// Screenshot a component
|
|
34
|
-
cy.get("main div.breadcrumb").argosScreenshot("home-breadcrumb");
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## API
|
|
40
|
-
|
|
41
|
-
### cy.argosScreenshot([name][, options])
|
|
42
|
-
|
|
43
|
-
- `name` - The screenshot name; must be unique; default value to test title
|
|
44
|
-
- `options` - See [cy.screenshot command options](https://docs.cypress.io/api/commands/screenshot)
|
|
45
|
-
|
|
46
|
-
## Helper attributes
|
|
47
|
-
|
|
48
|
-
The `data-visual-test` attributes allow you to control how elements behave in the Argos screenshot.
|
|
49
|
-
|
|
50
|
-
It is often used to hide changing element like dates.
|
|
51
|
-
|
|
52
|
-
- `[data-visual-test="transparent"]` - Make the element transparent (`opacity: 0`)
|
|
53
|
-
- `[data-visual-test="removed"]` - Remove the element (`display: none`)
|
|
54
|
-
- `[data-visual-test="blackout"]` - Blacked out the element
|
|
15
|
+
Visit [docs.argos-ci.com/cypress](https://docs.argos-ci.com/cypress) for guides, API and more.
|
|
55
16
|
|
|
56
|
-
|
|
17
|
+
## Links
|
|
57
18
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<!-- the clock code -->
|
|
61
|
-
</div>
|
|
62
|
-
```
|
|
19
|
+
- [Official SDK Docs](https://docs.argos-ci.com/)
|
|
20
|
+
- [Discord](https://discord.gg/WjzGrQGS4A)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/cypress",
|
|
3
3
|
"description": "Visual testing solution to avoid visual regression. Cypress commands and utilities for Argos visual testing.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github:argos-ci/argos-cypress",
|