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>
This commit is contained in:
Trey t
2026-02-20 10:19:55 -06:00
parent 6d1f54f451
commit 537f8621c6
7 changed files with 173 additions and 0 deletions

View File

@@ -87,6 +87,7 @@ enum UITestID {
}
enum Year {
static let heatmap = "year_heatmap"
static let donutChart = "year_donut_chart"
static let barChart = "year_bar_chart"
static let statsSection = "year_stats_section"

View File

@@ -0,0 +1,61 @@
//
// 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")
}
}

View File

@@ -0,0 +1,61 @@
//
// ReduceMotionTests.swift
// Tests iOS
//
// TC-143: App remains functional with Reduce Motion enabled.
//
import XCTest
final class ReduceMotionTests: 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",
"-UIReduceMotionPreference", "YES"
]
application.launchArguments = args
application.launchEnvironment = ["UI_TEST_FIXTURE": "single_mood"]
application.launch()
app = application
}
/// TC-143: App is navigable with Reduce Motion enabled.
func testReduceMotion_AppRemainsNavigable() {
// Day tab should have content
assertDayContentVisible()
captureScreenshot(name: "reduce_motion_day")
let tabBar = TabBarScreen(app: app)
// Navigate through tabs
tabBar.tapMonth()
XCTAssertTrue(
tabBar.monthTab.waitForExistence(timeout: 5),
"Month tab should work with Reduce Motion"
)
tabBar.tapYear()
XCTAssertTrue(
tabBar.yearTab.waitForExistence(timeout: 5),
"Year tab should work with Reduce Motion"
)
let settingsScreen = tabBar.tapSettings()
settingsScreen.assertVisible()
captureScreenshot(name: "reduce_motion_settings")
}
}

View File

@@ -0,0 +1,37 @@
//
// YearViewHeatmapTests.swift
// Tests iOS
//
// TC-148: Year View heatmap grid renders with data.
//
import XCTest
final class YearViewHeatmapTests: BaseUITestCase {
override var seedFixture: String? { "week_of_moods" }
override var bypassSubscription: Bool { true }
/// TC-148: Year View heatmap grid is visible and rendered.
func testYearView_HeatmapRendered() {
let tabBar = TabBarScreen(app: app)
tabBar.tapYear()
XCTAssertTrue(tabBar.yearTab.isSelected, "Year tab should be selected")
// Heatmap grid should be visible
let heatmap = app.element(UITestID.Year.heatmap)
XCTAssertTrue(
heatmap.waitForExistence(timeout: 8),
"Year View heatmap grid should be visible with data"
)
// Stats section should also be visible (has data)
let statsSection = app.element(UITestID.Year.statsSection)
XCTAssertTrue(
statsSection.waitForExistence(timeout: 5),
"Year stats section should be visible"
)
captureScreenshot(name: "year_heatmap_rendered")
}
}