cypress-match-screenshot icon indicating copy to clipboard operation
cypress-match-screenshot copied to clipboard

how to set threshold for blinkdiff

Open chit786 opened this issue 6 years ago • 4 comments

currently tests passes for :

image

so wanted to set the threshold from some configuration , is it possible currently ?

const threshold = argv.threshold ? parseFloat(argv.threshold) : 0.005;

tried npm run cy:run --threshold 0

Thanks in advance!

chit786 avatar Mar 17 '18 10:03 chit786

I added the threshold as option to the command, so you can do sth like this now:

cy.matchScreenshot('fileName', { threshold: 0 })

Let me know if that works for you and feel free to reopen the issue if it doesn't 😊

julianburr avatar Mar 18 '18 18:03 julianburr

Hi .. sorry was a little away from work.

I tried your fix but its not working, threshold is not getting accepted.

Also

image

filename is appended with default threshold value.

chit786 avatar Mar 25 '18 13:03 chit786

https://github.com/julianburr/cypress-match-screenshot/blob/1fc0ae88449952f43b848bae897977fc125efbac/src/index.js#L88 need to give space while passing threshold.

chit786 avatar Mar 25 '18 14:03 chit786

@chit786 you're absolutely right, my bad ... try again with v0.0.5 😊

julianburr avatar Mar 25 '18 23:03 julianburr