Created
August 22, 2019 17:08
-
-
Save wwilsman/8679cb85288308bd44d6d165abec41ae to your computer and use it in GitHub Desktop.
Cypress - Inject Percy-specific CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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