import XCTest /// Covers the Profile tab's logged-out state (`ProfileLoggedOutView`) - /// confirmed reachable. Actually logging in is blocked by a separate /// navigation issue in LoginView's entry-reveal animation, documented in /// decisions/2026-08-06-ui-test-account-and-app-attest-bypass.md - not /// covered here. final class ProfileLoggedOutFlowTests: XCTestCase { override func setUpWithError() throws { continueAfterFailure = false } func testLoggedOutProfileShowsLoginPrompt() throws { let app = XCUIApplication() app.launch() XCTAssertTrue(app.reachLoggedOutProfile(), "Never reached the logged-out profile screen") XCTAssertTrue(app.staticTexts["Entre na sua conta"].exists) XCTAssertTrue(app.staticTexts["Faça login ou cadastre-se para ver seu perfil, pedidos e endereços."].exists) XCTAssertTrue(app.buttons["Entrar ou Cadastrar"].isHittable) } func testTappingLoginButtonDoesNotCrash() throws { let app = XCUIApplication() app.launch() XCTAssertTrue(app.reachLoggedOutProfile()) app.buttons["Entrar ou Cadastrar"].tap() sleep(2) // Known limitation (see decisions doc): the login screen's entry // animation doesn't reliably reveal when navigating here from an // already-running guest session, so this only asserts the app is // still alive and responsive, not that login itself completes. XCTAssertEqual(app.state, .runningForeground) } }