I\'m writing UITests in xCode 7.1 and have a problem in testing alerts (Allow notifications in my case). While creating a test xCode writes this code:
app.alerts
Here is an example how to do it with an app requesting local notification permission access:
addUIInterruptionMonitorWithDescription("Local Dialog") { (alert) -> Bool in if alert.collectionViews.buttons["OK"].exists { alert.collectionViews.buttons["OK"].tap() return true } return false }