@argos-ci/cypress 0.0.5 → 0.0.7

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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/support.js +19 -0
package/README.md CHANGED
@@ -12,9 +12,9 @@ _Argos is a visual testing solution that fits in your workflow to avoid visual r
12
12
  [![npm dm](https://img.shields.io/npm/dm/@argos-ci/cypress.svg)](https://www.npmjs.com/package/@argos-ci/cypress)
13
13
  [![npm dt](https://img.shields.io/npm/dt/@argos-ci/cypress.svg)](https://www.npmjs.com/package/@argos-ci/cypress)
14
14
 
15
- Visit [docs.argos-ci.com/cypress](https://docs.argos-ci.com/cypress) for guides, API and more.
15
+ Visit [argos-ci.com/docs/cypress](https://argos-ci.com/docs/cypress) for guides, API and more.
16
16
 
17
17
  ## Links
18
18
 
19
- - [Official SDK Docs](https://docs.argos-ci.com/)
20
- - [Discord](https://discord.gg/pK79sv85Vg)
19
+ - [Official SDK Docs](https://argos-ci.com/docs)
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.5",
4
+ "version": "0.0.7",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": "github:argos-ci/argos-cypress",
package/support.js CHANGED
@@ -19,6 +19,10 @@ const GLOBAL_STYLES = `
19
19
  [data-visual-test="removed"] {
20
20
  display: none !important;
21
21
  }
22
+
23
+ [data-test-no-radius] {
24
+ border-radius: 0 !important;
25
+ }
22
26
  `;
23
27
 
24
28
  /**
@@ -68,13 +72,28 @@ Cypress.Commands.add(
68
72
  displayName: `Argos Screenshot`,
69
73
  message: name,
70
74
  });
75
+
71
76
  // Inject styles
72
77
  cy.document().then((doc) => injectStyles(doc));
78
+
73
79
  // Wait until there is no `[aria-busy="true"]` element on the page.
74
80
  waitUntilNoBusy();
81
+
75
82
  // Wait for fonts to be loaded
76
83
  cy.document().its("fonts.status").should("equal", "loaded");
77
84
 
85
+ // Wait for images to be loaded
86
+ cy.waitUntil(() =>
87
+ cy.document().then((document) => {
88
+ const allImages = Array.from(document.images);
89
+ allImages.forEach((img) => {
90
+ img.loading = "eager";
91
+ img.decoding = "sync";
92
+ });
93
+ return allImages.every((img) => img.complete && img.naturalWidth > 0);
94
+ })
95
+ );
96
+
78
97
  // Screenshot
79
98
  cy.wrap(subject).screenshot(name, {
80
99
  blackout: ['[data-visual-test="blackout"]'].concat(