Permalink
Browse files

Better handle an edge case transition

There is a rare race condition where we can try to tap while a view is in transition due to an animation. In this case we can't get a tappable point and fail. This fix makes it so that we simply wait until the view is in a stable state instead.
  • Loading branch information...
1 parent 999b583 commit 1aaea681d7a8caa67264640a39516943d7d7e847 @efirestone efirestone committed Aug 16, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 Classes/KIFTestStep.m
View
@@ -233,7 +233,7 @@ + (id)stepToTapViewWithAccessibilityLabel:(NSString *)label value:(NSString *)va
CGPoint tappablePointInElement = [view tappablePointInRect:elementFrame];
// This is mostly redundant of the test in _accessibilityElementWithLabel:
- KIFTestCondition(!isnan(tappablePointInElement.x), error, @"The element with accessibility label %@ is not tappable", label);
+ KIFTestWaitCondition(!isnan(tappablePointInElement.x), error, @"The element with accessibility label %@ is not tappable", label);
[view tapAtPoint:tappablePointInElement];
// Verify that we successfully selected the view

0 comments on commit 1aaea68

Please sign in to comment.