-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: test actions missing awaits #38381
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
Conversation
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (2 files, +16 -7)
|
Builds ready [a3e5c27]
UI Startup Metrics (1222 ± 104 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| async waitForHexDataCleared(): Promise<string> { | ||
| console.log('Getting value from hex input'); | ||
| const hexInputElement = await this.driver.waitForSelector(this.hexInput); | ||
| this.driver.waitForNonEmptyElement(hexInputElement); |
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.
after adding the missing awaits, this has surfaced an issue with this method. This makes the test fail, as in the spec, we call this function when we are trying to assert the element is empty:
// Make sure hex data is cleared after switching assets
Given the hex data is empty in that case, the waitForNonEmptyElement never happens and the spec fails
The way this function is implemented is also a bit dangerous for introducing race conditions (getting an element and then the value, and making an assertion against that).
So I've changed this to wait for a specific value (Empty), given that's the only case we are using this.
If in the future we need to assert against a value we'll need to create a new function to support that - but not needed now.
Builds ready [c58a864]
UI Startup Metrics (1336 ± 144 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Some async methods were missing the
awaitkey. This has been added and has surfaced an issue with a method, which has also been fixed.Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Adds awaited click actions in dialog/send pages and replaces hex data assertion with a wait-based helper, updating tests accordingly.
test/e2e/page-objects/pages/dialog/confirm-alert.ts: Addawaitto alert modal interactions (rejectFromAlertModal,confirmFromAlertModal,acknowledgeAlert).test/e2e/page-objects/pages/send/send-token-page.ts:getHexInputValuewithwaitForHexDataCleared, which waits until the hex input is empty usingwaitUntil.test/e2e/tests/transaction/change-assets.spec.ts:waitForHexDataCleared()instead.Written by Cursor Bugbot for commit c58a864. This will update automatically on new commits. Configure here.