Skip to content

Conversation

@seaona
Copy link
Member

@seaona seaona commented Nov 28, 2025

Description

Some async methods were missing the await key. This has been added and has surfaced an issue with a method, which has also been fixed.

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Check ci

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

Adds awaited click actions in dialog/send pages and replaces hex data assertion with a wait-based helper, updating tests accordingly.

  • E2E Page Objects:
    • test/e2e/page-objects/pages/dialog/confirm-alert.ts: Add await to alert modal interactions (rejectFromAlertModal, confirmFromAlertModal, acknowledgeAlert).
    • test/e2e/page-objects/pages/send/send-token-page.ts:
      • Replace getHexInputValue with waitForHexDataCleared, which waits until the hex input is empty using waitUntil.
      • Minor: continue to await interactions and maintain logging.
  • E2E Tests:
    • test/e2e/tests/transaction/change-assets.spec.ts:
      • Remove direct assertion on hex input and call waitForHexDataCleared() instead.
      • Drop unused strict assert import.
      • Keep flow the same while ensuring hex data clears before continuing.

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

@metamaskbot metamaskbot added the team-qa QA team label Nov 28, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Nov 28, 2025

✨ Files requiring CODEOWNER review ✨

🧪 @MetaMask/qa (2 files, +16 -7)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 pages/
          • 📁 dialog/
            • 📄 confirm-alert.ts +5 -5
          • 📁 send/
            • 📄 send-token-page.ts +11 -2

@seaona seaona self-assigned this Nov 28, 2025
@seaona seaona added e2e-maintenance flaky tests no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed e2e-maintenance labels Nov 28, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [a3e5c27]
UI Startup Metrics (1222 ± 104 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12221031155910412811388
load102587113139510711197
domContentLoaded101886813059510651192
domInteractive2516103192179
firstPaint5618412804019761173
backgroundConnect21619329415222248
firstReactRender3220166173558
getState3416102144053
initialActions104112
loadScripts809662104190853974
setupStore1172331218
numNetworkReqs1257620573
BrowserifyPower User HomeuiStartup20581664308928122702619
load97484517661549711376
domContentLoaded96084017561539521361
domInteractive32151512729112
firstPaint6539918683939291291
backgroundConnect250181758119216526
firstReactRender6042115166496
getState208141656102207617
initialActions106113
loadScripts76965915501507621172
setupStore1994882136
numNetworkReqs1526641380197367
WebpackStandard HomeuiStartup77966999777820941
load60153480264624764
domContentLoaded59652979763619757
domInteractive241595201979
firstPaint25099781176275638
backgroundConnect11679101025
firstReactRender2819172163038
getState241251103142
initialActions107112
loadScripts59452879062617749
setupStore1063451218
numNetworkReqs1257720573
WebpackPower User HomeuiStartup16371263212822618952033
load675596100087675909
domContentLoaded66558999588668905
domInteractive35181683133129
firstPaint29692876209338715
backgroundConnect83860216123529
firstReactRender60439696679
getState18713667698174229
initialActions105112
loadScripts66258798586666897
setupStore22955122549
numNetworkReqs1666940778211372
FirefoxBrowserifyStandard HomeuiStartup12551042168512613491491
load104390412858511011223
domContentLoaded104290412858511011218
domInteractive58311633082118
firstPaint------
backgroundConnect45211693245134
firstReactRender22175762334
getState1164761122
initialActions102112
loadScripts101588912317510641172
setupStore135193201029
numNetworkReqs1256616661
BrowserifyPower User HomeuiStartup26691913475265827914395
load1186980250626111551549
domContentLoaded1185980250526111541549
domInteractive11834480108108436
firstPaint------
backgroundConnect138321424224110496
firstReactRender61381892264100
getState256601014207256811
initialActions208123
loadScripts1122958220918111141483
setupStore17310783208201680
numNetworkReqs101613236183241
WebpackStandard HomeuiStartup14811253188715215401832
load1229107215519712961420
domContentLoaded1229107115519712961420
domInteractive58271913281114
firstPaint------
backgroundConnect44161872844103
firstReactRender2721112102837
getState136116151335
initialActions106113
loadScripts1202105715238812661375
setupStore186196271487
numNetworkReqs1256417763
WebpackPower User HomeuiStartup29632150528367430514554
load13911141304627514401786
domContentLoaded13911141304627514401786
domInteractive11229526106101403
firstPaint------
backgroundConnect133291140156131298
firstReactRender69411962971149
getState308661719286374867
initialActions217123
loadScripts13351115204218113901757
setupStore16361128209191609
numNetworkReqs1015824855115238
📊 Page Load Benchmark Results

Current Commit: a3e5c27 | Date: 11/28/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±46ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 720ms (±43ms) 🟢 | historical mean value: 721ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 46ms 1.01s 1.39s 1.07s 1.39s
domContentLoaded 720ms 43ms 698ms 1.06s 748ms 1.06s
firstPaint 77ms 12ms 60ms 172ms 88ms 172ms
firstContentfulPaint 77ms 12ms 60ms 172ms 88ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 20 Bytes (0%)

async waitForHexDataCleared(): Promise<string> {
console.log('Getting value from hex input');
const hexInputElement = await this.driver.waitForSelector(this.hexInput);
this.driver.waitForNonEmptyElement(hexInputElement);
Copy link
Member Author

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

Image

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.

@seaona seaona marked this pull request as ready for review November 28, 2025 09:34
@seaona seaona requested a review from a team as a code owner November 28, 2025 09:34
@metamaskbot
Copy link
Collaborator

Builds ready [c58a864]
UI Startup Metrics (1336 ± 144 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup13361096192114414161637
load1121911161913311901405
domContentLoaded1113905161113211831399
domInteractive2816113202485
firstPaint55588142642710671261
backgroundConnect23719635020248272
firstReactRender3320123163570
getState3816123204284
initialActions104112
loadScripts88469413901289441163
setupStore1265961324
numNetworkReqs1257821575
BrowserifyPower User HomeuiStartup20701721282923321932502
load1024894145812710431376
domContentLoaded1009886144412610171368
domInteractive35171742834109
firstPaint49711314343859431260
backgroundConnect262198759110233541
firstReactRender5840107126385
getState19214673766199270
initialActions104112
loadScripts80168812431278091167
setupStore2077192437
numNetworkReqs104672735299265
WebpackStandard HomeuiStartup8246951055808541008
load63656385967652808
domContentLoaded63155985367648801
domInteractive2615156232188
firstPaint21776820158204608
backgroundConnect1055681126
firstReactRender27207683039
getState261358113547
initialActions103111
loadScripts62855884365646790
setupStore1052541220
numNetworkReqs1257821575
WebpackPower User HomeuiStartup16801278254226019382135
load69258911841176911006
domContentLoaded6825811174117675992
domInteractive39171733633150
firstPaint319941033235402933
backgroundConnect97863117820533
firstReactRender62459096776
getState17713870157178227
initialActions104112
loadScripts6795781164115672989
setupStore211065122352
numNetworkReqs1696740080209394
FirefoxBrowserifyStandard HomeuiStartup12901067167513513881536
load106190313469511291218
domContentLoaded106090313469511291218
domInteractive61321723086115
firstPaint------
backgroundConnect45231513049112
firstReactRender23176272336
getState117138131020
initialActions102012
loadScripts103688613088910921186
setupStore125102141030
numNetworkReqs1157016664
BrowserifyPower User HomeuiStartup27392052468360329174184
load1215979247224312611691
domContentLoaded1215978247224312601691
domInteractive12334660129107478
firstPaint------
backgroundConnect128281144164118347
firstReactRender64361942764144
getState282561008212375778
initialActions2056523
loadScripts1171961223719712061513
setupStore1369901169159579
numNetworkReqs100623176379249
WebpackStandard HomeuiStartup15641306214418516591948
load12751119157211313491543
domContentLoaded12751118157211313491542
domInteractive64273124187128
firstPaint------
backgroundConnect57192093968146
firstReactRender302187133067
getState177137211472
initialActions103113
loadScripts12431094153510513201462
setupStore187206261472
numNetworkReqs1256916761
WebpackPower User HomeuiStartup28982220468859929024408
load14131133249722414891835
domContentLoaded14121133249622414891835
domInteractive11631491107105430
firstPaint------
backgroundConnect1062728649130201
firstReactRender62422132264100
getState289811607256315776
initialActions5110113333
loadScripts13771113239520914591802
setupStore20581078235301688
numNetworkReqs101652575981246
📊 Page Load Benchmark Results

Current Commit: c58a864 | Date: 11/28/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±36ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 715ms (±35ms) 🟢 | historical mean value: 718ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 73ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 36ms 999ms 1.30s 1.05s 1.30s
domContentLoaded 715ms 35ms 692ms 983ms 735ms 983ms
firstPaint 73ms 11ms 56ms 164ms 84ms 164ms
firstContentfulPaint 73ms 11ms 56ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 20 Bytes (0%)

@seaona seaona added this pull request to the merge queue Nov 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 28, 2025
@seaona seaona added this pull request to the merge queue Nov 28, 2025
Merged via the queue into main with commit c5693a0 Nov 28, 2025
179 checks passed
@seaona seaona deleted the test-missing-awaits-confirm branch November 28, 2025 12:27
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2025
@metamaskbot metamaskbot added the release-13.13.0 Issue or pull request that will be included in release 13.13.0 label Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

flaky tests no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.13.0 Issue or pull request that will be included in release 13.13.0 size-S team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants