Has anybody successfully used addUIInterruptionMonitor
to clear the alert produced by start()
ing an SFAuthenticationSession
while running an XCUITest?
I can't get it to work on Xcode 9.1/iOS 11.1.1 (simulator or device). The standard advice (setting up the handler and subsequently interacting with the device before the alert appears) does not help.
The test recorder says app.alerts.firstMatch.buttons["Continue"]).tap()
should do the trick, but that doesn't work either. This technique from another SO answer works sometimes, but not consistently on CI.
So I'd like to know if the "official" solution has ever worked for anyone.
I couldn't get this to work:
let continueButton = app.alerts.buttons["Continue"]
XCTAssert(waitAndTap(continueButton), "could not tap on alert \"Continue\" button"
But this hack seems to do the trick:
let statusBarsQuery = app.statusBars
statusBarsQuery.element.tap()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With