Search code examples
kif

Kif test doesn't find UITableView sometimes


I am running some iOS Kif tests that fail about 50% of the time. I get the following message

The step timed out after 10.00 seconds: Could not find view matching: accessibilityIdentifier == "Search Results Table"

[tester waitForCellAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0] inTableViewWithAccessibilityIdentifier:@"Search Results Table"];

Does anybody have any idea as to why it only happens sometimes?


Solution

  • The solution we found was to switch off the animation. The animation was effecting the tests even when we used 'waitForTimeInterval'. I think it would be better if we didn't have to switch off the animation but at least we can continue testing now.

    [UIView setAnimationsEnabled:NO];