Skip to content

Conversation

@chloeYue
Copy link
Contributor

@chloeYue chloeYue commented Oct 30, 2025

Description

The reason for the test failure is that when calling clickFooterConfirmButtonAndAndWaitForWindowToClose, the window does not close after clicking the confirm button. This behavior is correct, because multiple confirmation windows are open, the next test step checks the display of the next confirmation screen. Therefore, we should not use clickFooterConfirmButtonAndAndWaitForWindowToClose. The fix is to use clickFooterConfirmButton instead.

Why the test was flaky instead of consistently failing? Because in the test spec, we use if conditions to check and confirm the confirmation screens. Since the send calls are triggered at the same time, the order in which the confirmation screens appear can vary. The test verifies the displayed information on confirmation screen regardless the screen order.
If the flow goes into a different if block, the test passes; however, if it follows this particular if block, the test fails.

I also improved the function checkIsSenderAccountDisplayed to use waitForSelector to be more stable.

I ran this test 10 times and they all passed.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

  1. test should be stable and pass

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Stabilizes multichain E2E by avoiding window-close waits during sequential confirmations and making sender-account checks wait-based.

  • E2E Tests (test/e2e/flask/multichain-api/evm/wallet_invokeMethod.spec.ts)
    • For the second confirmation flow, replace clickFooterConfirmButtonAndAndWaitForWindowToClose with clickFooterConfirmButton to proceed without waiting for the window to close when multiple dialogs are pending.
  • Page Object (test/e2e/page-objects/pages/confirmations/redesign/transaction-confirmation.ts)
    • Make checkIsSenderAccountDisplayed more robust by using waitForSelector with try/catch, returning a boolean after waiting for the sender account element.

Written by Cursor Bugbot for commit c92f5cb. This will update automatically on new commits. Configure here.

@chloeYue chloeYue requested a review from a team October 30, 2025 15:02
@chloeYue chloeYue self-assigned this Oct 30, 2025
@chloeYue chloeYue requested a review from a team as a code owner October 30, 2025 15:02
@chloeYue chloeYue added e2e-test End to end test for the MetaMask extension flaky tests team-qa QA team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Oct 30, 2025
@chloeYue chloeYue marked this pull request as draft October 30, 2025 15:02
@github-actions
Copy link
Contributor

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.

@metamaskbot
Copy link
Collaborator

metamaskbot commented Oct 30, 2025

✨ Files requiring CODEOWNER review ✨

🧪 @MetaMask/qa (1 files, +10 -5)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 pages/
          • 📁 confirmations/
            • 📁 redesign/
              • 📄 transaction-confirmation.ts +10 -5

👨‍🔧 @MetaMask/wallet-integrations (1 files, +1 -1)
  • 📁 test/
    • 📁 e2e/
      • 📁 flask/
        • 📁 multichain-api/
          • 📁 evm/
            • 📄 wallet_invokeMethod.spec.ts +1 -1

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: accd542 | Date: 10/30/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±37ms) 🟡 | historical mean value: 1.06s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 713ms (±34ms) 🟢 | historical mean value: 739ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 37ms 1.00s 1.30s 1.04s 1.30s
domContentLoaded 713ms 34ms 695ms 969ms 728ms 969ms
firstPaint 75ms 11ms 56ms 164ms 84ms 164ms
firstContentfulPaint 75ms 11ms 56ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [accd542]
UI Startup Metrics (1244 ± 85 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1244110314938512981393
load106793513178111221212
domContentLoaded106293213068011161206
domInteractive201368101845
firstPaint71872131644211051209
backgroundConnect2282162547231243
firstReactRender28186083245
getState19104662233
initialActions71739721
loadScripts840720109279898982
setupStore1062231015
numNetworkReqs96337632
BrowserifyPower User HomeuiStartup22191793324952527583249
load1180949194931915751949
domContentLoaded1170942191931415661919
domInteractive311590224490
firstPaint64114919564899971956
backgroundConnect286220577108318577
firstReactRender25233122631
getState18415229233187292
initialActions51194519
loadScripts920715149926612691499
setupStore1081931119
numNetworkReqs366185706172513706
WebpackStandard HomeuiStartup8647451167808821111
load64959295675655920
domContentLoaded64258594774646908
domInteractive16125171435
firstPaint20059927209197775
backgroundConnect23116092645
firstReactRender27176483234
getState1252441419
initialActions309247
loadScripts63858393672644898
setupStore1063141214
numNetworkReqs96368832
WebpackPower User HomeuiStartup17951470259339023402593
load79362313472099041347
domContentLoaded74360911791598821179
domInteractive211346103046
firstPaint5897611833498861183
backgroundConnect15637521184371521
firstReactRender26224142641
getState15412116912163169
initialActions30225322
loadScripts73960711681558721168
setupStore962961029
numNetworkReqs350218692152545692
FirefoxBrowserifyStandard HomeuiStartup14751256199310215421635
load1255108114307313071365
domContentLoaded1254108114307213071364
domInteractive1163429441130188
firstPaint------
backgroundConnect4525146215493
firstReactRender27216272745
getState74324713
initialActions3117237
loadScripts1226106414037012781329
setupStore146215211324
numNetworkReqs96317728
BrowserifyPower User HomeuiStartup27172270329131230073291
load14441232201520214962015
domContentLoaded14441232201520214962015
domInteractive16010734164172341
firstPaint------
backgroundConnect16840407108225407
firstReactRender41315884758
getState1449219532169195
initialActions17268222368
loadScripts13921203185517614491855
setupStore3471383356138
numNetworkReqs25015533967324339
WebpackStandard HomeuiStartup17051491210212517671961
load14511237185310815111661
domContentLoaded14511237185310815111661
domInteractive1123342061120263
firstPaint------
backgroundConnect50271182158110
firstReactRender362584153481
getState114184201023
initialActions6120621410
loadScripts14201217181510514721626
setupStore1483451525
numNetworkReqs96317728
WebpackPower User HomeuiStartup30262279470269832554702
load16611341220123817882201
domContentLoaded16601341220023717872200
domInteractive1404037275153372
firstPaint------
backgroundConnect2753512203703241220
firstReactRender433280124980
getState1427224240170242
initialActions1721092624109
loadScripts15941321198519117191985
setupStore5073147344314
numNetworkReqs325133685160365685
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 68 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@github-actions github-actions bot added size-S and removed size-XS labels Oct 30, 2025
@chloeYue chloeYue changed the title test: fix test test: fix flaky test " Multichain API Calling wallet_invokeMethod " Oct 30, 2025
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: c92f5cb | Date: 10/30/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±38ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 724ms (±35ms) 🟢 | historical mean value: 735ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 38ms 1.01s 1.30s 1.08s 1.30s
domContentLoaded 724ms 35ms 703ms 978ms 760ms 978ms
firstPaint 76ms 11ms 60ms 164ms 84ms 164ms
firstContentfulPaint 76ms 11ms 60ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [c92f5cb]
UI Startup Metrics (1253 ± 77 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1253111714437713091392
load107195412747411211196
domContentLoaded106494912657311121187
domInteractive20145082043
firstPaint60289126944110751197
backgroundConnect23121836215232243
firstReactRender291790103447
getState1883762130
initialActions607110721
loadScripts841733104472889962
setupStore1062531015
numNetworkReqs96337631
BrowserifyPower User HomeuiStartup21311787311050729113110
load1130928172928415671729
domContentLoaded1123923172028315581720
domInteractive271662175162
firstPaint70014517264939791726
backgroundConnect25421650969248509
firstReactRender25232922729
getState16413918110172181
initialActions417157
loadScripts891706140926012901409
setupStore1283261232
numNetworkReqs375182771198592771
WebpackStandard HomeuiStartup8647451256828811013
load649598109481651841
domContentLoaded641591108679644833
domInteractive161264101447
firstPaint20562998197209630
backgroundConnect23126292546
firstReactRender28176593336
getState1252841517
initialActions3015247
loadScripts638589107677642822
setupStore1062631216
numNetworkReqs96368833
WebpackPower User HomeuiStartup16921435240932821292409
load71061911231417751123
domContentLoaded67359110231137291023
domInteractive18123272932
firstPaint4317310313267651031
backgroundConnect13029467151227467
firstReactRender25233022630
getState15613020417164204
initialActions914916449
loadScripts66958810131107171013
setupStore20672192772
numNetworkReqs335206572135545572
FirefoxBrowserifyStandard HomeuiStartup1435125816728715011578
load1232108114477612921355
domContentLoaded1232108014467612911355
domInteractive1083521337124198
firstPaint------
backgroundConnect4124132204696
firstReactRender24215042528
getState74273812
initialActions3113235
loadScripts1205106114317412641328
setupStore1268491220
numNetworkReqs96327727
BrowserifyPower User HomeuiStartup27312269365934829453659
load14381233189017915241890
domContentLoaded14381233189017915231890
domInteractive1648330672256306
firstPaint------
backgroundConnect28262873236408873
firstReactRender40295794857
getState1287721741176217
initialActions11158171258
loadScripts13451199161610414201616
setupStore3271062645106
numNetworkReqs27816253697317536
WebpackStandard HomeuiStartup16441465204112317051923
load1408126317398914471592
domContentLoaded1407126317398914461592
domInteractive1103339056116194
firstPaint------
backgroundConnect4426129165474
firstReactRender332385133377
getState12420025816
initialActions4151649
loadScripts1381124717088714231565
setupStore157220221424
numNetworkReqs96367830
WebpackPower User HomeuiStartup28402310381441831703814
load16261310206322018552063
domContentLoaded16261310206222018542062
domInteractive1607828757206287
firstPaint------
backgroundConnect21857532171458532
firstReactRender453291154791
getState1236319832146198
initialActions621941019
loadScripts15561280191119317641911
setupStore29894203894
numNetworkReqs281133581131325581
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 120 Bytes (0%)
  • ui: 860 Bytes (0.01%)
  • common: 10 Bytes (0%)

@chloeYue chloeYue marked this pull request as ready for review October 30, 2025 16:38
@chloeYue chloeYue requested a review from a team as a code owner October 30, 2025 16:38
@DDDDDanica
Copy link
Contributor

LGTM !

Copy link
Member

@seaona seaona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM nice!

@seaona seaona enabled auto-merge October 30, 2025 17:01
Copy link
Contributor

@wenfix wenfix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send it 🚀

@seaona seaona added this pull request to the merge queue Oct 30, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2025
@HowardBraham HowardBraham added this pull request to the merge queue Oct 30, 2025
Merged via the queue into main with commit 93386d4 Oct 30, 2025
354 of 356 checks passed
@HowardBraham HowardBraham deleted the fix-wallet-invoke-method-flaky-test branch October 30, 2025 22:39
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2025
@metamaskbot metamaskbot added the release-13.9.0 Issue or pull request that will be included in release 13.9.0 label Oct 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

e2e-test End to end test for the MetaMask extension flaky tests no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.9.0 Issue or pull request that will be included in release 13.9.0 size-S team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants