Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Question about threshold #214

Unanswered
SaraCooperQA asked this question in Q&A
Discussion options

How do you change the threshold value so any difference will cause a fail?

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Hey @SaraCooperQA,

As of version 3.2.11 it is possible to set maxDiffThreshold: 0 in the plugin configuration.

Does this answer your question?

You must be logged in to vote
1 reply
Comment options

Hey @FRSgit. I am running 3.3.10. This is my test:

it('visual test', () => {
 cy.visit('https://example.cypress.io/todo')
 cy.wait(2000)
 cy.matchImage({
 diffConfig: {
 maxDiffThreshold: 0,
 },
 })
})

If I have a tiny diff it says: Image diff factor (0%) is within boundaries of maximum threshold option 0.01 and the test passes. If I have a big diff I get: Image diff factor (0.017%) is bigger than maximum threshold option 0.01. and the test correctly fails. I tried changing the maxDiffThreshold to different values, but it never caught the tiny diff. So I am having the same issue as @SaraCooperQA I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /