diff --git a/README.md b/README.md index d541cbd1..7a75ecd1 100644 --- a/README.md +++ b/README.md @@ -334,7 +334,7 @@ shot { } ``` -If you configure ``tolerance = 1`` it means the tolerance threshold will be 100% and all your tests will pass even if they should fail...so be careful when configuring this param. +If you configure ``tolerance = 100`` it means the tolerance threshold will be 100% and all your tests will pass even if they should fail...so be careful when configuring this param. Take into account the ``instrumentationTestTask`` could be different if you use different flavors or build types. Remember also you should use Shot > 3.0.0 because this feature was introduced in this release! diff --git a/core/src/main/scala/com/karumi/shot/screenshots/ScreenshotsComparator.scala b/core/src/main/scala/com/karumi/shot/screenshots/ScreenshotsComparator.scala index d882edf3..d9624ca4 100644 --- a/core/src/main/scala/com/karumi/shot/screenshots/ScreenshotsComparator.scala +++ b/core/src/main/scala/com/karumi/shot/screenshots/ScreenshotsComparator.scala @@ -55,7 +55,7 @@ class ScreenshotsComparator { val percentageOfDifferentPixels = differentPixels.length.toDouble / oldScreenshotPixels.length.toDouble val percentageOutOf100 = percentageOfDifferentPixels * 100.0 - val imagesAreDifferent = percentageOutOf100 >= tolerance + val imagesAreDifferent = percentageOutOf100 > tolerance val imagesAreConsideredEquals = !imagesAreDifferent if (imagesAreConsideredEquals && tolerance != Config.defaultTolerance) { val screenshotName = screenshot.name