When you use iOSSnapshotTestCase (previously named FBSnapshotTestCase)
it can be difficult to understand which perPixelTolerance
you should define. This tiny util can help you to compare two images in the same manner as iOSSnapshitTestCase
does that. And then you can tune the perPixelTolerance
in your tests for sure.
Firstly, you should install Fastlane
. And then go on to Usage
topic.
You can find information about Fastlane
here.
$ bundle exec fastlane imgDiff one:your_img_path1 two:your_img_path2
// 🚦 Max pixel difference: 0.2705
Vyacheslav Khorkov, artfintch@ya.ru