XCUItest addUIInterruptionMonitor is not capturing alerts on iOS14 simulator and xcode 12

Viewed 750
override func setUp() {
    addUIInterruptionMonitor(withDescription: "App store alert") { (alert) -> Bool in
        alert.buttons.element(boundBy: 0).tap()
        return true
         }
}


func test() {
    functionThatCausesAlertToAppear()
    XCUIApplication().tap()
}

When I attempt to print a statement within the addUIInterruptionMonitor it doesn't print leading me to believe that the block isn't triggered.

1 Answers
Related