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:
@@ -45,6 +45,30 @@ class BaseScreen {
|
||||
return element
|
||||
}
|
||||
|
||||
/// Waits until a condition evaluates to true, polling every 0.5s.
|
||||
/// More flexible than element-based waits for complex state checks.
|
||||
func waitForCondition(
|
||||
_ description: String,
|
||||
timeout: TimeInterval? = nil,
|
||||
condition: () -> Bool
|
||||
) -> Bool {
|
||||
let t = timeout ?? self.timeout
|
||||
let deadline = Date().addingTimeInterval(t)
|
||||
while Date() < deadline {
|
||||
if condition() { return true }
|
||||
RunLoop.current.run(until: Date().addingTimeInterval(0.5))
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/// Waits for an element to exist, then taps it. Convenience for the common wait+tap pattern.
|
||||
@discardableResult
|
||||
func tapElement(_ element: XCUIElement, timeout: TimeInterval? = nil) -> XCUIElement {
|
||||
waitForElement(element, timeout: timeout)
|
||||
element.tap()
|
||||
return element
|
||||
}
|
||||
|
||||
// MARK: - State Assertions
|
||||
|
||||
/// Asserts that an element with the given accessibility identifier exists.
|
||||
|
||||
Reference in New Issue
Block a user