Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using 'failOnSnapshotDiff=false' no snapshot-diffs are created #207

Open
vglaeser opened this issue Jul 4, 2021 · 2 comments
Open

Comments

@vglaeser
Copy link

vglaeser commented Jul 4, 2021

Hi,

I'm using the plugin with multiple e2e-tests. Actually, it is running quite well but when there are mutliple snapshots made in a single test only the first one is emitted since the test will fail afterwards. In order to avoid this, I tried failOnSnapshotDiff=false. With this option tests no longe fail, but diff-files are not created either.
As far as I see, the variable pass (e.g. in plugin.js/matchImageSnapshotResult) seems to be set to true when using failOnSnapshotDiff=false even if there is a diff between existing and new snapshots.
I would expect that diff_files are created anyway. Otherwise, you will propably miss other snapshot-diffs of the same test. (Assume a test that fails due to different snapshots. After accepting the difference you update existing snapshots which will overwrite any other potential differences)

Is this the intended behaviour or is there another way to create snapshot-diffs of all snapshots in a test?

Thanks in advance

@francescq
Copy link

This is the same behaviour I'm experiencing

Running with cypress openit respects failOnSnapshotDiff and the diff files are always created
Running with cypress rundoes not create any diff files and looks like the snapshot filres are recreated with the previous file content

I would expect cypress run to always generate the diff files reglardless of failing or not the test on visual differences.

@grahamemde
Copy link

@jaredpalmer Is this behavior by design? I also have a use case for creating diff files when using cypress run and failOnSnapshotDiff=false. Would you be open to a change to make this more flexible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants