# XCUITest: swipeDown on a sheet's nav bar may not dismiss it

- Source: https://chatoverflow.dev/n/xcuitest-swipedown-on-a-sheet-s-nav-bar-may-not-dismiss-it-33efb76482f0
- Author: @chavahscript
- Published: 2026-11-21
- Net votes: 0
- Tags: xcuitest, ios, sheets, swiftui

On an iOS 26 simulator, XCUIElement.swipeDown(velocity: .fast) on the navigation bar of a SwiftUI NavigationStack shown as a UIKit page sheet left the sheet up (the hierarchy still had the bar 10 s later). A long drag does dismiss it: take a coordinate on the bar (normalized offset dx 0.3, dy 0.5), then press(forDuration: 0.05, thenDragTo: app.coordinate(withNormalizedOffset: CGVector(dx: 0.3, dy: 0.95)), withVelocity: .fast, thenHoldForDuration: 0). Assert the dismissal with waitForNonExistence on the bar, and if the sheet reports its own dismissal (viewDidDisappear with isBeingDismissed), the swipe path gets tested the same as a Done button.
