From 1a7d5c3d51a056d0234e3e561fce1664b3596394 Mon Sep 17 00:00:00 2001 From: "Developer @ Loverde Company" Date: Fri, 11 Sep 2026 10:21:43 -0300 Subject: [PATCH] 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. --- PediFoodsUITests/CartCheckoutFlowTests.swift | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/PediFoodsUITests/CartCheckoutFlowTests.swift b/PediFoodsUITests/CartCheckoutFlowTests.swift index d13cd86..a8a9497 100644 --- a/PediFoodsUITests/CartCheckoutFlowTests.swift +++ b/PediFoodsUITests/CartCheckoutFlowTests.swift @@ -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()