Fix cascading crash and remaining UI test failures
- Revert key-by-key UserDefaults iteration that removed system keys causing kAXErrorServerNotFound crashes; restore removePersistentDomain with explicit subscription key clearing - Add .accessibilityElement(children: .contain) to UpgradeBannerView so subscribe button is discoverable by XCUITest - Fix AllDayViewStylesTests to use coordinate-based tapping instead of button.isHittable/button.tap() for iOS 26 Liquid Glass compatibility - Improve OnboardingTests with multiple swipe retries and label-based fallback for skip button Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -92,12 +92,15 @@ enum UITestMode {
|
||||
/// Reset all user defaults and persisted state for a clean test run
|
||||
@MainActor
|
||||
private static func resetAppState() {
|
||||
// Clear group user defaults by iterating all keys.
|
||||
// removePersistentDomain(forName:) is unreliable on app group suites.
|
||||
let defaults = GroupUserDefaults.groupDefaults
|
||||
for key in defaults.dictionaryRepresentation().keys {
|
||||
defaults.removeObject(forKey: key)
|
||||
}
|
||||
// Clear group user defaults using the suite domain name
|
||||
defaults.removePersistentDomain(forName: Constants.currentGroupShareId)
|
||||
|
||||
// Explicitly clear subscription cache keys that may survive removePersistentDomain
|
||||
// on app group suites (known reliability issue).
|
||||
defaults.removeObject(forKey: UserDefaultsStore.Keys.cachedSubscriptionExpiration.rawValue)
|
||||
defaults.removeObject(forKey: UserDefaultsStore.Keys.hasActiveSubscription.rawValue)
|
||||
defaults.removeObject(forKey: UserDefaultsStore.Keys.firstLaunchDate.rawValue)
|
||||
|
||||
// Reset key defaults explicitly (true = fresh install state where onboarding is needed)
|
||||
defaults.set(true, forKey: UserDefaultsStore.Keys.needsOnboarding.rawValue)
|
||||
|
||||
@@ -148,6 +148,7 @@ struct UpgradeBannerView: View {
|
||||
RoundedRectangle(cornerRadius: 14)
|
||||
.fill(colorScheme == .dark ? Color(.systemGray6) : Color(.systemGray6).opacity(0.5))
|
||||
)
|
||||
.accessibilityElement(children: .contain)
|
||||
.accessibilityIdentifier(AccessibilityID.Settings.upgradeBanner)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user