Rewrite all UI tests following fail-fast TEST_RULES patterns

Rewrote 60+ test files to follow honeydue-style test guidelines:
- defaultTimeout=2s, navigationTimeout=5s — fail fast, no long waits
- No coordinate taps (except onboarding paged TabView swipes)
- No sleep(), no retry loops
- No guard...else { return } silent passes — XCTFail everywhere
- All elements by accessibility ID via UITestID constants
- Screen objects for all navigation/actions/assertions
- One logical assertion per test method

Added missing accessibility identifiers to app views:
- MonthView.swift: added AccessibilityID.MonthView.grid to ScrollView
- YearView.swift: added AccessibilityID.YearView.heatmap to ScrollView

Framework rewrites:
- BaseUITestCase: added session ID, localeArguments, extraLaunchArguments
- WaitHelpers: waitForExistenceOrFail, waitUntilHittableOrFail,
  waitForNonExistence, scrollIntoView, forceTap
- All 7 screen objects rewritten with fail-fast semantics
- TEST_RULES.md added with non-negotiable rules

Known remaining issues:
- OnboardingTests: paged TabView swipes unreliable on iOS 26 simulator
- SettingsLegalLinksTests: EULA/Privacy buttons too deep in DEBUG scroll
- Customization horizontal picker scrolling needs further tuning

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trey T
2026-03-24 17:00:30 -05:00
parent 2ef1c1ec51
commit d97db4910e
70 changed files with 1609 additions and 1874 deletions

View File

@@ -12,47 +12,33 @@ final class LongTranslationTests: BaseUITestCase {
override var bypassSubscription: Bool { true }
override var localeArguments: [String] { ["-AppleLanguages", "(de)", "-AppleLocale", "de_DE"] }
/// TC-138: German locale with long compound words renders without crashes.
/// Navigates through all tabs to ensure no layout truncation causes issues.
/// TC-138: German locale navigates all tabs without layout crash.
func testLongTranslations_GermanLocale_NoLayoutCrash() {
// Day tab should load
let tabBar = app.tabBars.firstMatch
XCTAssertTrue(tabBar.waitForExistence(timeout: 5), "Tab bar should exist")
let tabBar = TabBarScreen(app: app)
tabBar.assertVisible()
captureScreenshot(name: "german_long_day")
// Navigate to Month view
let monthTab = app.tabBars.buttons.element(boundBy: 1)
monthTab.tap()
_ = app.waitForExistence(timeout: 2)
// Navigate through tabs using accessibility IDs (locale-independent)
tabBar.tapMonth()
let monthGrid = app.element(UITestID.Month.grid)
monthGrid.waitForExistenceOrFail(
timeout: navigationTimeout,
message: "Month grid should render in German locale"
)
captureScreenshot(name: "german_long_month")
// Navigate to Year view
let yearTab = app.tabBars.buttons.element(boundBy: 2)
yearTab.tap()
_ = app.waitForExistence(timeout: 2)
tabBar.tapYear()
let heatmap = app.element(UITestID.Year.heatmap)
heatmap.waitForExistenceOrFail(
timeout: navigationTimeout,
message: "Year heatmap should render in German locale"
)
captureScreenshot(name: "german_long_year")
// Navigate to Settings
let settingsTab = app.tabBars.buttons.element(boundBy: 4)
settingsTab.tap()
let settingsHeader = app.element(UITestID.Settings.header)
XCTAssertTrue(
settingsHeader.waitForExistence(timeout: 5),
"Settings header should be visible in German locale"
)
let settingsScreen = tabBar.tapSettings()
settingsScreen.assertVisible()
captureScreenshot(name: "german_long_settings")
// Verify no truncation indicators ("..." / ellipsis) in key labels
// Check that "Einstellungen" (Settings) text is fully rendered
let einstellungenText = app.staticTexts.matching(
NSPredicate(format: "label == %@", "Einstellungen")
).firstMatch
XCTAssertTrue(
einstellungenText.waitForExistence(timeout: 3),
"Full German 'Einstellungen' text should be visible (not truncated)"
)
}
}