jaredpalmer / cypress-image-snapshot

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

Is failureThreshold: 0.03 equals 3% or 0.03% #121

Closed nani554 closed 4 years ago

nani554 commented 4 years ago

Hello iam bit confused about failureThreshold value

addMatchImageSnapshotCommand({
  failureThreshold: 0.03, // threshold for entire image
  failureThresholdType: 'percent', // percent of image or number of pixels
  customDiffConfig: { threshold: 0.1 }, // threshold for each pixel
  capture: 'viewport', // capture viewport in screenshot
});

Above code is written in official documentation and i found that if failureThreshold: 0.03 then it equals to 3% and not 0.03% Is it 3% or 0.03% ?

versions: cypress: ^3.8.3, cypress-image-snapshot: ^3.1.1

louis-vinchon commented 4 years ago

In your case 0.03 is 3%, try setting it to 1 and images should always match even though they are completely different.