AddressBookAlert

public struct AddressBookAlert: SystemAlert, SystemAlertAllow, SystemAlertDeny

Represents AddressBookAlert 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 = AddressBookAlert(element: alert) else {
        XCTFail("Cannot create AddressBookAlert object")
        return false
    }

    alert.denyElement.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.
  • Represents all possible messages in AddressBookAlert service alert.

    Declaration

    Swift

    public static let messages = readMessages()
  • System service alert element.

    Declaration

    Swift

    public var alert: XCUIElement
  • Initialize AddressBookAlert with alert element.

    Declaration

    Swift

    public init?(element: XCUIElement)

    Parameters

    element

    An alert element.