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:
@@ -46,16 +46,32 @@ final class OnboardingTests: BaseUITestCase {
|
||||
swipeAndWait() // Style → Subscription
|
||||
captureScreenshot(name: "onboarding_subscription")
|
||||
|
||||
// Tap "Maybe Later" to complete onboarding
|
||||
// Find the "Maybe Later" skip button on the subscription screen.
|
||||
// Try multiple approaches in case the page transition didn't complete.
|
||||
let skipButton = app.descendants(matching: .any)
|
||||
.matching(identifier: "onboarding_skip_button")
|
||||
.firstMatch
|
||||
|
||||
// If skip button isn't visible, try one more swipe (in case a page was added)
|
||||
if !skipButton.waitForExistence(timeout: 5) {
|
||||
// If skip button isn't visible, try additional swipes
|
||||
for _ in 0..<3 {
|
||||
if skipButton.waitForExistence(timeout: 3) { break }
|
||||
swipeAndWait()
|
||||
}
|
||||
|
||||
// Also try finding by label as a fallback
|
||||
if !skipButton.exists {
|
||||
let maybeLater = app.buttons.matching(
|
||||
NSPredicate(format: "label CONTAINS[cd] %@", "Maybe Later")
|
||||
).firstMatch
|
||||
if maybeLater.waitForExistence(timeout: 3) {
|
||||
maybeLater.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
let tabBar = app.tabBars.firstMatch
|
||||
XCTAssertTrue(tabBar.waitForExistence(timeout: 10), "Tab bar should appear after onboarding")
|
||||
captureScreenshot(name: "onboarding_complete")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertTrue(
|
||||
skipButton.waitForExistence(timeout: 5),
|
||||
"Skip/Maybe Later button should exist on subscription screen"
|
||||
|
||||
Reference in New Issue
Block a user