Stabilize iOS UI test foundation and fix flaky suites

This commit is contained in:
Trey t
2026-02-17 22:24:08 -06:00
parent c28d7a59eb
commit 56ac783219
38 changed files with 543 additions and 585 deletions

View File

@@ -27,35 +27,11 @@ final class AllDayViewStylesTests: BaseUITestCase {
settingsScreen.assertVisible()
settingsScreen.tapCustomizeTab()
// Try to find the style button, scrolling if needed
let button = customizeScreen.dayViewStyleButton(named: style)
if !button.waitForExistence(timeout: 2) {
for _ in 0..<5 {
app.swipeLeft()
if button.waitForExistence(timeout: 1) { break }
}
}
if button.waitForExistence(timeout: 2) {
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
}
customizeScreen.selectDayViewStyle(style)
// Navigate to Day tab and verify the app didn't crash
tabBar.tapDay()
let entryRow = app.descendants(matching: .any)
.matching(NSPredicate(format: "identifier BEGINSWITH %@", "entry_row_"))
.firstMatch
let moodHeader = app.descendants(matching: .any)
.matching(identifier: "mood_header")
.firstMatch
let entryVisible = entryRow.waitForExistence(timeout: 5)
let headerVisible = moodHeader.waitForExistence(timeout: 3)
XCTAssertTrue(
entryVisible || headerVisible,
"Day view content should be visible after switching to '\(style)' style"
)
assertDayContentVisible()
}
captureScreenshot(name: "all_day_view_styles_completed")