meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
491 stars 116 forks source link

Snapshot fails when runing `cypress run --spec filePath` but works on Cypress app #135

Open nigellima opened 4 years ago

nigellima commented 4 years ago

Describe the bug When I run the tests on the Cypress app (cypress open) each spec individually, it works as expected. But, I'm setting up now a way to run the tests as a package.json script using the cypress run --spec ${filePath} as in the README it says I can't run All specs at the same time. But it keeps failing even when I run a single spec file in the command line

To Reproduce Steps to reproduce the behavior:

  1. Create test with snapshot
  2. Test it in Cypress app, it should work
  3. Run single test file with cypress run --spec "cypress/integration/my_spec.spec.ts"

Expected behavior Test should work

Desktop (please complete the following information):

meinaart commented 3 years ago

Image snapshot or text snapshot?

I have had issues with image snapshot as well. Seems the rendering is not exactly the same, did you compare the actual and the expected?

What does actually happen?

FDiskas commented 3 years ago

in my case the image resolution is different On left: Actual On right: Test case image