Fix remaining 9 UI test failures: subscription state, scroll, timing
- Replace removePersistentDomain with key-by-key removal in resetAppState (removePersistentDomain is unreliable on app group UserDefaults suites) - Add explicit cache clearing in IAPManager.resetForTesting() to prevent stale cachedSubscriptionExpiration from restoring .subscribed state - Use descendants(matching: .any) for upgrade_banner and subscribe_button queries (VStack may not match otherElements in SwiftUI) - Add multiple swipe attempts for icon pack horizontal scroll - Use coordinate-based drag for onboarding paged TabView advancement - Add longer wait for Day view refresh after theme change - Add multiple scroll attempts to find clear data button in Settings Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -132,9 +132,13 @@ final class OnboardingTests: BaseUITestCase {
|
||||
}
|
||||
|
||||
/// Swipe left with a brief wait for the page transition to settle.
|
||||
/// Uses a coordinate-based swipe for more reliable page advancement in paged TabView.
|
||||
private func swipeAndWait() {
|
||||
app.swipeLeft()
|
||||
// Use a wide swipe from right to left for reliable page advancement
|
||||
let start = app.coordinate(withNormalizedOffset: CGVector(dx: 0.85, dy: 0.5))
|
||||
let end = app.coordinate(withNormalizedOffset: CGVector(dx: 0.15, dy: 0.5))
|
||||
start.press(forDuration: 0.05, thenDragTo: end)
|
||||
// Allow the paged TabView animation to settle
|
||||
_ = app.waitForExistence(timeout: 0.5)
|
||||
_ = app.waitForExistence(timeout: 1.0)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user