@argos-ci/cypress
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "@argos-ci/cypress", | ||
"description": "Visual testing solution to avoid visual regression. Cypress commands and utilities for Argos visual testing.", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"author": "Smooth Code", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -15,7 +15,7 @@ <p align="center"> | ||
Visit [docs.argos-ci.com/cypress](https://docs.argos-ci.com/cypress) for guides, API and more. | ||
Visit [argos-ci.com/docs/cypress](https://argos-ci.com/docs/cypress) for guides, API and more. | ||
## Links | ||
- [Official SDK Docs](https://docs.argos-ci.com/) | ||
- [Official SDK Docs](https://argos-ci.com/docs) | ||
- [Discord](https://discord.gg/WjzGrQGS4A) |
@@ -75,9 +75,24 @@ import "cypress-wait-until"; | ||
}); | ||
// Inject styles | ||
cy.document().then((doc) => injectStyles(doc)); | ||
// Wait until there is no `[aria-busy="true"]` element on the page. | ||
waitUntilNoBusy(); | ||
// Wait for fonts to be loaded | ||
cy.document().its("fonts.status").should("equal", "loaded"); | ||
// Wait for images to be loaded | ||
cy.waitUntil(() => | ||
cy.document().then((document) => { | ||
const allImages = Array.from(document.images); | ||
allImages.forEach((img) => { | ||
img.loading = "eager"; | ||
img.decoding = "sync"; | ||
}); | ||
return allImages.every((img) => img.complete && img.naturalWidth > 0); | ||
}) | ||
); | ||
// Screenshot | ||
@@ -84,0 +99,0 @@ cy.wrap(subject).screenshot(name, { |
6405
106