test: percy snapshot workaround (#1085)

* Try workaround for percy snapshot

* Return our modified document
This commit is contained in:
Danny Brown 2019-10-24 16:09:59 -04:00 committed by GitHub
parent 3a12138134
commit 7668b69f20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,10 +312,12 @@ Cypress.Commands.add('isInViewport', element => {
*
*/
Cypress.Commands.add('percyCanvasSnapshot', (name, options = {}) => {
function convertCanvas(document) {
document
function convertCanvas(documentClone) {
documentClone
.querySelectorAll('canvas')
.forEach(selector => canvasToImage(selector));
return documentClone;
}
function canvasToImage(selectorOrEl) {