Rewrite images comparison tests using images input #10
Rewrite images comparison tests using images input #10IvanNextToJunior wants to merge 26 commits intodevexperts:masterfrom
Conversation
|
@rzakhar please check first test that uses images input (cd7d960), it works, but fails on pixels comparison inside Meanwhile Difference values pass test with given accuracy Should it mean that we also should apply similar accuracy while comparing pixels arrays too? |
|
1e-6 accuracy is equivalent to 3 bad pixels on the 1179 x 2556 screenshot. It looks like quite a reasonable threshold. By ISO 13406-2 standard, it is close to Pixel Fault Class II. I would keep the accuracy as is |
|
@rzakhar I mean pixels arrays are being compared always strict so test will always fail with any non-zero difference |
|
|
|
You can use The first time to compare reference images and assert the difference value (delta +- 1e-6). Use the passed method for it. |
|
Sorry I don't get you idea. In my understanding if I reuse images produced by SUITCase itself the strict test should pass out of the box. I don't get why SUITCase produces inside |
|
What is the difference between difference images? Would you please provide examples? |
|
While testing difference images I noticed a strange thing - Difference image from assets turns green when converted to This gives me |
Running in
|
rzakhar
left a comment
There was a problem hiding this comment.
Hey! Thanks for the PR. Remember to include a proper explanation to the PR. Things that can help:
- Clear title that shortly explains the changes
- Proper PR description with a detailed explanation
- Test data or setup required for a reviewer to verify changes.
- An .xcresult file of the successfully passed tests
| } | ||
|
|
||
| func testStrictComparison() { | ||
| let referenceImage = UIImage(named: "en_iPhone_X_reference_strict", in: .module, compatibleWith: nil)! |
There was a problem hiding this comment.
Looks like we reuse these images in all tests. Can you please
- Reduce code repetition by moving these variables from the test cases to the test classes?
- Double-check that assets only include the images we need.
@rzakhar |
|
Rewrite images comparison tests using real images input from assets |
add tolerance images;

This time from another branch