jaredpalmer / cypress-image-snapshot

Catch visual regressions in Cypress
MIT License
888 stars 160 forks source link

Translating snapshots taken on retina screen to classic ones #129

Closed Lyokolux closed 4 years ago

Lyokolux commented 4 years ago

Here is the current problem : some of the users use a retina screen when others don't. It causes every snapshots to fail in this cases.

Feature requested : translate the image from retina resolution to standard.

I tried to search a hook to intercept the image and then modify it; but the only one found is after:screenshot. Also after the diffing. This is my main problem for now.

Is there a way to intercept the image before ?

  snapshotResult = diffImageToSnapshot({
    snapshotsDir,
    diffDir,
    receivedImageBuffer,
    snapshotIdentifier,
    failureThreshold,
    failureThresholdType,
    updateSnapshot: updateSnapshots,
    ...options,
  });
Lyokolux commented 4 years ago

Also sorry I didn't see the opened issue #6485 on Cypress at first.