Accessing FaceID "Try Again" alert from UI tests

I'm currently writing UI tests around FaceID, and I've hit a problem trying to interact with the "Face Not Recognised, Try Again" alert after triggering a non-matching face. Specifically, neither the alert nor any of its buttons appear accessible to the UI tests. It doesn't trigger `addUIInterruptionMonitor()` when it appears. Adding a breakpoint at this point and examining the `XCUIApplication` instance doesn't show the alert anywhere in its heirarchy. I'm guessing that the alert (and the rest of the FaceID UI) is rendered out-of-process.


(I also have no luck going via Springboard.)


Has anyone managed to get UI tests to interact with this alert? Is there anything else I should try to get this working?

Replies

I had the same problem. I found you can just call "unsuccessfulAuthentication()" twice (or whatever that's called in your case) to at least handle the "Cancel" case.