diff --git a/SportsTimeUITests/Tests/TripOptionsTests.swift b/SportsTimeUITests/Tests/TripOptionsTests.swift index 89cb3ad..567e876 100644 --- a/SportsTimeUITests/Tests/TripOptionsTests.swift +++ b/SportsTimeUITests/Tests/TripOptionsTests.swift @@ -3,7 +3,7 @@ // SportsTimeUITests // // Tests the Trip Options results screen: sorting, selection, navigation. -// QA Sheet: F-052, F-053, F-054, F-055, F-058, F-059 +// QA Sheet: F-051, F-052, F-053, F-054, F-055, F-058, F-059 // import XCTest @@ -20,6 +20,23 @@ final class TripOptionsTests: BaseUITestCase { return options } + // MARK: - Results Display (F-051) + + /// F-051: Trip options listed with city count, game count, distance, and preview. + @MainActor + func testF051_ResultsDisplayAfterPlanning() { + let options = planTripAndGetOptions() + + // At least one trip card should be visible + let firstCard = options.tripCard(0) + XCTAssertTrue(firstCard.exists, "First trip card should be visible") + + // Sort dropdown should be visible (proves results header rendered) + XCTAssertTrue(options.sortDropdown.exists, "Sort dropdown should be visible on results screen") + + captureScreenshot(named: "F051-ResultsDisplay") + } + // MARK: - Sort Options (F-052, F-053, F-054, F-055) /// F-052: Sort by Recommended reorders trip options. diff --git a/SportsTimeUITests/Tests/TripWizardFlowTests.swift b/SportsTimeUITests/Tests/TripWizardFlowTests.swift index 9ff83b2..e819b25 100644 --- a/SportsTimeUITests/Tests/TripWizardFlowTests.swift +++ b/SportsTimeUITests/Tests/TripWizardFlowTests.swift @@ -4,7 +4,7 @@ // // Tests the trip planning wizard: planning modes, calendar navigation, // sport/region selection, and planning engine results. -// QA Sheet: F-018 through F-042 +// QA Sheet: F-018 through F-042, F-047 // import XCTest @@ -315,6 +315,64 @@ final class TripWizardFlowTests: BaseUITestCase { ) } + // MARK: - Plan Button Enabled (F-041) + + /// F-041: Plan My Trip button becomes enabled after filling all required fields. + @MainActor + func testF041_PlanButtonEnabledState() { + let (_, wizard) = openWizard() + wizard.selectDateRangeMode() + + // Fill all required fields + wizard.selectDateRange( + targetMonth: "June", + targetYear: "2026", + startDay: "2026-06-11", + endDay: "2026-06-16" + ) + wizard.selectSport("mlb") + wizard.selectRegion("central") + + // Plan button should now be enabled + let planBtn = wizard.planTripButton + planBtn.scrollIntoView(in: app.scrollViews.firstMatch) + XCTAssertTrue(planBtn.isEnabled, + "Plan My Trip should be enabled after filling all required fields") + + captureScreenshot(named: "F041-PlanButton-Enabled") + } + + // MARK: - Wizard Scroll (F-047) + + /// F-047: All wizard steps are reachable by scrolling. + @MainActor + func testF047_WizardScrollBehavior() { + let (_, wizard) = openWizard() + wizard.selectDateRangeMode() + + // Verify date controls are reachable + let monthLabel = wizard.monthLabel + monthLabel.scrollIntoView(in: app.scrollViews.firstMatch) + XCTAssertTrue(monthLabel.exists, "Month label should be reachable by scrolling") + + // Verify sport buttons are reachable + let mlbButton = wizard.sportButton("mlb") + mlbButton.scrollIntoView(in: app.scrollViews.firstMatch) + XCTAssertTrue(mlbButton.exists, "Sport buttons should be reachable by scrolling") + + // Verify region buttons are reachable + let centralButton = wizard.regionButton("central") + centralButton.scrollIntoView(in: app.scrollViews.firstMatch) + XCTAssertTrue(centralButton.exists, "Region buttons should be reachable by scrolling") + + // Verify Plan My Trip button is reachable at the bottom + let planBtn = wizard.planTripButton + planBtn.scrollIntoView(in: app.scrollViews.firstMatch) + XCTAssertTrue(planBtn.exists, "Plan My Trip button should be reachable by scrolling") + + captureScreenshot(named: "F047-WizardScroll") + } + // MARK: - All 5 Modes Available (F-018 to F-022 combined) /// Verifies all 5 planning mode buttons are present in the wizard. diff --git a/docs/SportsTime_QA_Test_Plan.xlsx b/docs/SportsTime_QA_Test_Plan.xlsx index 315fbbb..f00f7bf 100644 Binary files a/docs/SportsTime_QA_Test_Plan.xlsx and b/docs/SportsTime_QA_Test_Plan.xlsx differ