feat: expand XCUITest coverage to 54 QA scenarios with accessibility IDs and fix test failures

Add 22 new UI tests across 8 test files covering Home, Schedule, Progress,
Settings, TabNavigation, TripSaving, and TripOptions. Add accessibility
identifiers to 11 view files for test element discovery. Fix sport chip
assertion logic (all sports start selected, tap deselects), scroll container
issues on iOS 26 nested ScrollViews, toggle interaction, and delete trip flow.
Update QA coverage map from 32 to 54 automated test cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-16 19:44:22 -06:00
parent d53f222489
commit dc142bd14b
25 changed files with 1637 additions and 102 deletions

View File

@@ -15,6 +15,8 @@ section_fill = PatternFill(start_color="FF6B35", end_color="FF6B35", fill_type="
p1_fill = PatternFill(start_color="FADBD8", end_color="FADBD8", fill_type="solid")
p2_fill = PatternFill(start_color="FEF9E7", end_color="FEF9E7", fill_type="solid")
p3_fill = PatternFill(start_color="E8F8F5", end_color="E8F8F5", fill_type="solid")
auto_fill = PatternFill(start_color="D5F5E3", end_color="D5F5E3", fill_type="solid")
auto_font = Font(name="Helvetica Neue", size=10, color="1E8449")
wrap = Alignment(wrap_text=True, vertical="top")
thin_border = Border(
left=Side(style="thin", color="D5D8DC"),
@@ -23,8 +25,86 @@ thin_border = Border(
bottom=Side(style="thin", color="D5D8DC"),
)
COLUMNS = ["ID", "Feature Area", "Test Case", "Steps", "Expected Result", "Priority", "Type", "Status", "Tester", "Notes"]
COL_WIDTHS = [6, 18, 40, 55, 40, 10, 14, 10, 12, 30]
COLUMNS = ["ID", "Feature Area", "Test Case", "Steps", "Expected Result", "Priority", "Type", "Automated", "Status", "Tester", "Notes"]
COL_WIDTHS = [6, 18, 40, 55, 40, 10, 14, 32, 10, 12, 30]
# ============================================================
# XCUITest Coverage Map
# Maps QA sheet IDs to their XCUITest method names.
# Keep in sync with SportsTimeUITests/Tests/*.swift
# ============================================================
XCUITEST_COVERAGE = {
# AppLaunchTests.swift
"F-001": "testF001_ColdLaunchShowsHomeWithAllTabs",
"F-002": "testF002_BootstrapCompletesWithContent",
"F-006": "testF006_BackgroundForegroundResume",
# TabNavigationTests.swift
"F-008": "testF008_TabNavigationCycle",
"F-009": "testF009_TabStatePreservedOnSwitch",
# HomeTests.swift
"F-012": "testF012_HeroCardDisplaysCorrectly",
"F-013": "testF013_StartPlanningOpensWizard",
"F-014": "testF014_FeaturedTripsCarouselLoads",
"F-019": "testF019_PlanningTipsSectionVisible",
"F-020": "testF020_CreateTripToolbarButtonOpensWizard",
# TripWizardFlowTests.swift
"F-021": "testF018_DateRangeTripPlanningFlow",
"F-022": "testF019_ByGamesModeSelectable",
"F-023": "testF020_ByRouteModeSelectable",
"F-024": "testF021_FollowTeamModeSelectable",
"F-025": "testF022_ByTeamsModeSelectable",
"F-026": "testF023_SwitchingModesResetsFields",
"F-027": "testF024_CalendarNavigationForward",
"F-028": "testF025_CalendarNavigationBackward",
"F-029": "testF026_DateRangeSelection",
"F-033": "testF030_SingleSportSelection",
"F-034": "testF031_MultipleSportSelection",
"F-036": "testF033_RegionSelection",
"F-042": "testF038_PlanButtonDisabledState",
"F-043": "testF018_DateRangeTripPlanningFlow",
"F-044": "testF040_NoGamesFoundError",
"F-046": "testF042_WizardCanBeDismissed",
# TripOptionsTests.swift
"F-052": "testF052_SortByRecommended",
"F-053": "testF053_SortByMostGames",
"F-054": "testF054_SortByLeastMiles",
"F-055": "testF055_SortByBestEfficiency",
# TripSavingTests.swift
"F-061": "testF061_StatsRowDisplaysCorrectly",
"F-064": "testF048_SaveTrip",
"F-065": "testF049_UnsaveTrip",
"F-077": "testF058_MyTripsEmptyState",
"F-078": "testF059_SavedTripsList",
"F-079": "testF079_TapSavedTripOpensDetail",
"F-080": "testF080_DeleteSavedTrip",
# ScheduleTests.swift
"F-085": "testF047_ScheduleTabLoads",
"F-086": "testF055_SportFilterChips",
"F-087": "testF087_MultipleSportFilters",
"F-088": "testF088_ClearAllFilters",
"F-089": "testF089_SearchByTeamName",
"F-092": "testF092_ScheduleEmptyState",
# ProgressTests.swift
"F-095": "testF066_ProgressTabLoads",
"F-097": "testF097_LeagueSportSelector",
"F-110": "testF110_AchievementsGalleryVisible",
# SettingsTests.swift
"F-123": "testF063_SettingsSectionsPresent",
"F-124": "testF062_SettingsShowsVersion",
"F-125": "testF125_AppearanceLightMode",
"F-126": "testF126_AppearanceDarkMode",
"F-127": "testF127_AppearanceSystemMode",
"F-128": "testF128_ToggleAnimations",
"F-135": "testF075_SubscriptionSectionContent",
"F-138": "testF138_ResetToDefaults",
"F-139": "testF139_ResetToDefaultsCancel",
# AccessibilityTests.swift
"A-005": "testA005_LargeDynamicTypeEntryFlow",
# StabilityTests.swift
"P-014": "testP014_RapidTabSwitching",
"P-015": "testP015_RapidWizardOpenClose",
}
def setup_sheet(ws, title):
ws.title = title
@@ -37,7 +117,7 @@ def setup_sheet(ws, title):
cell.border = thin_border
ws.column_dimensions[get_column_letter(i)].width = w
ws.freeze_panes = "A2"
ws.auto_filter.ref = f"A1:J1"
ws.auto_filter.ref = f"A1:{get_column_letter(len(COLUMNS))}1"
def add_section(ws, row, title):
for col in range(1, len(COLUMNS) + 1):
@@ -48,7 +128,8 @@ def add_section(ws, row, title):
return row + 1
def add_row(ws, row, test_id, area, case, steps, expected, priority, test_type):
data = [test_id, area, case, steps, expected, priority, test_type, "", "", ""]
automated = XCUITEST_COVERAGE.get(test_id, "")
data = [test_id, area, case, steps, expected, priority, test_type, automated, "", "", ""]
for col, val in enumerate(data, 1):
cell = ws.cell(row=row, column=col, value=val)
cell.alignment = wrap
@@ -60,6 +141,9 @@ def add_row(ws, row, test_id, area, case, steps, expected, priority, test_type):
cell.fill = p2_fill
elif val == "P3":
cell.fill = p3_fill
if col == 8 and val: # Automated column with a test name
cell.fill = auto_fill
cell.font = auto_font
return row + 1
@@ -539,4 +623,6 @@ wb.save(output)
print(f"Saved to {output}")
print(f"Sheets: {[s.title for s in wb.worksheets]}")
total = sum(1 for ws in wb.worksheets for row in ws.iter_rows(min_row=2) if row[0].value and str(row[0].value).startswith(("F-", "E-", "A-", "P-", "D-")))
automated = sum(1 for ws in wb.worksheets for row in ws.iter_rows(min_row=2) if row[0].value and str(row[0].value) in XCUITEST_COVERAGE)
print(f"Total test cases: {total}")
print(f"Automated (XCUITest): {automated} ({automated*100//total}%)")