I’ve been tweaking the accessibility of a feature of our app after an Accessibility audit. The result, when using the app with VoiceOver, for example, is conform to the requests of the audit.
For example, in a view, I applied accessibility traits to container views (HStack
, for example). Those same container views have accessibility IDs set to them.
I want to create a test that validate, for example, that the view with Accessibility ID “feature_header” has traits [.isHeader, .isButton]
.
In the test, I can successfully query my element, but when I inspect its traits, it always returns 0. Is this even possible to do? If so, how? Does the lack of introspection in SwiftUI makes it impossible to test?