diff --git a/SportsTimeUITests/Tests/HomeTests.swift b/SportsTimeUITests/Tests/HomeTests.swift index 65d5c63..3404bb0 100644 --- a/SportsTimeUITests/Tests/HomeTests.swift +++ b/SportsTimeUITests/Tests/HomeTests.swift @@ -2,8 +2,8 @@ // HomeTests.swift // 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-018, F-019, F-020 +// Tests for the Home tab: hero card, start planning, toolbar button, recent trips, polls. +// QA Sheet: F-012, F-013, F-014, F-017, F-018, F-019, F-020, F-081, F-083 // import XCTest @@ -162,4 +162,46 @@ final class HomeTests: BaseUITestCase { captureScreenshot(named: "F019-PlanningTips") } + + // MARK: - Polls Section (F-081, F-083) + + /// F-081: Group Polls section is visible on My Trips tab. + @MainActor + func testF081_PollsSectionVisible() { + let home = HomeScreen(app: app) + home.waitForLoad() + home.switchToTab(home.myTripsTab) + + // Scroll to find "Group Polls" text + let groupPollsText = app.staticTexts["Group Polls"] + var scrollAttempts = 0 + while !groupPollsText.exists && scrollAttempts < 10 { + app.swipeUp(velocity: .slow) + scrollAttempts += 1 + } + XCTAssertTrue(groupPollsText.exists, + "Group Polls section should be visible on My Trips tab") + + captureScreenshot(named: "F081-PollsSectionVisible") + } + + /// F-083: Create poll button hidden when fewer than 2 trips saved. + @MainActor + func testF083_CreatePollButtonHiddenLessThan2Trips() { + let home = HomeScreen(app: app) + home.waitForLoad() + home.switchToTab(home.myTripsTab) + + // With 0 saved trips, create poll button should not exist + let createPollButton = app.buttons["Create poll"] + var scrollAttempts = 0 + while scrollAttempts < 5 { + app.swipeUp(velocity: .slow) + scrollAttempts += 1 + } + XCTAssertFalse(createPollButton.exists, + "Create poll button should not appear with fewer than 2 saved trips") + + captureScreenshot(named: "F083-CreatePollHidden") + } } diff --git a/SportsTimeUITests/Tests/TripWizardFlowTests.swift b/SportsTimeUITests/Tests/TripWizardFlowTests.swift index aef3de5..554684d 100644 --- a/SportsTimeUITests/Tests/TripWizardFlowTests.swift +++ b/SportsTimeUITests/Tests/TripWizardFlowTests.swift @@ -388,6 +388,37 @@ final class TripWizardFlowTests: BaseUITestCase { ) } + // MARK: - Review Step (F-040) + + /// F-040: Review step shows summary of selections. + @MainActor + func testF040_ReviewStepShowsSummary() { + let (_, wizard) = openWizard() + wizard.selectDateRangeMode() + + // Fill required fields + wizard.selectDateRange( + targetMonth: "June", + targetYear: "2026", + startDay: "2026-06-11", + endDay: "2026-06-16" + ) + wizard.selectSport("mlb") + wizard.selectRegion("central") + + // Scroll to find the review section + let reviewSubtitle = app.staticTexts["Review your selections"] + reviewSubtitle.scrollIntoView(in: app.scrollViews.firstMatch) + XCTAssertTrue(reviewSubtitle.exists, + "Review step subtitle should be visible") + + // Mode label should be present in the review + let modeLabel = app.staticTexts["Mode"] + XCTAssertTrue(modeLabel.exists, "Mode label should appear in review step") + + captureScreenshot(named: "F040-ReviewStep") + } + // MARK: - Plan Button Enabled (F-041) /// F-041: Plan My Trip button becomes enabled after filling all required fields. diff --git a/docs/SportsTime_QA_Test_Plan.xlsx b/docs/SportsTime_QA_Test_Plan.xlsx index b183773..3a3c7f5 100644 Binary files a/docs/SportsTime_QA_Test_Plan.xlsx and b/docs/SportsTime_QA_Test_Plan.xlsx differ