mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
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:
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Copyright 2022-2024 New Vector Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
enum Application {
|
||||
static func launch(viewID: String) -> XCUIApplication {
|
||||
checkEnvironments()
|
||||
|
||||
let app = XCUIApplication()
|
||||
|
||||
let launchEnvironment = [
|
||||
"ACCESSIBILITY_VIEW": viewID
|
||||
]
|
||||
|
||||
app.launchEnvironment = launchEnvironment
|
||||
app.launch()
|
||||
return app
|
||||
}
|
||||
|
||||
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)")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user