Add F-010, F-017 UI tests and update QA test plan with 24 automation mappings
- F-010: Tap active tab scrolls to top (TabNavigationTests) - F-017: Recent trips section with saved trips (HomeTests) - Update SportsTime_QA_Test_Plan.xlsx with all 60 automated test mappings - Green highlight on automated cells for visual tracking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
// HomeTests.swift
|
||||
// SportsTimeUITests
|
||||
//
|
||||
// Tests for the Home tab: hero card, start planning, and toolbar button.
|
||||
// QA Sheet: F-012, F-013, F-020
|
||||
// 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-019, F-020
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@@ -79,6 +79,48 @@ final class HomeTests: BaseUITestCase {
|
||||
captureScreenshot(named: "F014-FeaturedTrips")
|
||||
}
|
||||
|
||||
/// F-017: Recent trips section shows saved trips with "See All" link on Home tab.
|
||||
@MainActor
|
||||
func testF017_RecentTripsSectionWithSavedTrips() {
|
||||
// Plan a trip and select the first option
|
||||
let (_, detail) = TestFlows.planAndSelectFirstTrip(app: app)
|
||||
|
||||
// Save the trip
|
||||
detail.assertSaveState(isSaved: false)
|
||||
detail.tapFavorite()
|
||||
detail.assertSaveState(isSaved: true)
|
||||
|
||||
captureScreenshot(named: "F017-TripSaved")
|
||||
|
||||
// Navigate back: Detail → Options → Wizard → Cancel (dismiss sheet)
|
||||
app.navigationBars.buttons.firstMatch.tap()
|
||||
app.navigationBars.buttons.firstMatch
|
||||
.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
||||
TripWizardScreen(app: app).tapCancel()
|
||||
|
||||
// We're back on Home tab. Wait for it to load.
|
||||
let home = HomeScreen(app: app)
|
||||
home.waitForLoad()
|
||||
|
||||
// Scroll to find the recent trips section
|
||||
let recentTrips = home.recentTripsSection
|
||||
var scrollAttempts = 0
|
||||
while !recentTrips.exists && scrollAttempts < 15 {
|
||||
app.swipeUp(velocity: .slow)
|
||||
scrollAttempts += 1
|
||||
}
|
||||
|
||||
XCTAssertTrue(recentTrips.exists,
|
||||
"Recent trips section should appear after saving a trip")
|
||||
|
||||
// Verify "See All" link is visible
|
||||
let seeAllText = app.staticTexts["See All"]
|
||||
XCTAssertTrue(seeAllText.exists,
|
||||
"'See All' link should be visible in recent trips section")
|
||||
|
||||
captureScreenshot(named: "F017-RecentTripsSection")
|
||||
}
|
||||
|
||||
/// F-019: Planning tips section is visible at bottom of home tab.
|
||||
@MainActor
|
||||
func testF019_PlanningTipsSectionVisible() {
|
||||
|
||||
@@ -44,6 +44,39 @@ final class TabNavigationTests: BaseUITestCase {
|
||||
captureScreenshot(named: "F008-TabNavigation-ReturnHome")
|
||||
}
|
||||
|
||||
/// F-010: Tapping the active tab scrolls the view back to the top.
|
||||
@MainActor
|
||||
func testF010_TapActiveTabScrollsToTop() {
|
||||
let home = HomeScreen(app: app)
|
||||
home.waitForLoad()
|
||||
|
||||
// Verify "Adventure Awaits" hero card is hittable at the top
|
||||
XCTAssertTrue(home.adventureAwaitsText.isHittable,
|
||||
"Adventure Awaits should be hittable initially")
|
||||
|
||||
// Scroll down until the hero card is off-screen
|
||||
for _ in 0..<8 {
|
||||
app.swipeUp(velocity: .slow)
|
||||
}
|
||||
|
||||
// Verify the hero card is no longer hittable (scrolled off-screen)
|
||||
XCTAssertFalse(home.adventureAwaitsText.isHittable,
|
||||
"Adventure Awaits should not be hittable after scrolling down")
|
||||
|
||||
captureScreenshot(named: "F010-ScrolledDown")
|
||||
|
||||
// Tap the Home tab (already the active tab) to trigger scroll-to-top
|
||||
home.homeTab.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
|
||||
|
||||
// Hero card should scroll back into view and become hittable
|
||||
home.adventureAwaitsText.waitUntilHittable(
|
||||
timeout: BaseUITestCase.defaultTimeout,
|
||||
"Adventure Awaits should be hittable after tapping active tab (scroll to top)"
|
||||
)
|
||||
|
||||
captureScreenshot(named: "F010-ScrolledToTop")
|
||||
}
|
||||
|
||||
/// F-009: Tab state preserved — Schedule filters survive tab switch.
|
||||
@MainActor
|
||||
func testF009_TabStatePreservedOnSwitch() {
|
||||
|
||||
Reference in New Issue
Block a user