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,25 +32,26 @@ struct CustomizeScreen {
|
||||
|
||||
func selectTheme(_ name: String) {
|
||||
let button = themeButton(named: name)
|
||||
button.tapWhenReady()
|
||||
_ = button.waitForExistence(timeout: 5)
|
||||
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
}
|
||||
|
||||
func selectVotingLayout(_ name: String) {
|
||||
let button = votingLayoutButton(named: name)
|
||||
// May need to scroll horizontally to find it
|
||||
if !button.isHittable {
|
||||
if button.exists && !button.isHittable {
|
||||
app.swipeLeft()
|
||||
}
|
||||
button.tapWhenReady()
|
||||
_ = button.waitForExistence(timeout: 5)
|
||||
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
}
|
||||
|
||||
func selectDayViewStyle(_ name: String) {
|
||||
let button = dayViewStyleButton(named: name)
|
||||
// May need to scroll horizontally to find it
|
||||
if !button.isHittable {
|
||||
if button.exists && !button.isHittable {
|
||||
app.swipeLeft()
|
||||
}
|
||||
button.tapWhenReady()
|
||||
_ = button.waitForExistence(timeout: 5)
|
||||
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
}
|
||||
|
||||
// MARK: - Assertions
|
||||
|
||||
@@ -33,11 +33,11 @@ struct DayScreen {
|
||||
/// Tap a mood button by mood name. Waits for the celebration animation to complete.
|
||||
func logMood(_ mood: MoodChoice, file: StaticString = #file, line: UInt = #line) {
|
||||
let button = moodButton(for: mood)
|
||||
guard button.waitUntilHittable(timeout: 5) else {
|
||||
XCTFail("Mood button '\(mood.rawValue)' not hittable", file: file, line: line)
|
||||
guard button.waitForExistence(timeout: 5) else {
|
||||
XCTFail("Mood button '\(mood.rawValue)' not found", file: file, line: line)
|
||||
return
|
||||
}
|
||||
button.tap()
|
||||
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
|
||||
// Wait for the celebration animation to finish and entry to appear.
|
||||
// The mood header disappears after logging today's mood.
|
||||
|
||||
@@ -26,20 +26,26 @@ struct EntryDetailScreen {
|
||||
// MARK: - Actions
|
||||
|
||||
func dismiss() {
|
||||
doneButton.tapWhenReady()
|
||||
let button = doneButton
|
||||
_ = button.waitForExistence(timeout: 5)
|
||||
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
}
|
||||
|
||||
func selectMood(_ mood: MoodChoice) {
|
||||
let button = moodButton(for: mood)
|
||||
button.tapWhenReady()
|
||||
_ = button.waitForExistence(timeout: 5)
|
||||
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
}
|
||||
|
||||
func deleteEntry() {
|
||||
deleteButton.tapWhenReady()
|
||||
let button = deleteButton
|
||||
_ = button.waitForExistence(timeout: 5)
|
||||
button.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
// Confirm the delete alert
|
||||
let deleteAlert = app.alerts["Delete Entry"]
|
||||
let confirmButton = deleteAlert.buttons["Delete"]
|
||||
confirmButton.tapWhenReady()
|
||||
_ = confirmButton.waitForExistence(timeout: 5)
|
||||
confirmButton.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
|
||||
}
|
||||
|
||||
// MARK: - Assertions
|
||||
|
||||
Reference in New Issue
Block a user