patrol icon indicating copy to clipboard operation
patrol copied to clipboard

Make a use of UIInterruptionMonitor for disabling Wi-Fi on iOS

Open fylyppo opened this issue 1 year ago • 0 comments

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.

fylyppo avatar Jun 06 '24 20:06 fylyppo