fix(uitests): stop logging out after every authenticated test
All 7 authenticated-flow XCTestCase classes logged out for real in tearDown, forcing a real OTP round trip against the production backend on the next authenticated test. Under CI's back-to-back suite run this produced ~9 real logins to the same QA phone number in ~9 minutes - the first few succeeded (~30-40s each) but every one after that failed to complete within timeout, cascading into 'Login never completed' across CartCheckoutFlowTests, HomeFiltersFlowTests, OrderDetailsFlowTests, SavedCardsFlowTests, UserProfileFlowTests. Removed the per-test logout so the QA account's Keychain-backed session persists across the whole suite (ensureLoggedIn already no-ops when already authenticated). Moved the 'must start logged out' guarantee to the two classes that actually need it - HomeGuestFlowTests and ProfileLoggedOutFlowTests now force logout themselves right after app.launch() via a small launch helper, instead of relying on whichever authenticated class happened to run last. See decisions/2026-09-11-ui-test-shared-login-session.md.
This commit is contained in:
@@ -2,17 +2,14 @@ import XCTest
|
||||
|
||||
/// Covers a real, authenticated session with the standing QA account (see
|
||||
/// TestFixtures.swift / decisions/2026-08-06-ui-test-account-and-app-attest-bypass.md).
|
||||
/// Logs out in tearDown so guest-only tests elsewhere in the same run don't
|
||||
/// inherit an authenticated Keychain session.
|
||||
/// No per-test logout - the Keychain session is meant to persist across
|
||||
/// authenticated-flow tests in the same run; see
|
||||
/// decisions/2026-09-11-ui-test-shared-login-session.md.
|
||||
final class AuthenticatedSessionFlowTests: XCTestCase {
|
||||
override func setUpWithError() throws {
|
||||
continueAfterFailure = false
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
XCUIApplication().logoutIfAuthenticated()
|
||||
}
|
||||
|
||||
func testLoginReachesAuthenticatedProfile() throws {
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
Reference in New Issue
Block a user