Automatic Accessibility Audits on previews part 1 (#4322)

* setup target

* accessibility tests implementation

* removed ipad check

* pr improvements

* updated project
This commit is contained in:
Mauro
2025-07-15 14:40:16 +02:00
committed by GitHub
parent 74952659e8
commit c1b94a2d9f
18 changed files with 951 additions and 8 deletions
@@ -33,10 +33,18 @@ extension ProcessInfo {
false
#endif
}
static var isRunningAccessibilityTests: Bool {
#if DEBUG
processInfo.environment["ACCESSIBILITY_VIEW"] != nil
#else
false
#endif
}
/// Flag indicating whether the app is running the UI tests or unit tests.
static var isRunningTests: Bool {
isRunningUITests || isRunningUnitTests || isRunningIntegrationTests
isRunningUITests || isRunningUnitTests || isRunningIntegrationTests || isRunningAccessibilityTests
}
/// The identifier of the screen to be loaded when running UI tests.
@@ -48,6 +56,15 @@ extension ProcessInfo {
#endif
}
/// The identifier of the preview that will be accessibility tested
static var accessibilityViewID: String? {
#if DEBUG
processInfo.environment["ACCESSIBILITY_VIEW"]
#else
nil
#endif
}
static var shouldDisableTimelineAccessibility: Bool {
guard isRunningUITests else {
return false