diff --git a/SportsTimeUITests/Tests/HomeTests.swift b/SportsTimeUITests/Tests/HomeTests.swift index c04b592..65d5c63 100644 --- a/SportsTimeUITests/Tests/HomeTests.swift +++ b/SportsTimeUITests/Tests/HomeTests.swift @@ -3,7 +3,7 @@ // SportsTimeUITests // // Tests for the Home tab: hero card, start planning, toolbar button, and recent trips. -// QA Sheet: F-012, F-013, F-014, F-017, F-019, F-020 +// QA Sheet: F-012, F-013, F-014, F-017, F-018, F-019, F-020 // import XCTest @@ -121,6 +121,28 @@ final class HomeTests: BaseUITestCase { captureScreenshot(named: "F017-RecentTripsSection") } + /// F-018: Fresh launch with no saved trips — Recent Trips section should not appear. + @MainActor + func testF018_RecentTripsSectionHiddenNoSavedTrips() { + let home = HomeScreen(app: app) + home.waitForLoad() + + // Scroll down to check the full home tab + var scrollAttempts = 0 + while scrollAttempts < 5 { + app.swipeUp(velocity: .slow) + scrollAttempts += 1 + } + + // Recent trips section should NOT exist on a fresh launch + XCTAssertFalse( + home.recentTripsSection.exists, + "Recent trips section should not appear when no trips are saved" + ) + + captureScreenshot(named: "F018-NoRecentTrips") + } + /// F-019: Planning tips section is visible at bottom of home tab. @MainActor func testF019_PlanningTipsSectionVisible() { diff --git a/SportsTimeUITests/Tests/TripSavingTests.swift b/SportsTimeUITests/Tests/TripSavingTests.swift index db42347..5240ac0 100644 --- a/SportsTimeUITests/Tests/TripSavingTests.swift +++ b/SportsTimeUITests/Tests/TripSavingTests.swift @@ -3,7 +3,7 @@ // SportsTimeUITests // // Tests the end-to-end trip saving flow: plan → select → save → verify in My Trips. -// QA Sheet: F-064, F-065, F-077, F-078, F-079, F-080 +// QA Sheet: F-060, F-062, F-064, F-065, F-077, F-078, F-079, F-080 // import XCTest @@ -168,4 +168,51 @@ final class TripSavingTests: BaseUITestCase { captureScreenshot(named: "F061-StatsRow") } + + // MARK: - Trip Detail Loads with Map (F-060) + + /// F-060: Trip detail shows the hero map and itinerary after opening. + @MainActor + func testF060_TripDetailLoadsWithMap() { + let (_, detail) = TestFlows.planAndSelectFirstTrip(app: app) + + // Favorite button sits on the map overlay — its presence proves the map loaded + XCTAssertTrue( + detail.favoriteButton.exists, + "Favorite button (map overlay) should be visible, proving map loaded" + ) + + // Itinerary section should also be visible below the map + detail.assertItineraryVisible() + + captureScreenshot(named: "F060-TripDetailWithMap") + } + + // MARK: - Itinerary Day Cards (F-062) + + /// F-062: Scrolling through the itinerary reveals day cards (Day 1, Day 2, etc.). + @MainActor + func testF062_ItineraryDayCardsVisible() { + let (_, _) = TestFlows.planAndSelectFirstTrip(app: app) + + // Day 1 should exist in the itinerary + let day1 = app.staticTexts["Day 1"] + var scrollAttempts = 0 + while !day1.exists && scrollAttempts < 15 { + app.swipeUp(velocity: .slow) + scrollAttempts += 1 + } + XCTAssertTrue(day1.exists, "Day 1 card should be visible in itinerary") + + // Day 2 should also exist (planned trips have at least 2 days) + let day2 = app.staticTexts["Day 2"] + scrollAttempts = 0 + while !day2.exists && scrollAttempts < 10 { + app.swipeUp(velocity: .slow) + scrollAttempts += 1 + } + XCTAssertTrue(day2.exists, "Day 2 card should be visible in itinerary") + + captureScreenshot(named: "F062-ItineraryDayCards") + } } diff --git a/docs/SportsTime_QA_Test_Plan.xlsx b/docs/SportsTime_QA_Test_Plan.xlsx index 638cc4e..e43e9a1 100644 Binary files a/docs/SportsTime_QA_Test_Plan.xlsx and b/docs/SportsTime_QA_Test_Plan.xlsx differ