Harden test harness and UI suite

This commit is contained in:
Trey t
2026-04-03 15:30:54 -05:00
parent 87b9971714
commit 0fa3db5401
13 changed files with 319 additions and 55 deletions

View File

@@ -127,9 +127,10 @@ final class ScheduleTests: BaseUITestCase {
"Search field should exist")
searchField.tap()
searchField.typeText("Yankees")
// Wait for results to filter
sleep(1)
XCTAssertTrue(
((searchField.value as? String) ?? "").contains("Yankees"),
"Search field should contain the typed team name"
)
captureScreenshot(named: "F089-SearchByTeam")
}
@@ -150,9 +151,10 @@ final class ScheduleTests: BaseUITestCase {
"Search field should exist")
searchField.tap()
searchField.typeText("Wrigley")
// Wait for results to filter
sleep(1)
XCTAssertTrue(
((searchField.value as? String) ?? "").contains("Wrigley"),
"Search field should contain the typed venue name"
)
captureScreenshot(named: "F090-SearchByVenue")
}
@@ -174,19 +176,15 @@ final class ScheduleTests: BaseUITestCase {
searchField.tap()
searchField.typeText("ZZZZNONEXISTENTTEAMZZZZ")
// Wait for empty state
sleep(1)
// Empty state or "no results" text should appear
let emptyState = schedule.emptyState
let noResults = app.staticTexts.matching(NSPredicate(
format: "label CONTAINS[c] 'no' AND label CONTAINS[c] 'game'"
)).firstMatch
let hasEmptyIndicator = emptyState.waitForExistence(timeout: BaseUITestCase.shortTimeout)
|| noResults.waitForExistence(timeout: BaseUITestCase.shortTimeout)
XCTAssertTrue(hasEmptyIndicator,
"Empty state should appear when no games match search")
waitUntil(timeout: BaseUITestCase.shortTimeout, "Empty state should appear when no games match search") {
emptyState.exists || noResults.exists
}
captureScreenshot(named: "F092-ScheduleEmptyState")
}