facebookarchive / ios-snapshot-test-case

Snapshot view unit tests for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Where is failed image located?

sarunw opened this issue · comments

When a test failed, does this lib save failed image somewhere? I want to know which part of the image is not matched my reference.

No, there's no feature of saving failed views.
Currently you can just copy your reference image, record failed one and compare both manually.

If you look in the log output you will see a line like

ksdiff "/Users/name/Library/Developer/CoreSimulator/Devices/3BB325ED-42E2-44FA-A5BC-7C5F94A458D1/data/Containers/Data/Application/86124A0C-4345-4FB2-95C1-AC6F8D30A0FC/tmp/Unit_Tests.ViewControllerTests/reference_test@2x.png" "/Users/name/Library/Developer/CoreSimulator/Devices/3BB325ED-42E2-44FA-A5BC-7C5F94A458D1/data/Containers/Data/Application/86124A0C-4345-4FB2-95C1-AC6F8D30A0FC/tmp/Unit_Tests.ViewControllerTests/failed_test@2x.png"

If you have Kaleidoscope installed you can paste that into Terminal to open the images side-by-side. If not open that folder and you'll find the original image, the failed image, and a diff of the two.

There is IMAGE_DIFF_DIR, see #177.
I created a PR to add it to the README.

@pres Nice! I'm using Snapshots for a long time and I didn't know about this feature.

@sarunw @nscoding Can you close this issue?