Refactor iOS UI tests to blueprint architecture and migrate legacy suites

This commit is contained in:
treyt
2026-02-19 17:30:58 -06:00
parent 09be5fa444
commit 710a8bd1d6
36 changed files with 835 additions and 6263 deletions
+44
View File
@@ -0,0 +1,44 @@
import Foundation
import UIKit
import ComposeApp
/// Runtime contract between the app and XCUITests.
enum UITestRuntime {
static let uiTestingFlag = "--ui-testing"
static let disableAnimationsFlag = "--disable-animations"
static let resetStateFlag = "--reset-state"
static var launchArguments: [String] {
ProcessInfo.processInfo.arguments
}
static var isEnabled: Bool {
launchArguments.contains(uiTestingFlag)
}
static var shouldDisableAnimations: Bool {
isEnabled && launchArguments.contains(disableAnimationsFlag)
}
static var shouldResetState: Bool {
isEnabled && launchArguments.contains(resetStateFlag)
}
static func configureForLaunch() {
guard isEnabled else { return }
if shouldDisableAnimations {
UIView.setAnimationsEnabled(false)
}
UserDefaults.standard.set(true, forKey: "ui_testing_mode")
}
static func resetStateIfRequested() {
guard shouldResetState else { return }
DataManager.shared.clear()
OnboardingState.shared.reset()
ThemeManager.shared.currentTheme = .bright
}
}