SwiftiSwift
SwiftiSwift

Reputation: 8687

Set Accessibility Identifier on ActionSheet in SwiftUI

How can i set the accessibility identifier for an ActionSheet in SwiftUI.

I want to tap a button of it, because i need to identify it for my XCUITest.

I'm currently trying this for my :

app.sheets[""].buttons["Choose Photo"].tap()

Upvotes: 2

Views: 1210

Answers (1)

SwiftiSwift
SwiftiSwift

Reputation: 8687

Fixed it by using this:

app.sheets.firstMatch.buttons["Choose Photo"].tap()

Upvotes: 3

Related Questions