addUIInterruptionMonitor(withDescription:handler:) not working on iOS 10 or 9

后端 未结 3 1873
半阙折子戏
半阙折子戏 2020-12-14 09:16

The following tests works fine on iOS 11. It dismisses the alert asking permissions to use the locations services and then zooms in in the map. On iOS 10 or 9, it does none

3条回答
  •  独厮守ぢ
    2020-12-14 09:25

    let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") 
    
    let allowBtn = springboard.buttons["Allow"]
    if allowBtn.waitForExistence(timeout: 10) {
        allowBtn.tap()
    }
    

    Update .exists to .waitForExistence(timeout: 10), detail please check comments.

提交回复
热议问题