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:
@@ -111,14 +111,20 @@ final class AppThemeTests: BaseUITestCase {
|
||||
app.swipeDown()
|
||||
}
|
||||
|
||||
// Wait for sheet dismissal to complete
|
||||
_ = app.waitForExistence(timeout: 1.0)
|
||||
|
||||
// Navigate to Day tab and verify no crash — entry row should still exist
|
||||
tabBar.tapDay()
|
||||
|
||||
// Wait for Day view to fully load after theme change
|
||||
let entryRow = app.descendants(matching: .any)
|
||||
.matching(NSPredicate(format: "identifier BEGINSWITH %@", "entry_row_"))
|
||||
.firstMatch
|
||||
|
||||
// Theme changes may cause view re-renders; give extra time
|
||||
XCTAssertTrue(
|
||||
entryRow.waitForExistence(timeout: 5),
|
||||
entryRow.waitForExistence(timeout: 10),
|
||||
"Entry row should still be visible after applying themes (no crash)"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user