Xcode7 | Xcode UI Tests | How to handle location service alert?
Xcode 9 let springboard = XCUIApplication(bundleIdentifier: “com.apple.springboard”) let allowBtn = springboard.buttons[“Allow”] if allowBtn.exists { allowBtn.tap() } Xcode 8.3.3 _ = addUIInterruptionMonitor(withDescription: “Location Dialog”) { (alert) -> Bool in alert.buttons[“Allow”].tap() return true } app.buttons[“Request Location”].tap() app.tap() // need to interact with the app for the handler to fire Note that it is a bit different as … Read more