Skip to content

Instantly share code, notes, and snippets.

@wwilsman
Created August 22, 2019 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwilsman/8679cb85288308bd44d6d165abec41ae to your computer and use it in GitHub Desktop.
Save wwilsman/8679cb85288308bd44d6d165abec41ae to your computer and use it in GitHub Desktop.
Cypress - Inject Percy-specific CSS
// access the cypress document
cy.document().then(doc => {
// create a new style tag
let $style = doc.createElement("style");
// add percy-specific css
$style.innerHTML = "@media only percy { iframe { display: none !important; } };";
// inject styles into the document
doc.body.head.appendChild($style);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment