meinaart / cypress-plugin-snapshots

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

Only takes one image snapshot, doesn't take any further ones (Cypress@3.4.1, cypress-plugin-snapshots#666d7ee) #43

Open jjt opened 5 years ago

jjt commented 5 years ago

Repro case here: https://github.com/jjt/cypress-plugin-snapshots-test

It seems like it only ever takes an initial snapshot and doesn't recapture it. For example, here's after the second run after some changes, where you can see that the contents of the snapshot is a red square with the words HELLO THERE, and the contents of the DOM on the second run is a green square with the text oh hi

image

image

jjt commented 5 years ago

contents of the cypress/ dir after the second test run:

~/p/c/cypress ❯❯❯ tree
.
├── fixtures
│   └── example.json
├── integration
│   ├── __image_snapshots__
│   │   └── Test\ \ does\ more\ than\ one\ snapshot\ #0.png
│   └── test-regression.spec.js
├── plugins
│   └── index.js
├── screenshots
│   └── test-regression.spec.js
└── support
    ├── commands.js
    └── index.js
meinaart commented 5 years ago

@jjt Can you retry with latest version and let me know if that fixes it?

jjt commented 5 years ago

tried with 1.2.8 and @9eafd96 and still the same behaviour wiped yarn.lock, node_modules, reinstalled nuked the cypress/screenshots and cypress/integration/__image_snapshots__ dirs between trials too (stopped cypress, deleted those dirs, ran the test, changed element, ran test again) - still showing the old screenshot but with new DOM as per my images above

meinaart commented 5 years ago

Thanks for retesting. Will look into it.