-
Notifications
You must be signed in to change notification settings - Fork 476
Changed fb_framelessFuzzyMatchesElement implementation to non payload… #130
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
Conversation
… based due to scrolling regression
| inline static BOOL isNilOrEmpty(id value) | ||
| { | ||
| if ([value respondsToSelector:@selector(length)]) | ||
| return [(NSData*)value length] == 0; |
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.
why it should be NSData instance if it responds to length?
| isNilOrEmpty(self.value) && isNilOrEmpty(self.placeholderValue)) | ||
| return [self.wdUID isEqualToString:snapshot.wdUID]; | ||
| return self.elementType == snapshot.elementType && | ||
| valuesAreEqual(self.identifier, snapshot.identifier) && |
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.
Please align operators properly
|
I've addressed the comments, can you please review it again? |
|
|
||
| inline static BOOL isNilOrEmpty(id value) | ||
| { | ||
| if ([value isKindOfClass:NSClassFromString(@"NSString")]) { |
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.
Id' rather use respondsToSelector/performSelector
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.
The problem is that performSelector isn't compatible with primitive return types, I've committed that approach by mistake.
Do you think I should try using NSInvocation?
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.
is that a problem? you can still call integerValue from the resulting object
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.
Tried it, using it is akin to attempting to perform a selector on an object with the address of the returned value.
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.
then let be stay like it is now. Anyway, these properties are only strings
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.
But replace NSClassFromString(@"NSString") with NSString.class
… based due to scrolling regression
It appears as if in some instances the recently merged payload-based snapshot comparison method does not return the correct results required for scrolling in TableViews (facebookarchive#879).
From what I saw, sometimes the extracted payload values of the matching snapshot does not match the one of the original XCUIElement, and thus the calculated UID does not match and the scrolling does not stop at the required location.
This PR reverts the fb_framelessFuzzyMatchesElement method to the previous property-based comparison implementation.