I have a test that selects a particular feed in my app. It works fine on iPhone 6s but fails on iPhone 5s with element not found error. Upon further investigation it seems like the the feed is missing from the view hierarchy. I came up with a workaround which is to something like:
if (running on iPhone 5s) {
// Scroll down by 50 units.
// Then locate the feed and check that it's visible.
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"feed10")]
assertWithMatcher:grey_sufficientlyVisible()];
}
Though this seems fine, I'd like to know if there's a better way to conditionally scroll if element isn't found on the screen.