System alerts
-
Protocol defining system service request alert. Provides essential definitions for system alerts giving the ability to handle them in the UI tests.
System alerts supposed to be used in the handler of the
XCTestCase.addUIInterruptionMonitor(withDescription:handler:)method. Additional protocols,SystemAlertAllow,SystemAlertDeny,SystemAlertOkandSystemAlertCancelprovides definition and default implementation for handling buttons on the alert view.Note
AutoMateprovides an implementation for several different system alerts. Check the documentation for full list of supported system alerts.Example:
let token = addUIInterruptionMonitor(withDescription: "Contacts") { (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)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not.
-
Represents
HealthAuthorizationDontAllowAlertservice 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 returntrueif they handled the UI,falseif they did not.See moreWarning
The alert seems to be visible in view hierarchy and work without aninterruption monitor dance
. Check working example here: AutoMateExamplePermissionsTests -testHealthKitAlert
-
Represents
LocationAlwaysAlertservice 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 = LocationAlwaysAlert(element: alert) else { XCTFail("Cannot create LocationAlwaysAlert object") return false } alert.allowElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
LocationUpgradeWhenInUseAlwaysAlertservice 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 = LocationUpgradeWhenInUseAlwaysAlert(element: alert) else { XCTFail("Cannot create LocationUpgradeWhenInUseAlwaysAlert object") return false } alert.allowElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
LocationWhenInUseAlertservice 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 = LocationWhenInUseAlert(element: alert) else { XCTFail("Cannot create LocationWhenInUseAlert object") return false } alert.allowElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not.
-
Represents
AddressBookAlertservice 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)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
BluetoothPeripheralAlertservice 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 = BluetoothPeripheralAlert(element: alert) else { XCTFail("Cannot create BluetoothPeripheralAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
CalendarAlertservice 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 = CalendarAlert(element: alert) else { XCTFail("Cannot create CalendarAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
CallsAlertservice 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 = CallsAlert(element: alert) else { XCTFail("Cannot create CallsAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
CameraAlertservice 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 = CameraAlert(element: alert) else { XCTFail("Cannot create CameraAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
MediaLibraryAlertservice 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 = MediaLibraryAlert(element: alert) else { XCTFail("Cannot create MediaLibraryAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
MicrophoneAlertservice 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 = MicrophoneAlert(element: alert) else { XCTFail("Cannot create MicrophoneAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
MotionAlertservice 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 = MotionAlert(element: alert) else { XCTFail("Cannot create MotionAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
PhotosAlertservice 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 = PhotosAlert(element: alert) else { XCTFail("Cannot create PhotosAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
RemindersAlertservice 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 = RemindersAlert(element: alert) else { XCTFail("Cannot create RemindersAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
SiriAlertservice 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 = SiriAlert(element: alert) else { XCTFail("Cannot create SiriAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
SpeechRecognitionAlertservice 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 = SpeechRecognitionAlert(element: alert) else { XCTFail("Cannot create SpeechRecognitionAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not. -
Represents
WillowAlertservice 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 = WillowAlert(element: alert) else { XCTFail("Cannot create WillowAlert object") return false } alert.denyElement.tap() return true } mainPage.goToPermissionsPageMenu() // Interruption won't happen without some kind of action. app.tap() removeUIInterruptionMonitor(token)See moreNote
Handlers should returntrueif they handled the UI,falseif they did not.
System alerts Reference