migration
This commit is contained in:
51
PediFoodsUITests/AuthenticatedProfileNavigationTests.swift
Normal file
51
PediFoodsUITests/AuthenticatedProfileNavigationTests.swift
Normal file
@@ -0,0 +1,51 @@
|
||||
import XCTest
|
||||
|
||||
/// Covers screens reachable directly from the authenticated Profile tab
|
||||
/// with no cart/store-browse setup needed - OrdersView and MyReviewsView
|
||||
/// both load their own data. The standing QA account has real order/review
|
||||
/// history from prior manual and automated testing, so these don't assert
|
||||
/// on empty vs. non-empty - just that the real network load completes
|
||||
/// without getting stuck. See
|
||||
/// decisions/2026-08-06-ui-test-account-and-app-attest-bypass.md for the
|
||||
/// account (`ensureLoggedIn`).
|
||||
final class AuthenticatedProfileNavigationTests: XCTestCase {
|
||||
override func setUpWithError() throws {
|
||||
continueAfterFailure = false
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
XCUIApplication().logoutIfAuthenticated()
|
||||
}
|
||||
|
||||
func testOrdersScreenReachableAndLoadsRealData() throws {
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
XCTAssertTrue(app.ensureLoggedIn(), "Login never completed")
|
||||
XCTAssertTrue(app.buttons["Sair da Conta"].waitForExistence(timeout: 10), "Never reached authenticated Profile")
|
||||
|
||||
app.staticTexts["Meus Pedidos"].tap()
|
||||
|
||||
XCTAssertTrue(app.staticTexts["Meus Pedidos"].waitForExistence(timeout: 10))
|
||||
for _ in 0..<30 {
|
||||
if app.activityIndicators.firstMatch.exists == false { break }
|
||||
usleep(500_000)
|
||||
}
|
||||
XCTAssertFalse(app.activityIndicators.firstMatch.exists, "Orders list never finished loading")
|
||||
}
|
||||
|
||||
func testReviewsScreenReachableAndLoadsRealData() throws {
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
XCTAssertTrue(app.ensureLoggedIn(), "Login never completed")
|
||||
XCTAssertTrue(app.buttons["Sair da Conta"].waitForExistence(timeout: 10), "Never reached authenticated Profile")
|
||||
|
||||
app.staticTexts["Minhas Avaliações"].tap()
|
||||
|
||||
XCTAssertTrue(app.staticTexts["Minhas Avaliações"].waitForExistence(timeout: 10))
|
||||
for _ in 0..<30 {
|
||||
if app.activityIndicators.firstMatch.exists == false { break }
|
||||
usleep(500_000)
|
||||
}
|
||||
XCTAssertFalse(app.activityIndicators.firstMatch.exists, "Reviews list never finished loading")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user