diff --git a/ENGAGEHFUITests/HelperFunctions/XCUIApplication+GoTo.swift b/ENGAGEHFUITests/HelperFunctions/XCUIApplication+GoTo.swift index d41f2d23..a80e92dd 100644 --- a/ENGAGEHFUITests/HelperFunctions/XCUIApplication+GoTo.swift +++ b/ENGAGEHFUITests/HelperFunctions/XCUIApplication+GoTo.swift @@ -10,10 +10,11 @@ import XCTest extension XCUIApplication { - /// Tries to navigate to a tab by clicking on a button in the current view with label `tabName` - func goTo(tab tabName: String) throws { + /// Tries to navigate to a tab by clicking on a button in the current view with label "id", and verifies the correct arrival by looking for a header with label "header" or "id" if no header given. + func goTo(tab tabName: String, header: String? = nil) throws { XCTAssert(buttons[tabName].waitForExistence(timeout: 1.0), "No button found for tab \(tabName)") buttons[tabName].tap() swipeDown() + XCTAssert(staticTexts[header ?? tabName].waitForExistence(timeout: 1.0)) } }