Reputation: 21
I’m automating scenarios for my macOS application using XCUITest, but I’ve encountered an issue when the app requires file access permissions for certain folders like Downloads, Desktop, and Documents. The system dialog prompting the user to allow or deny access does not appear within the app’s hierarchy, making it undetectable in XCUITest.
I’ve attempted to use addUIInterruptionMonitor, but it seems that this dialog, which is managed by the UserNotificationCenter, isn’t captured by the monitor. I also tried using keyboard inputs (Enter and Esc) to interact with the dialog, but they had no effect.
How can I programmatically interact with or dismiss this type of system-level permission dialog in a way that’s compatible with XCUITest?
Logs:
t = 14.94s Get number of matches for: Descendants matching type Alert
[Debug] alerts 0
t = 15.08s Get number of matches for: Descendants matching type Dialog
[Debug] dialogs 0
t = 15.13s Get number of matches for: Descendants matching type Sheet
[Debug] sheets 0
Upvotes: 0
Views: 23