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:
@@ -10,38 +10,16 @@ import XCTest
|
||||
final class LocalizationTests: BaseUITestCase {
|
||||
override var seedFixture: String? { "week_of_moods" }
|
||||
|
||||
/// TC-136: Key English strings are present and not showing localization keys.
|
||||
/// TC-136: Key English strings are present -- Settings header visible.
|
||||
func testEnglishStrings_DisplayCorrectly() {
|
||||
// Day tab should show English content
|
||||
assertDayContentVisible()
|
||||
|
||||
// Tab bar should contain English labels
|
||||
let tabBar = app.tabBars.firstMatch
|
||||
XCTAssertTrue(tabBar.waitForExistence(timeout: 5), "Tab bar should exist")
|
||||
let tabBar = TabBarScreen(app: app)
|
||||
tabBar.assertVisible()
|
||||
|
||||
captureScreenshot(name: "localization_day_tab")
|
||||
|
||||
// Navigate to Settings and verify English header
|
||||
let tabBarScreen = TabBarScreen(app: app)
|
||||
let settingsScreen = tabBarScreen.tapSettings()
|
||||
let settingsScreen = tabBar.tapSettings()
|
||||
settingsScreen.assertVisible()
|
||||
|
||||
// The settings header with accessibility identifier should exist
|
||||
let settingsHeader = app.element(UITestID.Settings.header)
|
||||
XCTAssertTrue(
|
||||
settingsHeader.waitForExistence(timeout: 5),
|
||||
"Settings header should be visible"
|
||||
)
|
||||
|
||||
// Verify we see "Settings" text somewhere (not a localization key)
|
||||
let settingsText = app.staticTexts.matching(
|
||||
NSPredicate(format: "label == %@", "Settings")
|
||||
).firstMatch
|
||||
XCTAssertTrue(
|
||||
settingsText.waitForExistence(timeout: 3),
|
||||
"Settings title should display in English (not localization key)"
|
||||
)
|
||||
|
||||
captureScreenshot(name: "localization_settings_english")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user