HealthAuthorizationDontAllowAlert

Represents HealthAuthorizationDontAllowAlert service alert.

System alert supposed to be used in the handler of the XCTestCase.addUIInterruptionMonitor(withDescription:handler:) method.

Example:

let token = addUIInterruptionMonitor(withDescription: "Alert") { (alert) -> Bool in
    guard let alert = HealthAuthorizationDontAllowAlert(element: alert) else {
        XCTFail("Cannot create HealthAuthorizationDontAllowAlert object")
        return false
    }

    alert.allowElement.tap()
    return true
}

mainPage.goToPermissionsPageMenu()
// Interruption won't happen without some kind of action.
app.tap()
removeUIInterruptionMonitor(token)

Note

Handlers should return true if they handled the UI, false if they did not.

Warning

The alert seems to be visible in view hierarchy and work without an interruption monitor dance. Check working example here: AutoMateExample PermissionsTests -testHealthKitAlert
  • Represents all possible messages in HealthAuthorizationDontAllowAlert service alert.

  • System service alert element.

  • Initialize HealthAuthorizationDontAllowAlert with alert element.