patrol
patrol copied to clipboard
Make a use of UIInterruptionMonitor for disabling Wi-Fi on iOS
Currently (after merging https://github.com/leancodepl/patrol/pull/2123) patrol tries to acceptSystemAlertIfVisible() until timeout which increases running time when system alert won't appear.
It's better to handle such cases using UIInterruptionMonitor.
Use case
Handling case from https://github.com/leancodepl/patrol/issues/2106 and maybe other cases described in article.
Proposal
Docs: https://developer.apple.com/documentation/xctest/xctestcase/handling_ui_interruptions
Before disabling Wi-Fi use addUIInterruptionMonitor() to close potential dialog to prevent test failures.
Check out also reproducible example in SwiftUI.