Complete re-validation remediation: KMP architecture, iOS platform, XCUITest rewrite

Phases 1-6 of fixes.md — closes all 13 issues from codex_issues_2.md re-validation:

KMP Architecture:
- Fix subscription purchase/restore response contract (VerificationResponse aligned)
- Add feature benefits auth token + APILayer init flow
- Remove ResidenceFormScreen direct API bypass (use APILayer)
- Wire paywall purchase/restore to real SubscriptionApi calls

iOS Platform:
- Add iOS Keychain token storage via Swift KeychainHelper
- Implement Google Sign-In via ASWebAuthenticationSession (GoogleSignInManager)
- DocumentViewModelWrapper observes DataManager for auto-updates
- Add missing accessibility identifiers (document, task columns, Google Sign-In)

XCUITest Rewrite:
- Rewrite test infrastructure: zero sleep() calls, accessibility ID lookups
- Create AuthCriticalPathTests and NavigationCriticalPathTests
- Delete 14 legacy brittle test files (Suite0-10, templates)
- Fix CaseraTests module import (@testable import Casera)

All platforms build clean. TEST BUILD SUCCEEDED.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-18 18:50:13 -06:00
parent 7444f73b46
commit 5e3596db77
47 changed files with 982 additions and 6075 deletions

View File

@@ -5,6 +5,8 @@ import XCTest
/// Tests that the app launches successfully, the auth screen renders correctly,
/// and core navigation is functional. These are the minimum-viability tests
/// that must pass before any PR can merge.
///
/// Zero sleep() calls all waits are condition-based.
final class SmokeTests: XCTestCase {
var app: XCUIApplication!
@@ -70,7 +72,6 @@ final class SmokeTests: XCTestCase {
func testMainTabsExistAfterLogin() {
let login = LoginScreen(app: app)
if login.emailField.waitForExistence(timeout: 15) {
// Need to login first
let user = TestFixtures.TestUser.existing
login.login(email: user.email, password: user.password)
}
@@ -81,11 +82,11 @@ final class SmokeTests: XCTestCase {
return
}
// App has 4 tabs: Residences, Tasks, Contractors, Documents
XCTAssertTrue(main.residencesTab.exists, "Residences tab should exist")
XCTAssertTrue(main.tasksTab.exists, "Tasks tab should exist")
XCTAssertTrue(main.contractorsTab.exists, "Contractors tab should exist")
XCTAssertTrue(main.documentsTab.exists, "Documents tab should exist")
XCTAssertTrue(main.profileTab.exists, "Profile tab should exist")
}
func testTabNavigation() {
@@ -111,9 +112,6 @@ final class SmokeTests: XCTestCase {
main.goToDocuments()
XCTAssertTrue(main.documentsTab.isSelected, "Documents tab should be selected")
main.goToProfile()
XCTAssertTrue(main.profileTab.isSelected, "Profile tab should be selected")
main.goToResidences()
XCTAssertTrue(main.residencesTab.isSelected, "Residences tab should be selected")
}