-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite images comparison tests using images input #10
base: master
Are you sure you want to change the base?
Rewrite images comparison tests using images input #10
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -76,37 +76,29 @@ class CompareImagesTests: XCTestCase { | |||
} | |||
|
|||
func testStrictComparison() { | |||
let referenceImage = UIImage(named: "en_iPhone_X_reference_strict", in: .module, compatibleWith: nil)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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