Closed nani554 closed 4 years ago
I found cy.get('.someClass').matchImageSnapshot();
as working solution.
But iam looking for any other good solution. please close this issue if you feel there aren't any more solutions other than above one. thank you
That's the correct way to do it.
That is the documented way to do it, although I can't get it to work with some elements (e.g modals). I am using instead cy.get('.someClass').matchImageSnapshot({ clip: { x: 123, y: 123, width:123, height: 123 } })
;
I figured out why I was having issues with capturing modal screenshots. The element returned from cy.get('#my-modal')
was, in fact, taking up the whole screen. The element I really wanted was its child.
I have tried using blackout option but the image doesn't look good. please provide me an option to select only particular element to take a screenshot
versions:
"dependencies": { "cypress": "^3.8.3", "cypress-image-snapshot": "^3.1.1" }