Files
Sportstime/SportsTimeUITests/Tests/TripWizardFlowTests.swift
Trey t d53f222489 feat: add XCUITest suite with 10 critical flow tests and QA test plan
Add comprehensive UI test infrastructure with Page Object pattern,
accessibility identifiers, UI test mode (--ui-testing, --reset-state,
--disable-animations), and 10 passing tests covering app launch, tab
navigation, trip wizard, trip saving, settings, schedule, and
accessibility at XXXL Dynamic Type. Also adds a 229-case QA test plan
Excel workbook for manual QA handoff.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 16:23:59 -06:00

72 lines
2.0 KiB
Swift

//
// TripWizardFlowTests.swift
// SportsTimeUITests
//
// Tests the trip planning wizard: date range mode, calendar navigation,
// sport/region selection, and planning engine results.
//
import XCTest
final class TripWizardFlowTests: BaseUITestCase {
/// Full flow: Start Planning Date Range Select dates MLB Central Plan.
/// Asserts the planning engine returns results.
@MainActor
func testDateRangeTripPlanningFlow() {
let home = HomeScreen(app: app)
home.waitForLoad()
home.tapStartPlanning()
let wizard = TripWizardScreen(app: app)
wizard.waitForLoad()
// Step 1: Select "By Dates" mode
wizard.selectDateRangeMode()
// Step 2: Navigate to June 2026 and select June 11-16
// Scroll to see dates step
wizard.nextMonthButton.scrollIntoView(in: app.scrollViews.firstMatch)
wizard.selectDateRange(
targetMonth: "June",
targetYear: "2026",
startDay: "2026-06-11",
endDay: "2026-06-16"
)
// Step 3: Select MLB
wizard.selectSport("mlb")
// Step 4: Select Central region
wizard.selectRegion("central")
// Step 5: Tap Plan My Trip
wizard.tapPlanTrip()
// Assert: Trip Options screen appears with results
let options = TripOptionsScreen(app: app)
options.waitForLoad()
options.assertHasResults()
captureScreenshot(named: "TripWizard-PlanningResults")
}
/// Verifies the wizard can be dismissed via Cancel.
@MainActor
func testWizardCanBeDismissed() {
let home = HomeScreen(app: app)
home.waitForLoad()
home.tapStartPlanning()
let wizard = TripWizardScreen(app: app)
wizard.waitForLoad()
wizard.tapCancel()
// Assert: Back on home screen
XCTAssertTrue(
home.startPlanningButton.waitForExistence(timeout: BaseUITestCase.defaultTimeout),
"Should return to Home after cancelling wizard"
)
}
}