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

@@ -12,14 +12,16 @@ struct OnboardingScreen {
// MARK: - Screen Elements
var welcomeScreen: XCUIElement { app.otherElements["onboarding_welcome"] }
var dayScreen: XCUIElement { app.otherElements["onboarding_day"] }
var subscriptionScreen: XCUIElement { app.otherElements["onboarding_subscription"] }
var welcomeScreen: XCUIElement { app.element(UITestID.Onboarding.welcome) }
var timeScreen: XCUIElement { app.element(UITestID.Onboarding.time) }
var dayScreen: XCUIElement { app.element(UITestID.Onboarding.day) }
var styleScreen: XCUIElement { app.element(UITestID.Onboarding.style) }
var subscriptionScreen: XCUIElement { app.element(UITestID.Onboarding.subscription) }
var dayTodayButton: XCUIElement { app.buttons.matching(NSPredicate(format: "identifier == %@", "onboarding_day_today")).firstMatch }
var dayYesterdayButton: XCUIElement { app.buttons.matching(NSPredicate(format: "identifier == %@", "onboarding_day_yesterday")).firstMatch }
var subscribeButton: XCUIElement { app.buttons.matching(NSPredicate(format: "identifier == %@", "onboarding_subscribe_button")).firstMatch }
var skipButton: XCUIElement { app.buttons.matching(NSPredicate(format: "identifier == %@", "onboarding_skip_button")).firstMatch }
var dayTodayButton: XCUIElement { app.element(UITestID.Onboarding.dayToday) }
var dayYesterdayButton: XCUIElement { app.element(UITestID.Onboarding.dayYesterday) }
var subscribeButton: XCUIElement { app.element(UITestID.Onboarding.subscribe) }
var skipButton: XCUIElement { app.element(UITestID.Onboarding.skip) }
// MARK: - Actions
@@ -41,7 +43,7 @@ struct OnboardingScreen {
// Day -> select Today, then swipe
if dayTodayButton.waitForExistence(timeout: 3) {
dayTodayButton.tap()
dayTodayButton.tapWhenReady()
}
swipeToNext()
@@ -50,7 +52,7 @@ struct OnboardingScreen {
// Subscription -> tap "Maybe Later"
if skipButton.waitForExistence(timeout: 5) {
skipButton.tap()
skipButton.tapWhenReady()
}
}