Skip to content

The tests passes even when it is over threshold. #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vazsonyidl opened this issue Jun 4, 2020 · 5 comments · Fixed by #74
Closed

The tests passes even when it is over threshold. #71

vazsonyidl opened this issue Jun 4, 2020 · 5 comments · Fixed by #74

Comments

@vazsonyidl
Copy link

Hi there,

if (options.skipFailure === false) {
      assert(misMatch <= options.tolerance, "Screenshot does not match with the baseline " + baseImage + " when MissMatch Percentage is " + misMatch);
    }

As the previous code snippet shows, since the options.skipFailure is undefined, the comparison would always return false. Because of this, the assert would never run, and the pipeline passes even when the tolerance is clearly over the threshold.

Please define false as default, because previously the assert run automatically, did not depend on the value of skipFailure.

@puneet0191
Copy link
Member

@vazsonyidl could u please send fix, thanks for reporting, I will merge and make a new release.

@eunicekokor
Copy link

@vazsonyidl @puneet0191 I am also running into this, there is also no mismatch percentage shown even though there is a new image generated in diff

@vazsonyidl
Copy link
Author

@eunicekokor i will fix it tomorrow

@puneet0191
Copy link
Member

puneet0191 commented Jun 18, 2020

Thanks a lot for helping 😊

@vazsonyidl
Copy link
Author

I do not have permission to contribute for this project. I am unable to push for a new branch created by me, so the solution should be.

if (options.skipFailure === false) { assert(misMatch <= options.tolerance, "Screenshot does not match with the baseline " + baseImage + " when MissMatch Percentage is " + misMatch); }

should be replaced with:

if (!options.skipFailure) { assert(misMatch <= options.tolerance, "Screenshot does not match with the baseline " + baseImage + " when MissMatch Percentage is " + misMatch); }

This fixes this issue. This will assert de misMatch and tolerance by default, as it should behave. So the test will not passes if the mismatch is over tolerance. Please fix this. 💯

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants