Testing a UIAnimation with KIF

931 Views Asked by At

Short: Is there a way to test if an animation is done the way it should with KIF,

Long: In iOS, if you animate a UIView is there a way to "test" the animation in KIF, or at least wait for the end of the animation, or alternatively wait for a UIView to be in a certain position?

1

There are 1 best solutions below

3
On

Use stepToWaitForViewWithAccessibilityLabel, such like waiting the network loading finish, bring back response, and show it to the paging scroll view, then I can start to swipe it.

[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"pagingScrollView"]];
[scenario addStep:[KIFTestStep stepToSwipeViewWithAccessibilityLabel:@"pagingScrollView" inDirection:KIFSwipeDirectionLeft]];

So after your animation done, present a AccessibilityLabel like animatedDonePresentView.