fix(uitests): give the product add button an explicit accessibility identifier

quickDiagnostics finally showed the real state at the timeout: Store
Detail had genuinely loaded (store header, category tabs, a real priced
product 'Alcatra' R$ 14,00 all visible) - 'product list never loaded'
was simply the wrong diagnosis. The test was matching
app.images.matching(identifier: "plus") against the product row's add
button, relying entirely on SF Symbol systemName being exposed as an
implicit accessibility identifier - which wasn't holding on this Xcode
26/iOS 26 CI environment, and is inherently ambiguous anyway since
CartView's own quantity stepper reuses the same "plus" systemName.

Added a real .accessibilityIdentifier("storeDetailProductAddButton")
to the product row's add Button in StoreDetailView+Components.swift (an
app-source change, not just a test workaround), and updated the test to
match on that instead.

See decisions/2026-09-11-ui-test-shared-login-session.md follow-up.
This commit is contained in:
2026-09-11 11:14:08 -03:00
parent ea6a3da78b
commit 2ebe97e078
2 changed files with 19 additions and 14 deletions

View File

@@ -345,6 +345,11 @@ extension StoreDetailView {
.disabled(isStoreOpen == false)
.opacity(isStoreOpen ? 1 : 0.65)
.offset(x: 7, y: 7)
// Explicit, unique identifier for UI tests - the inner
// "plus" SF Symbol's implicit/auto-generated identifier is
// ambiguous (the same systemName is reused for CartView's
// quantity stepper) and unreliable to match against.
.accessibilityIdentifier("storeDetailProductAddButton")
}
}
.padding(12)