Refactor ZStack layouts to .background(), add Year View accessibility IDs, triage QA test plan

Replace ZStack-with-gradient patterns with idiomatic .background() modifier
across onboarding, customize, and settings views. Add accessibility identifiers
to Year View charts for UI test automation. Mark 67 impossible-to-automate
tests RED in QA plan and scaffold initial Year View and Settings onboarding tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-20 09:17:52 -06:00
parent ffc74f1a27
commit 5895b387be
22 changed files with 1469 additions and 1378 deletions

View File

@@ -0,0 +1,51 @@
//
// YearViewDisplayTests.swift
// Tests iOS
//
// Year View display tests: donut chart, bar chart.
// TC-035, TC-036
//
import XCTest
final class YearViewDisplayTests: BaseUITestCase {
override var seedFixture: String? { "week_of_moods" }
override var bypassSubscription: Bool { true }
/// TC-035: Year View shows donut chart with mood distribution.
func testYearView_DonutChartVisible() {
let tabBar = TabBarScreen(app: app)
tabBar.tapYear()
// Wait for Year tab to be selected and content to load
XCTAssertTrue(tabBar.yearTab.isSelected, "Year tab should be selected")
captureScreenshot(name: "year_view_loaded")
// The donut chart is inside the stats section of the first YearCard.
// Try finding by accessibility identifier first, then fall back to presence of "days" text.
let donutChart = app.element(UITestID.Year.donutChart)
let found = donutChart.waitForExistence(timeout: 8) ||
app.swipeUntilExists(donutChart, direction: .up, maxSwipes: 3, timeoutPerTry: 1.0)
captureScreenshot(name: "year_donut_chart")
XCTAssertTrue(found, "Donut chart should be visible in Year View")
}
/// TC-036: Year View shows bar chart with mood percentages.
func testYearView_BarChartVisible() {
let tabBar = TabBarScreen(app: app)
tabBar.tapYear()
XCTAssertTrue(tabBar.yearTab.isSelected, "Year tab should be selected")
let barChart = app.element(UITestID.Year.barChart)
let found = barChart.waitForExistence(timeout: 8) ||
app.swipeUntilExists(barChart, direction: .up, maxSwipes: 3, timeoutPerTry: 1.0)
captureScreenshot(name: "year_bar_chart")
XCTAssertTrue(found, "Bar chart should be visible in Year View")
}
}