So with the new xcode update apple has revamped the way we do UI testing. In instruments we used java script function \"isVisible\" to determine if our targeted element is visib
Expanding on @Kade's answer, in my case, had to account for tabbar in scrollToElement, else might get a tabbar button tapped if the view was under the tabbar:
func scrollToElement(element: XCUIElement) {
while !element.visible() {
swipeUp()
}
// Account for tabBar
let tabBar = XCUIApplication().tabBars.element(boundBy: 0)
if (tabBar.visible()) {
while element.frame.intersects(tabBar.frame) {
swipeUp()
}
}
}