Fix remaining 17 UI test failures: group defaults, identifiers, hittability, date format
- resetAppState: use correct suite name to clear group defaults (fixes stale subscription state) - Reorder configureIfNeeded: set expireTrial before IAPManager init - Add browse_themes_button identifier to CustomizeView Browse Themes button - Add mood_button_* identifiers to Entry Detail mood grid in NoteEditorView - Use coordinate-based tap throughout all test screens (iOS 26 Liquid Glass hittability) - Fix HeaderMoodLogging date format: M/d/yyyy → yyyy/MM/dd to match entry_row identifiers - AppLaunchTests: wait for isSelected state with NSPredicate instead of immediate check - OnboardingTests: add waits between swipes and retry logic for skip button Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ final class AppThemeTests: BaseUITestCase {
|
||||
browseButton.waitForExistence(timeout: 5),
|
||||
"Browse Themes button should exist"
|
||||
)
|
||||
browseButton.tapWhenReady()
|
||||
browseButton.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
|
||||
// Wait for the themes sheet to appear
|
||||
// Look for any theme card as an indicator that the sheet loaded
|
||||
@@ -69,7 +69,9 @@ final class AppThemeTests: BaseUITestCase {
|
||||
settingsScreen.assertVisible()
|
||||
|
||||
// Open Browse Themes sheet
|
||||
settingsScreen.browseThemesButton.tapWhenReady()
|
||||
let browseBtn = settingsScreen.browseThemesButton
|
||||
_ = browseBtn.waitForExistence(timeout: 5)
|
||||
browseBtn.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
|
||||
// Wait for sheet to load
|
||||
let firstCard = app.descendants(matching: .any)
|
||||
@@ -87,13 +89,13 @@ final class AppThemeTests: BaseUITestCase {
|
||||
app.swipeUp()
|
||||
}
|
||||
if card.waitForExistence(timeout: 3) {
|
||||
card.tapWhenReady()
|
||||
card.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
|
||||
// A preview sheet or confirmation may appear — dismiss it
|
||||
// Look for an "Apply" or close button and tap if present
|
||||
let applyButton = app.buttons["Apply"]
|
||||
if applyButton.waitForExistence(timeout: 2) {
|
||||
applyButton.tapWhenReady()
|
||||
applyButton.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +105,7 @@ final class AppThemeTests: BaseUITestCase {
|
||||
// Dismiss the themes sheet by swiping down or tapping Done
|
||||
let doneButton = app.buttons["Done"]
|
||||
if doneButton.waitForExistence(timeout: 2) {
|
||||
doneButton.tapWhenReady()
|
||||
doneButton.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
} else {
|
||||
// Swipe down to dismiss the sheet
|
||||
app.swipeDown()
|
||||
|
||||
Reference in New Issue
Block a user