Skip to content

Deflake testRefreshEndpointUsingCashAppPay 🪿✨ - #6862

Open
joyceqin-stripe wants to merge 4 commits into
masterfrom
joyceqin/stabilize-flaky-test-refreshendpoint
Open

Deflake testRefreshEndpointUsingCashAppPay 🪿✨#6862
joyceqin-stripe wants to merge 4 commits into
masterfrom
joyceqin/stabilize-flaky-test-refreshendpoint

Conversation

@joyceqin-stripe

@joyceqin-stripe joyceqin-stripe commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Minion run

Summary

Changed from waitForExistenceAndTap to tap because waitForExistenceAndTap didn't fully scroll to tap "Cash App", while just tap did. We also were already guaranteed its existence in the guard, so I think that's safe

Add .firstMatch when querying the "Close" button inside TopBrowserBar in testRefreshEndpointUsingCashAppPay.

Motivation

The XCUI query app.otherElements["TopBrowserBar"].buttons["Close"] was matching two elements — one Button directly inside TopBrowserBar and a second nested Button within another Button — causing the test to fail intermittently with:

Failed to tap "Close" Button: Find single matching element. Multiple matching elements found.

Using .firstMatch resolves the ambiguity by always selecting the outermost "Close" button.

Testing

Ran locally 50x

Changelog

N/A

…rBar

The TopBrowserBar can contain multiple elements labeled 'Close', causing
the test to fail with 'Multiple matching elements found'. Using firstMatch
ensures we tap the first (outermost) Close button unambiguously.

Committed-By-Agent: goose
@joyceqin-stripe joyceqin-stripe changed the title Fix flaky test: use firstMatch for Close button in TopBrowserBar 🪿✨ Deflake testRefreshEndpointUsingCashAppPay 🪿✨ Aug 6, 2026
@joyceqin-stripe
joyceqin-stripe marked this pull request as ready for review August 7, 2026 15:52
@joyceqin-stripe
joyceqin-stripe requested review from a team as code owners August 7, 2026 15:52
@joyceqin-stripe
joyceqin-stripe enabled auto-merge (squash) August 7, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant