Files
letro-ios/AccessibilityTests/Sources/Application.swift
Mauro 6160c44d67 Update copyright holding and dates (#4640)
* Update copyright holding and dates

* compound IDE Macros updated

* update copyright

* update copyrights done

* update templates and README
2025-10-21 14:34:56 +02:00

43 lines
1.3 KiB
Swift

//
// Copyright 2025 Element Creations Ltd.
// Copyright 2025 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)")
}
}
}