Add F-041, F-047, F-051 UI tests for wizard and trip options

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-20 00:25:50 -06:00
parent 378f65f82c
commit 61fd7f5209
3 changed files with 77 additions and 2 deletions

View File

@@ -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.