-
Notifications
You must be signed in to change notification settings - Fork 913
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
Fix ios 16 #1276
Fix ios 16 #1276
Conversation
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.
Thank you so much for your contribution! 2 minor improvement requests and we should remove the commits that are also included in #1275. This is great!
Does this get the full KIF integration test suite passing on iOS 16 devices? If so, it would be great to get CI validating that. If not, maybe we should start working towards that and explicitly bailing out for the specific tests that we know are broken on iOS 16.
@@ -13,4 +13,6 @@ | |||
+ (instancetype)KIFErrorWithUnderlyingError:(NSError *)underlyingError format:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3); | |||
+ (instancetype)KIFErrorWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2); | |||
|
|||
+ (instancetype)KIFErrorFromException:(NSException *)exception; |
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.
I think this got pulled over from the other PR. Worth reverting here, as it seems unused in this context.
@@ -374,12 +382,25 @@ - (NSArray *)subviewsWithClassNamePrefix:(NSString *)prefix; | |||
if ([NSStringFromClass([view class]) hasPrefix:prefix]) { | |||
[result addObject:view]; | |||
} | |||
|
|||
if([NSStringFromClass([view class]) isEqualToString:@"_UIRemoteKeyboardPlaceholderView"]) { |
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.
Rather than duplicating this logic, it'd be cleaner to add a subviewsWithPlaceholderFallbackView
method that can be used in place of self.subviews
in the 4 places we're iterating over self.subviews
in this file.
|
||
UIWindowSceneGeometryPreferencesIOS* preferences = [[UIWindowSceneGeometryPreferencesIOS alloc]initWithInterfaceOrientations:orientationMask]; | ||
[windowScene requestGeometryUpdateWithPreferences:preferences errorHandler:^(NSError * _Nonnull error) { | ||
NSLog(@"error: %@", error); |
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.
Does this happen in a expected case? If not, makes sense to emit an error and fail the test.
@@ -137,33 +137,44 @@ extern NSString *const inputFieldTestString; | |||
@abstract Tap a view matching the tester's search predicate. | |||
@discussion The tester will evaluate the accessibility hierarchy against it's search predicate and perform a tap on the first match. | |||
*/ | |||
- (void)tap; | |||
- (void)tap CF_SWIFT_UNAVAILABLE_FROM_ASYNC("use async version"); |
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.
This should be reverted and decoupled from then changes in this PR I believe.
Thanks for the feedback. I will work on it and push the changes probably in the weekend. This fix the full suite of tests. I will remove the changes for the async stuff that I forgot (I starting work in the same branch and forgot to clean up), add the CI validation, and do the other changes. |
That's great to hear! It is probably worth bumping the CI config to validate that we don't regress it. That's definitely not a blocker for landing these changes though. |
098141f
to
b912934
Compare
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.
Tour contributions are very much appreciated! If we can get CI green, then we should be good to go.
.github/workflows/build.yml
Outdated
|
||
steps: | ||
- { xcode_version: '14.1', simulator: 'name=iPad Pro (12.9-inch) (5th generation),OS=16.1' } | ||
steps: &build_steps |
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.
Bummer... I liked the cleanup with the anchor, but GitHub doesn't like it:
The workflow is not valid. .github/workflows/build.yml: Anchors are not currently supported. Remove the anchor 'build_steps'
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.
My bad. I will fix it and push it right now!
@BrunoMazzo thanks 🎉 for finding this! So this allows you to use pickers and keyboads in iOS 16?? I was under the impression this was out of process from my debugging in this so was expecting a larger reverse engineering effort to be able to call what XCUITest calls. But if that's not that case that's amazing. Thank you SOOO much for digging into this! |
If you need some help getting it to run on iOS 16 feel free to use anything from here: #1268 I added this a while ago but since the tests weren't passing it didn't make sense to merge |
I'm rerunning the failed jobs to see if the results are consistent or not. I think at this point, supporting only Xcode 13.4.1 (Monterey) & 14.2 (Ventura) seems reasonable to me. Maybe we could do one iPad + iPhone device on each platform? Not changing the device type will help eliminate some variable that might lead other test failures related to screen dimensions and whatnot. WDYT? Just trying to limit how many things we need to chase down here to get this landed. |
It looks like we might need some availability checking for the behavior to be backwards compatible with the iOS 15 (Xcode 13) SDK:
|
I added a check to compile on other versions of Xcode and changed the CI to run on iPhone SE and iPad Pro, Xcode 13 and 14. |
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.
Once CI is green, we should be good to go with this.
.github/workflows/build.yml
Outdated
|
||
|
||
- { xcode_version: '14.1', simulator: 'name=iPad Pro (12.9-inch) (5th generation),OS=16.1' } | ||
- { xcode_version: '14.1', simulator: 'name=iPhone SE (3nd generation),OS=16.1' } |
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.
Meant for this to be 2nd instead of the 3nd?
Fix for iOS 16.
_fallbackView
from_UIRemoteKeyboardPlaceholderView
, but it is not part of the UI hierarchy (I don't know why). So in the parts that checked for elements, I added another validation for the_UIRemoteKeyboardPlaceholderView
[[UIDevice currentDevice] setValue:@(orientation) forKey:@"orientation"]
doesn't work anymore. We need to userequestGeometryUpdateWithPreferences
from UIWindowScene.I'm not 100% familiar with the code, so I may be missing some context, so please let me know if there is anything I should fix.