Add F-100, F-101, F-106 UI tests and page objects for Progress feature

Adds 3 new UI tests covering stadium visit manual entry, required field
validation, and games history navigation. Includes accessibility IDs on
StadiumVisitSheet/ProgressTabView and new page objects (StadiumVisitSheetScreen,
GamesHistoryScreen) in the test framework.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-19 23:02:52 -06:00
parent f10bc4fe59
commit 8421b23f0c
4 changed files with 229 additions and 1 deletions

View File

@@ -690,6 +690,16 @@ struct ProgressScreen {
app.buttons["progress.sport.\(sport)"]
}
var seeAllGamesHistoryButton: XCUIElement {
// NavigationLink may render as button or other element on iOS 26
let byIdentifier = app.buttons["progress.seeAllGamesHistory"]
if byIdentifier.exists { return byIdentifier }
// Fallback: match by label text
return app.buttons.matching(NSPredicate(
format: "label CONTAINS[c] 'See All'"
)).firstMatch
}
// MARK: Actions
@discardableResult
@@ -701,6 +711,13 @@ struct ProgressScreen {
return self
}
/// Opens the "Add Visit" menu and taps "Manual Entry".
func tapAddManualVisit() {
addVisitButton.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
let manualEntry = app.buttons["Manual Entry"]
manualEntry.waitUntilHittable(timeout: BaseUITestCase.shortTimeout).tap()
}
// MARK: Assertions
func assertLoaded() {
@@ -716,6 +733,92 @@ struct ProgressScreen {
}
}
// MARK: - Stadium Visit Sheet Screen
struct StadiumVisitSheetScreen {
let app: XCUIApplication
// MARK: Elements
var navigationBar: XCUIElement {
app.navigationBars["Log Visit"]
}
var saveButton: XCUIElement {
app.buttons["visitSheet.saveButton"]
}
var cancelButton: XCUIElement {
navigationBar.buttons["Cancel"]
}
var stadiumButton: XCUIElement {
app.buttons["visitSheet.stadiumButton"]
}
// MARK: Actions
@discardableResult
func waitForLoad() -> StadiumVisitSheetScreen {
navigationBar.waitForExistenceOrFail(
timeout: BaseUITestCase.defaultTimeout,
"Log Visit sheet should appear"
)
return self
}
/// Opens the stadium picker and selects the first stadium in the list.
func pickFirstStadium() {
stadiumButton.waitUntilHittable().tap()
// Wait for picker to appear
let pickerNav = app.navigationBars["Select Stadium"]
pickerNav.waitForExistenceOrFail(
timeout: BaseUITestCase.defaultTimeout,
"Stadium picker should appear"
)
// Tap the first stadium row
let firstRow = app.buttons["stadiumPicker.stadiumRow"].firstMatch
firstRow.waitUntilHittable(timeout: BaseUITestCase.defaultTimeout).tap()
}
func tapSave() {
saveButton.waitUntilHittable().tap()
}
func tapCancel() {
cancelButton.waitUntilHittable().tap()
}
}
// MARK: - Games History Screen
struct GamesHistoryScreen {
let app: XCUIApplication
// MARK: Elements
var navigationBar: XCUIElement {
app.navigationBars["Games Attended"]
}
var emptyStateText: XCUIElement {
app.staticTexts["No games recorded yet"]
}
// MARK: Actions
@discardableResult
func waitForLoad() -> GamesHistoryScreen {
navigationBar.waitForExistenceOrFail(
timeout: BaseUITestCase.defaultTimeout,
"Games History should load"
)
return self
}
}
// MARK: - Polls Screen
struct PollsScreen {