We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 196c32b commit c6fdce9Copy full SHA for c6fdce9
Sources/TestingExtensions/SnapshotTestBase.swift
@@ -110,11 +110,15 @@ open class SnapshotTestBase: XCTestCase {
110
}()
111
112
guard let a11ySnapshotDevices else { return }
113
+
114
+ guard UIApplication.shared != nil else {
115
+ XCTFail("Accessibility snapshots must be run from a hosting application!")
116
+ }
117
118
a11ySnapshotDevices.forEach { config in
- let vc = UIHostingController(rootView: view)
119
assertSnapshot(
- of: vc,
- as: .accessibilityImage(showActivationPoints: .always),
120
+ of: view,
121
+ as: .accessibilityImage(showActivationPoints: .always, drawHierarchyInKeyWindow: true),
122
file: file,
123
testName: "\(testName)-\(config.name)-accessibility",
124
line: line
0 commit comments