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:
@@ -106,8 +106,8 @@ final class CartCheckoutFlowTests: XCTestCase {
|
|||||||
app.swipeDown()
|
app.swipeDown()
|
||||||
}
|
}
|
||||||
if app.staticTexts["Finalizar Pedido"].waitForExistence(timeout: 10) == false {
|
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"
|
print("=== Never returned to Checkout after Alterar dismiss - accessibility hierarchy ===")
|
||||||
try? app.screenshot().pngRepresentation.write(to: URL(fileURLWithPath: "\(dir)/after_alterar_dismiss.png"))
|
print(app.debugDescription)
|
||||||
}
|
}
|
||||||
XCTAssertTrue(app.staticTexts["Finalizar Pedido"].exists, "Never returned to Checkout")
|
XCTAssertTrue(app.staticTexts["Finalizar Pedido"].exists, "Never returned to Checkout")
|
||||||
|
|
||||||
@@ -180,8 +180,8 @@ final class CartCheckoutFlowTests: XCTestCase {
|
|||||||
// a plain static text.
|
// a plain static text.
|
||||||
let storeCard = app.buttons.matching(NSPredicate(format: "label CONTAINS[c] %@", "MARIBA")).firstMatch
|
let storeCard = app.buttons.matching(NSPredicate(format: "label CONTAINS[c] %@", "MARIBA")).firstMatch
|
||||||
if storeCard.waitForExistence(timeout: 15) == false {
|
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"
|
print("=== No MARIBA store card on Home - accessibility hierarchy ===")
|
||||||
try? app.screenshot().pngRepresentation.write(to: URL(fileURLWithPath: "\(dir)/no_store_card.png"))
|
print(app.debugDescription)
|
||||||
}
|
}
|
||||||
XCTAssertTrue(storeCard.exists, "Expected store card never appeared on Home")
|
XCTAssertTrue(storeCard.exists, "Expected store card never appeared on Home")
|
||||||
storeCard.tap()
|
storeCard.tap()
|
||||||
@@ -201,8 +201,15 @@ final class CartCheckoutFlowTests: XCTestCase {
|
|||||||
// directly instead - same fix pattern as the cart-tab icon.
|
// directly instead - same fix pattern as the cart-tab icon.
|
||||||
let addButton = app.images.matching(identifier: "plus").firstMatch
|
let addButton = app.images.matching(identifier: "plus").firstMatch
|
||||||
if addButton.waitForExistence(timeout: 25) == false {
|
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"
|
// A hardcoded scratch-path screenshot write here was silently
|
||||||
try? app.screenshot().pngRepresentation.write(to: URL(fileURLWithPath: "\(dir)/store_detail_timeout40.png"))
|
// 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")
|
XCTAssertTrue(addButton.exists, "Store Detail's product list never loaded")
|
||||||
addButton.tap()
|
addButton.tap()
|
||||||
|
|||||||
Reference in New Issue
Block a user