Skip to content
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

Setting first responder on an accessibility element may be delayed #782

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Classes/KIFUITestActor.m
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,17 @@ - (void)tapAccessibilityElement:(UIAccessibilityElement *)element inView:(UIView
} else {
[view tapAtPoint:tappablePointInElement];
}

KIFTestCondition(![view canBecomeFirstResponder] || [view isDescendantOfFirstResponder], error, @"Failed to make the view into the first responder: %@", view);

return KIFTestStepResultSuccess;
}];

// Controls might not synchronously become first-responders. Sometimes custom controls
// may need to spin the runloop before reporting as the first responder.
[self runBlock:^KIFTestStepResult(NSError *__autoreleasing *error) {
KIFTestWaitCondition(![view canBecomeFirstResponder] || [view isDescendantOfFirstResponder], error, @"Failed to make the view into the first responder: %@", view);
return KIFTestStepResultSuccess;
} timeout:0.5];

[self waitForAnimationsToFinish];
}

Expand Down