Voice over description panel not recorded when using ScrollView - iOS 18.x
Similar to #33, with iOS 18.x the content of ScrollViews isn't detected correctly. Or am I missing something?
@Test
func scrollView_a11y() {
let view = ScrollView {
ForEach(0..<10, id: \.self) { _ in
Text("Hello World")
}
}
assertSnapshot(
of: view,
as: .accessibilityImage(
size: CGSize(width: 375, height: 500),
shouldRunInHostApplication: false
)
)
}
Hey @astwetteronline, does this work correctly if you run the test with a host application?
@NickEntin Interesting. With the example project, it works totally fine (also without running it in a host application). We are using it in a Swift Package setup. Could it be related to that? I think it is not possible to run package tests in a host application, right?
I am running into this same issue, where the accessibility panel does not show an item if said item is inside a ScrollView. With my project, I am also using a Swift Package setup and am running without host a application with the following test:
@Test
func accessibilitySnapshot() {
let view = VStack {
Text("hello, world!")
ScrollView { Text("hello, again") }
}
assertSnapshot(of: view, as: .accessibilityImage(
size: UIScreen.main.bounds.size,
shouldRunInHostApplication: false)
)
}
and I get the following result:
I have tried running that exact same test with a host application, and there is no issue (meaning "hello, again" is recognized in the panel). Unfortunately, I would only like to add accessibility tests outside of a host application. Is there any update for this issue?