-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: flaky test ERC721 NFTs testdapp interaction should prompt users to add their NFTs to their wallet (all at once)
#27889
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
css: '[data-testid="activity-list-item-action"]', | ||
text: 'Deposit', | ||
}); | ||
assert.equal(await transactionItem.isDisplayed(), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this causes the race condition, as we are asserting an element that it doesn't exist anymore as it has been updated
Quality Gate passedIssues Measures |
Builds ready [5bfd3a8]
Page Load Metrics (2102 ± 186 ms)
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
Description
The problem is that we are looking for the Deposit transaction by its text in the activity tab, but this element updates its state, from
pending
toconfirm
, meaning that it can become stale when we do the assertion after (see video).To mitigate this problem, we wait until the transaction is confirmed, and then look for the Deposit tx.
This not only fixes the race condition, but it also ensures that the tx is successful.
Related issues
Fixes: #26759
Manual testing steps
Screenshots/Recordings
stale-element-activity.mp4
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist