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:
@@ -35,14 +35,25 @@ final class IconPackTests: BaseUITestCase {
|
||||
|
||||
for pack in allIconPacks {
|
||||
let button = app.buttons["customize_iconpack_\(pack)"]
|
||||
if !button.exists {
|
||||
// Icon packs may be in a horizontal scroll — try swipe left first
|
||||
|
||||
// Icon packs are in a horizontal scroll view.
|
||||
// Try multiple scroll strategies to find the button.
|
||||
if !button.waitForExistence(timeout: 2) {
|
||||
// Try swiping left in the horizontal scroll area
|
||||
app.swipeLeft()
|
||||
}
|
||||
if !button.exists {
|
||||
// If still not found, try scrolling the page down
|
||||
if !button.waitForExistence(timeout: 1) {
|
||||
app.swipeLeft()
|
||||
}
|
||||
if !button.waitForExistence(timeout: 1) {
|
||||
// Try scrolling the page down to reveal the icon pack section
|
||||
app.swipeUp()
|
||||
}
|
||||
if !button.waitForExistence(timeout: 1) {
|
||||
// Try swiping left again after scrolling down
|
||||
app.swipeLeft()
|
||||
}
|
||||
|
||||
if button.waitForExistence(timeout: 3) {
|
||||
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user