diff --git a/SportsTimeUITests/Tests/ScheduleTests.swift b/SportsTimeUITests/Tests/ScheduleTests.swift index 73f8c8c..bee02cc 100644 --- a/SportsTimeUITests/Tests/ScheduleTests.swift +++ b/SportsTimeUITests/Tests/ScheduleTests.swift @@ -3,7 +3,7 @@ // SportsTimeUITests // // Verifies the Schedule tab loads and displays content. -// QA Sheet: F-085, F-086, F-087, F-088, F-089, F-090, F-092, F-094 +// QA Sheet: F-085, F-086, F-087, F-088, F-089, F-090, F-091, F-092, F-094 // import XCTest @@ -191,6 +191,48 @@ final class ScheduleTests: BaseUITestCase { captureScreenshot(named: "F092-ScheduleEmptyState") } + // MARK: - Date Range Filter (F-091) + + /// F-091: Date range filter sheet opens and applies. + @MainActor + func testF091_DateRangeFilter() { + let home = HomeScreen(app: app) + home.waitForLoad() + home.switchToTab(home.scheduleTab) + + let schedule = ScheduleScreen(app: app) + schedule.assertLoaded() + + // Open filter menu + schedule.filterButton.tap() + + // Tap "Date Range" in the menu + let dateRangeButton = app.buttons["Date Range"] + XCTAssertTrue(dateRangeButton.waitForExistence(timeout: BaseUITestCase.shortTimeout), + "Date Range menu item should exist") + dateRangeButton.tap() + + // Date range picker sheet should appear + let sheetTitle = app.staticTexts["Select Dates"] + XCTAssertTrue(sheetTitle.waitForExistence(timeout: BaseUITestCase.defaultTimeout), + "Date range picker sheet should appear") + + // Tap "Next 7 Days" quick option + let next7Days = app.buttons["Next 7 Days"] + XCTAssertTrue(next7Days.exists, "Next 7 Days button should exist") + next7Days.tap() + + // Apply the filter + let applyButton = app.buttons["Apply"] + XCTAssertTrue(applyButton.exists, "Apply button should exist") + applyButton.tap() + + // Schedule should still function after applying date filter + schedule.assertLoaded() + + captureScreenshot(named: "F091-DateRangeFilter") + } + // MARK: - Diagnostics (F-094) /// F-094: Diagnostics button opens the diagnostics sheet. diff --git a/SportsTimeUITests/Tests/TripWizardFlowTests.swift b/SportsTimeUITests/Tests/TripWizardFlowTests.swift index 554684d..76be00d 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, F-047; also F-030, F-031, F-032 +// QA Sheet: F-018 through F-042, F-047; also F-030, F-031, F-032, F-037, F-038 // import XCTest @@ -477,6 +477,68 @@ final class TripWizardFlowTests: BaseUITestCase { captureScreenshot(named: "F047-WizardScroll") } + // MARK: - Route Preference (F-037) + + /// F-037: Route preference cards (Direct/Scenic/Balanced) are selectable. + @MainActor + func testF037_RoutePreferenceSelection() { + let (_, wizard) = openWizard() + wizard.selectDateRangeMode() + + // Scroll down to find route preference cards + let scenicButton = app.buttons["Scenic"] + scenicButton.scrollIntoView(in: app.scrollViews.firstMatch) + + guard scenicButton.exists else { + XCTFail("Scenic route preference button not found") + return + } + + // Tap "Scenic" to select it + scenicButton.tap() + + // Verify it became selected + XCTAssertEqual(scenicButton.value as? String, "Selected", + "Scenic route preference should be selected after tap") + + captureScreenshot(named: "F037-RoutePreference-Scenic") + } + + // MARK: - Allow Repeat Cities (F-038) + + /// F-038: Allow repeat cities toggle buttons work. + @MainActor + func testF038_AllowRepeatCitiesToggle() { + let (_, wizard) = openWizard() + wizard.selectDateRangeMode() + + // Scroll down to find repeat cities options + let uniqueButton = app.buttons["No, unique cities only"] + uniqueButton.scrollIntoView(in: app.scrollViews.firstMatch) + + guard uniqueButton.exists else { + XCTFail("'No, unique cities only' button not found") + return + } + + // Tap to select unique cities only + uniqueButton.tap() + + // Verify selection + XCTAssertEqual(uniqueButton.value as? String, "Selected", + "'No, unique cities only' should be selected after tap") + + // Tap "Yes, allow repeats" to switch + let repeatButton = app.buttons["Yes, allow repeats"] + if repeatButton.exists { + repeatButton.tap() + XCTAssertEqual(repeatButton.value as? String, "Selected", + "'Yes, allow repeats' should be selected after tap") + } + + captureScreenshot(named: "F038-RepeatCities") + } + // 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 3ce005a..c4b229d 100644 Binary files a/docs/SportsTime_QA_Test_Plan.xlsx and b/docs/SportsTime_QA_Test_Plan.xlsx differ