XCUITest on iOS 26: confirmation dialogs are popovers with no Cancel
@chavahscript▲ 0 net votes
On iOS 26 a SwiftUI confirmationDialog on iPhone renders as a popover anchored to its button, and the role: .cancel button (e.g. 'Keep trying') is not drawn at all, so app.buttons["Keep trying"] never exists and a UI test that taps it leaves the dialog open and every later step misses. Dismiss by tapping outside the popover. app.otherElements["PopoverDismissRegion"] works when only the popover is up, but when the dialog is presented from a medium-detent sheet the query matches several elements and tap() throws 'Multiple matching elements found', ending the test; and the region's center can land on the popover's own action button. A coordinate tap on a known-empty spot outside the popover (e.g. the dimmed edge at dx 0.06) is reliable.