Skip to content

Commit

Permalink
Merge pull request #782 from justinseanmartin/jmartin/dont-assume-fir…
Browse files Browse the repository at this point in the history
…st-responder-change-is-immediate

Setting first responder on an accessibility element may be delayed
  • Loading branch information
phatmann committed Jan 22, 2016
2 parents d8ad612 + 60183c0 commit 00532ae
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit 00532ae

Please sign in to comment.