Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

show compared screenshots in Jenkins #211

Open
mgehlen opened this issue Jan 10, 2017 · 3 comments
Open

show compared screenshots in Jenkins #211

mgehlen opened this issue Jan 10, 2017 · 3 comments

Comments

@mgehlen
Copy link

mgehlen commented Jan 10, 2017

Hello,

we are using snapshot-test-case wuth great success in our iOS testing - thank you very much for a splendid tool.

We use Jenkins in a Master-Slave setup as our build server and have several Macs as slaves in this setup. As it shockingly happens from time to time some tests actually fail.

In this case it would be helpful to quickly identify what happened if we had the compared screenshots in our Jenkins Report.

The current report includes image information about the compared pictures thanks to #146:

Error Message

failed - Snapshot comparison failed: Optional(Error Domain=FBSnapshotTestControllerErrorDomain Code=4 "Images different" UserInfo={NSLocalizedFailureReason=image pixels differed by more than 0.00% from the reference image, FBDiffedImageKey=<UIImage: 0x7f915f8714a0>, {320, 568}, FBReferenceImageKey=<UIImage: 0x7f915fc00fb0>, {320, 568}, FBCapturedImageKey=<UIImage: 0x7f915fd2f540>, {320, 568}, NSLocalizedDescription=Images different})
Stacktrace

MyApp/MyAppTests/BaseSnapshotTestCase.swift:131

Is there any way that I can fetch the images with this information and actually show them in the failed test case report on Jenkins? Have any of you done this or build a helper, which did this?

Help is very much appreciated.

Thank you very much.

@nemoeslovo
Copy link

There is a fork of the Second Curtain library that can solve your problem. Original Second Curtain was designed in a way when screenshots were uploaded to the AWS, but this fork just collects pictures in folder with html generated, so you can archive this report on your CI.

@mgehlen
Copy link
Author

mgehlen commented Jan 16, 2017

thank you, I will have a look at it.

@pres
Copy link
Contributor

pres commented Jun 28, 2017

Just set the IMAGE_DIFF_DIR to a folder the Jenkins has access to and archive the folder in the Jenkins job.

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

No branches or pull requests

3 participants