Add F-040, F-081, F-083 UI tests for review step and polls section
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
// HomeTests.swift
|
// HomeTests.swift
|
||||||
// SportsTimeUITests
|
// SportsTimeUITests
|
||||||
//
|
//
|
||||||
// Tests for the Home tab: hero card, start planning, toolbar button, and recent trips.
|
// 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
|
// QA Sheet: F-012, F-013, F-014, F-017, F-018, F-019, F-020, F-081, F-083
|
||||||
//
|
//
|
||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
@@ -162,4 +162,46 @@ final class HomeTests: BaseUITestCase {
|
|||||||
|
|
||||||
captureScreenshot(named: "F019-PlanningTips")
|
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")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
// MARK: - Plan Button Enabled (F-041)
|
||||||
|
|
||||||
/// F-041: Plan My Trip button becomes enabled after filling all required fields.
|
/// F-041: Plan My Trip button becomes enabled after filling all required fields.
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user