-
Notifications
You must be signed in to change notification settings - Fork 5.4k
test: Fix flask multichain api wallet_invokeMethod e2e tests #37471
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
|
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. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (6 files, +10 -1)
🧪 @MetaMask/qa (1 files, +74 -18)
👨🔧 @MetaMask/wallet-integrations (1 files, +107 -44)
|
Builds ready [19b489d]
UI Startup Metrics (1301 ± 99 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| ); | ||
| await confirmation.checkNetworkIsDisplayed('Localhost 8546'); | ||
| await confirmation.clickFooterConfirmButtonAndAndWaitForWindowToClose(); | ||
| await confirmation.checkNetworkIsNotDisplayed(currentNetwork); |
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.
in each iteration, we check that the network is different from the previous confirmation screen to ensure that we’ve switched to a new confirmation screen
Builds ready [5a007d3]
UI Startup Metrics (1261 ± 96 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [9052dff]
UI Startup Metrics (1261 ± 91 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [5578eef]
UI Startup Metrics (1255 ± 100 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| * @param account - The sender account to check. | ||
| */ | ||
| async checkIsSenderAccountDisplayed(account: string): Promise<boolean> { | ||
| async checkSenderAccountIsDisplayed(account: string): Promise<void> { |
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.
the original method was called without asserting the return value in code base, making it effectively do nothing. I updated the implementation to prevent false positives.
Builds ready [a246399]
UI Startup Metrics (1244 ± 88 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Fix these 2 flaky tests:
Multichain API Calling
wallet_invokeMethodon the same dapp across three different connected chains Write operations: callingeth_sendTransactionon each connected scope should have less balance due to gas after transaction is sentMultichain API Calling
wallet_invokeMethodon the same dapp across three different connected chains Write operations: callingeth_sendTransactionon each connected scope should match chosen addresses in each chain to the selected address per scope in extension windowThe 2 flaky tests share same reason of flakiness: as we invoke all methods the same time, so the confirmation screen order is not always the same when we run test, so the displayed order of account and network can be different
Screen.Recording.2025-11-03.at.14.40.17.mov
The test was flaky because it assumed a fixed order of confirmation screens. The new logic no longer depends on a strict order. Instead, it:
Changelog
CHANGELOG entry: null
Related issues
Manual testing steps
Tests should pass and be robust
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Makes multichain wallet_invokeMethod e2e tests order-agnostic, enhances confirmation page object APIs, and adds a data-testid to the network name used by tests.
wallet_invokeMethod):account/network, and assert all expected combinations; validate unique/expected networks across dialogs.SCOPE_TO_NETWORK_NAMEmap; update balance checks to verify post-gas changes per network.TransactionConfirmation):confirmation__details-network-name).getNetworkName,getSenderAccountName,checkNetworkIsNotDisplayed,checkHeaderAccountNameIsDisplayed; renamecheckIsSenderAccountDisplayed→checkSenderAccountIsDisplayed.checkHeaderAccountNameIsDisplayed('Account 1')before advanced details.data-testid="confirmation__details-network-name"to network name; update related snapshots.Written by Cursor Bugbot for commit a246399. This will update automatically on new commits. Configure here.