-
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 BTC Account - Overview has portfolio button enabled for BTC accounts
#27017
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. |
Quality Gate passedIssues Measures |
|
||
const portfolioButton = await driver.waitForSelector( | ||
// receive button | ||
await driver.findClickableElement( | ||
'[data-testid="coin-overview-receive"]', |
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.
extra note: the name of the const is miss-leading, as this is not the portfolio link but the receive button
Builds ready [aa6a10c]
Page Load Metrics (1757 ± 106 ms)
Bundle size diffs
|
Description
The way the last 2 assertions are constructed are an anti-pattern, that give place to a race condition, where we wait for the selector to appear, but we don't wait for it to be enabled, so it can happen that when we do the assertion, the button is not yet enabled.
To fix this, we need to directly wait for the element to be enabled (
findClickableElement
).Related issues
Fixes: #27018
Manual testing steps
Screenshots/Recordings
See how the element Buy is present and it's already enabled but when the assertion took place, the button was still disabled.
Pre-merge author checklist
Pre-merge reviewer checklist