Harden test harness and UI suite
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user