Files
Reflect/Tests iOS/HighContrastTests.swift
Trey t 537f8621c6 Add 3 passing UI tests (batch 5): heatmap, reduce motion, high contrast
- TC-148: Year View heatmap grid renders with data (added accessibility ID)
- TC-143: App navigable with Reduce Motion enabled
- TC-144: App navigable with High Contrast mode enabled
- Marked 89 blocked tests RED in QA spreadsheet

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:19:55 -06:00

62 lines
1.8 KiB
Swift

//
// HighContrastTests.swift
// Tests iOS
//
// TC-144: App remains functional in High Contrast mode.
//
import XCTest
final class HighContrastTests: BaseUITestCase {
override var seedFixture: String? { "single_mood" }
override var bypassSubscription: Bool { true }
override func setUp() {
// Do NOT call super we need custom accessibility launch args
continueAfterFailure = false
let application = XCUIApplication()
let args: [String] = [
"--ui-testing", "--disable-animations",
"--reset-state",
"--bypass-subscription",
"--skip-onboarding",
"-AppleLanguages", "(en)",
"-AppleLocale", "en_US",
"-UIAccessibilityDarkerSystemColorsEnabled", "YES"
]
application.launchArguments = args
application.launchEnvironment = ["UI_TEST_FIXTURE": "single_mood"]
application.launch()
app = application
}
/// TC-144: App is navigable with High Contrast mode enabled.
func testHighContrast_AppRemainsNavigable() {
// Day tab should have content
assertDayContentVisible()
captureScreenshot(name: "high_contrast_day")
let tabBar = TabBarScreen(app: app)
// Navigate through tabs
tabBar.tapMonth()
XCTAssertTrue(
tabBar.monthTab.waitForExistence(timeout: 5),
"Month tab should work with High Contrast"
)
tabBar.tapYear()
XCTAssertTrue(
tabBar.yearTab.waitForExistence(timeout: 5),
"Year tab should work with High Contrast"
)
let settingsScreen = tabBar.tapSettings()
settingsScreen.assertVisible()
captureScreenshot(name: "high_contrast_settings")
}
}