test(uitests): replace broken scratch-path screenshots with debugDescription dumps

All three failure-path screenshot saves in this file wrote to a
hardcoded path from a different machine/session
(/private/tmp/claude-501/-Users-loverde-co-.../scratchpad), which
doesn't exist under the Mac mini runner's user account - try? silently
swallowed the write failure, so no diagnostic evidence was actually
produced on CI failures.

Replaced with app.debugDescription printed to stdout, which lands
directly in the CI log with no extra file access needed - same
technique already used in
decisions/2026-08-06-ui-test-account-and-app-attest-bypass.md. Next
CartCheckoutFlowTests failure will show the actual accessibility
hierarchy at the point of timeout.
This commit is contained in:
2026-09-11 10:21:43 -03:00
parent 238b2ac7ba
commit 1a7d5c3d51

View File

@@ -106,8 +106,8 @@ final class CartCheckoutFlowTests: XCTestCase {
app.swipeDown()
}
if app.staticTexts["Finalizar Pedido"].waitForExistence(timeout: 10) == false {
let dir = "/private/tmp/claude-501/-Users-loverde-co-Documents-Loverde-JOBs-Producao-Loverde-Co-LC-RAG-Struct-projects-PediFoods-ios/4a9ec4f7-c3ad-4cf5-8dad-073446f6fd81/scratchpad"
try? app.screenshot().pngRepresentation.write(to: URL(fileURLWithPath: "\(dir)/after_alterar_dismiss.png"))
print("=== Never returned to Checkout after Alterar dismiss - accessibility hierarchy ===")
print(app.debugDescription)
}
XCTAssertTrue(app.staticTexts["Finalizar Pedido"].exists, "Never returned to Checkout")
@@ -180,8 +180,8 @@ final class CartCheckoutFlowTests: XCTestCase {
// a plain static text.
let storeCard = app.buttons.matching(NSPredicate(format: "label CONTAINS[c] %@", "MARIBA")).firstMatch
if storeCard.waitForExistence(timeout: 15) == false {
let dir = "/private/tmp/claude-501/-Users-loverde-co-Documents-Loverde-JOBs-Producao-Loverde-Co-LC-RAG-Struct-projects-PediFoods-ios/4a9ec4f7-c3ad-4cf5-8dad-073446f6fd81/scratchpad"
try? app.screenshot().pngRepresentation.write(to: URL(fileURLWithPath: "\(dir)/no_store_card.png"))
print("=== No MARIBA store card on Home - accessibility hierarchy ===")
print(app.debugDescription)
}
XCTAssertTrue(storeCard.exists, "Expected store card never appeared on Home")
storeCard.tap()
@@ -201,8 +201,15 @@ final class CartCheckoutFlowTests: XCTestCase {
// directly instead - same fix pattern as the cart-tab icon.
let addButton = app.images.matching(identifier: "plus").firstMatch
if addButton.waitForExistence(timeout: 25) == false {
let dir = "/private/tmp/claude-501/-Users-loverde-co-Documents-Loverde-JOBs-Producao-Loverde-Co-LC-RAG-Struct-projects-PediFoods-ios/4a9ec4f7-c3ad-4cf5-8dad-073446f6fd81/scratchpad"
try? app.screenshot().pngRepresentation.write(to: URL(fileURLWithPath: "\(dir)/store_detail_timeout40.png"))
// A hardcoded scratch-path screenshot write here was silently
// no-oping on the CI runner (try? swallowed a write failure
// into a directory that doesn't exist on this machine's user
// account) - printing the accessibility hierarchy instead
// shows up directly in the CI log with no extra file access
// needed, same technique already used in
// decisions/2026-08-06-ui-test-account-and-app-attest-bypass.md.
print("=== Store Detail timeout - accessibility hierarchy ===")
print(app.debugDescription)
}
XCTAssertTrue(addButton.exists, "Store Detail's product list never loaded")
addButton.tap()