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:
Trey t
2026-02-20 00:37:34 -06:00
parent 54be5cae3e
commit be72367fb1
3 changed files with 75 additions and 2 deletions

View File

@@ -2,8 +2,8 @@
// HomeTests.swift
// SportsTimeUITests
//
// 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-018, F-019, F-020
// 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, F-081, F-083
//
import XCTest
@@ -162,4 +162,46 @@ final class HomeTests: BaseUITestCase {
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")
}
}