Files
honeyDueKMP/iosApp/HoneyDueUITests/TestConfiguration/TestLaunchConfig.swift
Trey t 1e2adf7660 Rebrand from Casera/MyCrib to honeyDue
Total rebrand across KMM project:
- Kotlin package: com.example.casera -> com.tt.honeyDue (dirs + declarations)
- Gradle: rootProject.name, namespace, applicationId
- Android: manifest, strings.xml (all languages), widget resources
- iOS: pbxproj bundle IDs, Info.plist, entitlements, xcconfig
- iOS directories: Casera/ -> HoneyDue/, CaseraTests/ -> HoneyDueTests/, etc.
- Swift source: all class/struct/enum renames
- Deep links: casera:// -> honeydue://, .casera -> .honeydue
- App icons replaced with honeyDue honeycomb icon
- Domains: casera.treytartt.com -> honeyDue.treytartt.com
- Bundle IDs: com.tt.casera -> com.tt.honeyDue
- Database table names preserved

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 06:33:57 -06:00

65 lines
2.2 KiB
Swift

import XCTest
/// Centralized app launch configuration for UI tests.
///
/// Provides consistent launch arguments and environment variables across
/// all test suites. Disables animations and sets locale to English for
/// deterministic test behavior.
enum TestLaunchConfig {
/// Standard launch arguments for UI test mode.
/// Disables animations and forces English locale.
static let standardArguments: [String] = [
"-UITEST_MODE", "1",
"-AppleLanguages", "(en)",
"-AppleLocale", "en_US",
"-UIAnimationsEnabled", "NO"
]
/// Launch environment variables for UI tests.
static let standardEnvironment: [String: String] = [
"UITEST_MODE": "1",
"ANIMATIONS_DISABLED": "1"
]
/// Configure and launch app with standard test settings.
///
/// - Parameters:
/// - additionalArguments: Extra launch arguments to append.
/// - additionalEnvironment: Extra environment variables to merge.
/// - Returns: The launched `XCUIApplication` instance.
@discardableResult
static func launchApp(
additionalArguments: [String] = [],
additionalEnvironment: [String: String] = [:]
) -> XCUIApplication {
let app = XCUIApplication()
app.launchArguments = standardArguments + additionalArguments
var env = standardEnvironment
additionalEnvironment.forEach { env[$0.key] = $0.value }
app.launchEnvironment = env
app.launch()
return app
}
/// Launch app pre-authenticated (skips login flow).
///
/// Passes test credentials via launch arguments and environment so the
/// app can bypass the normal authentication flow during UI tests.
///
/// - Parameters:
/// - email: Test user email address.
/// - token: Test authentication token.
/// - Returns: The launched `XCUIApplication` instance.
@discardableResult
static func launchAuthenticated(
email: String = "test@example.com",
token: String = "test-token-12345"
) -> XCUIApplication {
return launchApp(
additionalArguments: ["-TEST_AUTH_EMAIL", email, "-TEST_AUTH_TOKEN", token],
additionalEnvironment: ["TEST_AUTH_EMAIL": email, "TEST_AUTH_TOKEN": token]
)
}
}