Rearchitect UI test suite for complete, non-flaky coverage against live API

- Migrate Suite4-10, SmokeTests, NavigationCriticalPathTests to AuthenticatedTestCase
  with seeded admin account and real backend login
- Add 34 accessibility identifiers across 11 app views (task completion, profile,
  notifications, theme, join residence, manage users, forms)
- Create FeatureCoverageTests (14 tests) covering previously untested features:
  profile edit, theme selection, notification prefs, task completion, manage users,
  join residence, task templates
- Create MultiUserSharingTests (18 API tests) and MultiUserSharingUITests (8 XCUI
  tests) for full cross-user residence sharing lifecycle
- Add cleanup infrastructure: SuiteZZ_CleanupTests auto-wipes test data after runs,
  cleanup_test_data.sh script for manual reset via admin API
- Add share code API methods to TestAccountAPIClient (generateShareCode, joinWithCode,
  getShareCode, listResidenceUsers, removeUser)
- Fix app bugs found by tests:
  - ResidencesListView join callback now uses forceRefresh:true
  - APILayer invalidates task cache when residence count changes
  - AllTasksView auto-reloads tasks when residence list changes
- Fix test quality: keyboard focus waits, Save/Add button label matching,
  Documents tab label (Docs), remove API verification from UI tests
- DataLayerTests and PasswordResetTests now verify through UI, not API calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
treyt
2026-03-15 17:32:13 -05:00
parent cf2e6d8bcc
commit 5c360a2796
57 changed files with 3781 additions and 928 deletions

View File

@@ -87,12 +87,17 @@ final class PasswordResetTests: BaseUITestCase {
returnButton.tap()
}
// Verify we can login with the new password via API
let loginResponse = TestAccountAPIClient.login(
username: session.username,
password: newPassword
)
XCTAssertNotNil(loginResponse, "Should be able to login with new password after reset")
// Verify we can login with the new password through the UI
let loginScreen = LoginScreenObject(app: app)
loginScreen.waitForLoad()
loginScreen.enterUsername(session.username)
loginScreen.enterPassword(newPassword)
let loginButton = app.buttons[UITestID.Auth.loginButton]
loginButton.waitUntilHittable(timeout: 10).tap()
let tabBar = app.tabBars.firstMatch
XCTAssertTrue(tabBar.waitForExistence(timeout: 15), "Should login successfully with new password")
}
// MARK: - AUTH-015 (alias): Verify reset code reaches the new password screen
@@ -164,12 +169,17 @@ final class PasswordResetTests: BaseUITestCase {
returnButton.tap()
}
// Confirm the new password works by logging in via the API
let loginResponse = TestAccountAPIClient.login(
username: session.username,
password: newPassword
)
XCTAssertNotNil(loginResponse, "Should be able to login with the new password after a successful reset")
// Confirm the new password works by logging in through the UI
let loginScreen = LoginScreenObject(app: app)
loginScreen.waitForLoad()
loginScreen.enterUsername(session.username)
loginScreen.enterPassword(newPassword)
let loginButton = app.buttons[UITestID.Auth.loginButton]
loginButton.waitUntilHittable(timeout: 10).tap()
let tabBar = app.tabBars.firstMatch
XCTAssertTrue(tabBar.waitForExistence(timeout: 15), "Should login successfully with new password")
}
// MARK: - AUTH-017: Mismatched passwords are blocked