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.
Repository: jaredpalmer/cypress-image-snapshot. Description: Catch visual regressions in Cypress Stars: 893, Forks: 152. 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: 44, open issues: 79. Last activity: 1y ago. Community health: 42%. Top contributors: jackjocross, jaredpalmer, jhswart, dependabot[bot], MichaelDeBoey, lazarljubenovic, Raag007, ImgBotApp, James-E-Adams, jhoobergs and others.
JavaScript
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?
Updated peer dependency and tested with Cypress 7
I am running: When I run the Cypress test I get the folloring error: But I do see that a screenshot is created in a dist folder of the project. Also, when I use: I see that the file is created at the expected location. So I am getting a feeling that the screenshot is created successfully, however that cypress-image-snapshot is just not finding that image. Does someone know how I can debug this more, and validate if it can find an image?