mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
0a77ba6c90
* swift format enforce isEmpty rule * revert scheme * use trailing closure
54 lines
1.3 KiB
Swift
54 lines
1.3 KiB
Swift
//
|
|
// Copyright 2025 Element Creations Ltd.
|
|
// Copyright 2022-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 {
|
|
@discardableResult static func launch() -> XCUIApplication {
|
|
let app = XCUIApplication()
|
|
|
|
let launchEnvironment = [
|
|
"IS_RUNNING_INTEGRATION_TESTS": "1"
|
|
]
|
|
|
|
app.launchEnvironment = launchEnvironment
|
|
app.launch()
|
|
|
|
return app
|
|
}
|
|
}
|
|
|
|
extension XCUIApplication {
|
|
var homeserver: String? {
|
|
guard let homeserver = ProcessInfo.processInfo.environment["INTEGRATION_TESTS_HOST"],
|
|
!homeserver.isEmpty else {
|
|
return nil
|
|
}
|
|
|
|
return homeserver
|
|
}
|
|
|
|
var username: String {
|
|
guard let username = ProcessInfo.processInfo.environment["INTEGRATION_TESTS_USERNAME"],
|
|
!username.isEmpty else {
|
|
return "default"
|
|
}
|
|
|
|
return username
|
|
}
|
|
|
|
var password: String {
|
|
guard let password = ProcessInfo.processInfo.environment["INTEGRATION_TESTS_PASSWORD"],
|
|
!password.isEmpty else {
|
|
return "default"
|
|
}
|
|
|
|
return password
|
|
}
|
|
}
|