// // TabNavigationTests.swift // SportsTimeUITests // // Verifies navigation through all 5 tabs. // import XCTest final class TabNavigationTests: BaseUITestCase { /// Navigates through all 5 tabs and asserts each one loads. @MainActor func testTabNavigationCycle() { let home = HomeScreen(app: app) home.waitForLoad() // Schedule tab home.switchToTab(home.scheduleTab) let schedule = ScheduleScreen(app: app) schedule.assertLoaded() // My Trips tab home.switchToTab(home.myTripsTab) let myTrips = MyTripsScreen(app: app) myTrips.assertEmpty() // 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") // Settings tab home.switchToTab(home.settingsTab) let settings = SettingsScreen(app: app) settings.assertLoaded() // Return home home.switchToTab(home.homeTab) XCTAssertTrue(home.startPlanningButton.waitForExistence(timeout: BaseUITestCase.shortTimeout), "Should return to Home tab") captureScreenshot(named: "TabNavigation-ReturnHome") } }