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:
@@ -3,15 +3,16 @@
|
||||
// SportsTimeUITests
|
||||
//
|
||||
// Verifies navigation through all 5 tabs.
|
||||
// QA Sheet: F-008, F-009
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class TabNavigationTests: BaseUITestCase {
|
||||
|
||||
/// Navigates through all 5 tabs and asserts each one loads.
|
||||
/// F-008: Switch to all 5 tabs — each loads without crash.
|
||||
@MainActor
|
||||
func testTabNavigationCycle() {
|
||||
func testF008_TabNavigationCycle() {
|
||||
let home = HomeScreen(app: app)
|
||||
home.waitForLoad()
|
||||
|
||||
@@ -27,10 +28,8 @@ final class TabNavigationTests: BaseUITestCase {
|
||||
|
||||
// Progress tab (Pro-gated, but UI test mode forces Pro)
|
||||
home.switchToTab(home.progressTab)
|
||||
// Just verify the tab switched without crash
|
||||
let progressNav = app.navigationBars.firstMatch
|
||||
XCTAssertTrue(progressNav.waitForExistence(timeout: BaseUITestCase.defaultTimeout),
|
||||
"Progress tab should load")
|
||||
let progress = ProgressScreen(app: app)
|
||||
progress.assertLoaded()
|
||||
|
||||
// Settings tab
|
||||
home.switchToTab(home.settingsTab)
|
||||
@@ -42,6 +41,39 @@ final class TabNavigationTests: BaseUITestCase {
|
||||
XCTAssertTrue(home.startPlanningButton.waitForExistence(timeout: BaseUITestCase.shortTimeout),
|
||||
"Should return to Home tab")
|
||||
|
||||
captureScreenshot(named: "TabNavigation-ReturnHome")
|
||||
captureScreenshot(named: "F008-TabNavigation-ReturnHome")
|
||||
}
|
||||
|
||||
/// F-009: Tab state preserved — Schedule filters survive tab switch.
|
||||
@MainActor
|
||||
func testF009_TabStatePreservedOnSwitch() {
|
||||
let home = HomeScreen(app: app)
|
||||
home.waitForLoad()
|
||||
|
||||
// Go to Schedule tab and select a sport filter
|
||||
home.switchToTab(home.scheduleTab)
|
||||
let schedule = ScheduleScreen(app: app)
|
||||
schedule.assertLoaded()
|
||||
|
||||
let mlbChip = schedule.sportChip("mlb")
|
||||
XCTAssertTrue(mlbChip.waitForExistence(timeout: BaseUITestCase.defaultTimeout),
|
||||
"MLB chip should exist")
|
||||
mlbChip.tap()
|
||||
|
||||
// Switch to Home tab
|
||||
home.switchToTab(home.homeTab)
|
||||
home.startPlanningButton.waitForExistenceOrFail(
|
||||
timeout: BaseUITestCase.shortTimeout,
|
||||
"Home tab should load"
|
||||
)
|
||||
|
||||
// Switch back to Schedule — filter state should be preserved
|
||||
home.switchToTab(home.scheduleTab)
|
||||
|
||||
// All sports start SELECTED; tapping deselects. So MLB should still be "Not selected".
|
||||
XCTAssertEqual(mlbChip.value as? String, "Not selected",
|
||||
"MLB chip should still be deselected after switching tabs")
|
||||
|
||||
captureScreenshot(named: "F009-TabStatePreserved")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user