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>
This commit is contained in:
71
SportsTimeUITests/Tests/TripWizardFlowTests.swift
Normal file
71
SportsTimeUITests/Tests/TripWizardFlowTests.swift
Normal file
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// 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"
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user