Catch visual regressions in Cypress
by jaredpalmerJavaScript
Last 12 weeks · 0 commits
2 of 6 standards met
customSnapshotIdentifier option is defined in types but not implemented in plugin Summary The TypeScript definitions for include a option that appears to allow customization of snapshot naming/path generation, but this option is completely ignored by the actual plugin implementation. This creates a misleading API where developers can configure an option that has no effect. Expected Behavior Based on the TypeScript definitions in , the option should allow customization of snapshot paths: Actual Behavior The option is completely ignored. In , the is hardcoded as: There is no code anywhere in the plugin that checks for or uses a option. Steps to Reproduce 1. Configure in cypress.config.ts: 2. Run a test with 3. Observe that: The console.log never fires Snapshot paths are generated using the default logic, ignoring the custom function Root Cause The TypeScript definitions appear to be copied from or another library that does implement this feature, but never implemented it. The only options that are actually used are: Impact This creates a particularly problematic inconsistency between Cypress CLI and GUI modes: CLI mode creates snapshots in nested directories: GUI mode creates flat snapshots: Developers cannot resolve this path inconsistency because the API that should allow path customization doesn't actually work. Suggested Solution Either: 1. Implement the feature - Add support for in the plugin to match the TypeScript definitions 2. Fix the types - Remove from the TypeScript definitions and document the actual supported options 3. Document the limitation - Clearly state in the README that path customization is not supported and explain the CLI/GUI inconsistency Environment cypress-image-snapshot: 4.0.1 @types/cypress-image-snapshot: (latest) Cypress: 13.17.0 Additional Context This issue makes visual regression testing unreliable in CI/CD pipelines where both CLI and GUI modes might be used, as the snapshot paths don't match between execution modes.
Hey, I build odiff exactly to be used for cypress visual regression, according to an ability to run screenshot diffs from paths directly it is faster than pixel match by 6-7 times usually. I'd like to make a PR that integrates odiff as an option to be used directly instead of . This will basically allow removing the huge amount of code and will speed up the comparison. What do you think? Any kind of blockers or reasons why the PR might be rejected, should I build the alternative library instead?
I have upgraded a few packages to support cypress 10 and also 11 and 12 versions, with nodejs 16.x and 18.x. Babel also should be updated, maybe deep refactoring of js files to ts and removing some packages in the future would be good decisions, otherwise working with this package going to be a headache. I have updated jest-image-snapshot to 5.0.0. version and example react project too, with jest-image-snapshot i had multiple issues which need a lot of time I think to fix so I don't know if there is any sense to do such big job if cypress-image-snapshot packages going to die instead of updating.
Thanks for the plugin, it's pretty nice! I got the following error on CI, but can't reproduce locally. So I'm looking for a way to access the CI screenshot in order to understand the problem. 1) theme_04: bot frame theme_04: should reset form after sending a message via submit button: Error: Image was 2.091666666666667% different from saved snapshot with 4769 different pixels. See diff for details: /__w/webchat-v2/webchat-v2/cypress/snapshots/theme_04/bot-frame.spec.js/__diff_output__/conversation-is-open.diff.png at Context.eval (http://localhost:3000/__cypress/tests?p=cypress/support/index.js:17439:17) Question Do you know how can I access the screenshot taken on Github Actions CI ?
Repository: jaredpalmer/cypress-image-snapshot. Description: Catch visual regressions in Cypress Stars: 888, Forks: 146. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Topics: cypress, cypress-plugin, image-diff, image-diffs, jest-image-snapshot, visual-regression, visual-regression-testing, visual-regression-tests. Latest release: v4.0.1 (5y ago). Open PRs: 43, open issues: 79. Last activity: 2y ago. Community health: 42%. Top contributors: jackjocross, jaredpalmer, jhswart, dependabot[bot], MichaelDeBoey, lazarljubenovic, Raag007, ImgBotApp, James-E-Adams, jhoobergs and others.