meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
498 stars 117 forks source link

(bug) Failing to take Image Snap Shot of an Element #155

Open jkodi-215 opened 3 years ago

jkodi-215 commented 3 years ago

Describe the bug Failing to take Image Snap Shot of an Element

To Reproduce in the test block cy.visit('/') cy.get('.form').click() cy.get('.header').toMatchImageSnapshot()

Expected behavior It should a image snap shot of that element

Actual behavior cy.screenshot() failed because it requires a DOM element.

The subject received was:

Object{}

The previous command that ran was:

cy.wrap()

All 3 subject validations failed on this subject.

Note: I am passing a DOM element

Desktop (please complete the following information):

craig-dae commented 3 years ago

I just started trying to use this project to compare plotly charts and to check for unexpected changes. I'm getting the same error.

Ayase-252 commented 3 years ago

If you are using zepto, it may be a cypress issue https://github.com/cypress-io/cypress/issues/6529.

This stackoverflow post may solve your problem.