Don't assert specific devices for accessibility tests and use iOS 18 again. (#4741)
* Don't assert specific devices for accessibility tests.
It's not as critical as UI/Preview tests as nothing is snapshotted.
* Extend the timeout for accessibility tests.
They're slow 😅
* Drop back to iOS 18.5 for accessibility tests (for now).
This commit is contained in:
2
.github/workflows/accessibility_tests.yml
vendored
2
.github/workflows/accessibility_tests.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
tests:
|
||||
name: Tests
|
||||
runs-on: macos-15
|
||||
timeout-minutes: 120
|
||||
timeout-minutes: 150
|
||||
|
||||
concurrency:
|
||||
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
|
||||
|
||||
@@ -24,19 +24,9 @@ enum Application {
|
||||
}
|
||||
|
||||
private static func checkEnvironments() {
|
||||
let requirediPhoneSimulator = "iPhone17,3" // iPhone 16
|
||||
let requiredOSVersion = 18
|
||||
|
||||
let osVersion = ProcessInfo().operatingSystemVersion
|
||||
guard osVersion.majorVersion == requiredOSVersion else {
|
||||
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
||||
}
|
||||
|
||||
guard let deviceModel = ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] else {
|
||||
fatalError("Unknown simulator.")
|
||||
}
|
||||
guard deviceModel == requirediPhoneSimulator else {
|
||||
fatalError("Running on \(deviceModel) but we only support \(requirediPhoneSimulator)")
|
||||
guard UIDevice.current.userInterfaceIdiom == .phone else {
|
||||
XCTFail("Accessibility tests should be run on a phone.")
|
||||
fatalError("Accessibility tests should be run on a phone.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +108,7 @@ struct PreviewsWrapperView: View {
|
||||
EmptyView()
|
||||
} else {
|
||||
wrapper.currentPreview.content
|
||||
// This ID raises UIKit assertions on iOS 26 but is needed otherwise toolbars go missing and some timeline items won't resize.
|
||||
.id("\(wrapper.previewName)-\(dynamicTypeSize)")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ lane :accessibility_tests do |options|
|
||||
|
||||
run_tests(
|
||||
scheme: "AccessibilityTests",
|
||||
device: "iPhone 17 (#{simulator_version})",
|
||||
device: "iPhone 16 (18.5)", # The tests are randomly crashing on iOS 26
|
||||
ensure_devices_found: true,
|
||||
prelaunch_simulator: false,
|
||||
result_bundle: true,
|
||||
|
||||
Reference in New Issue
Block a user