Skip to content
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

E2e request queuing #22818

Merged
merged 15 commits into from
Feb 23, 2024
Merged

E2e request queuing #22818

merged 15 commits into from
Feb 23, 2024

Conversation

tmashuang
Copy link
Contributor

@tmashuang tmashuang commented Feb 5, 2024

Description

Adds e2e tests for the request queuing system. Tests include enable the toggle settings, sending a tx from a different selected/global network which results in a switch chain request, and request queuing for multiple daps on different networks.

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1404

Manual testing steps

  1. yarn && yarn build:test
  2. yarn test:e2e:single test/e2e/tests/request-queuing/enable-queuing.spec.js --browser=chrome
  3. yarn test:e2e:single test/e2e/tests/request-queuing/switch-network.spec.js --browser=chrome
  4. yarn test:e2e:single test/e2e/tests/request-queuing/multiple-networks-dapps-txs.spec.js --browser=chrome
  5. All request queuing tests should pass individually. yarn test:e2e:chrome && yarn test:e2e:firefox for a bonus.

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

Copy link
Contributor

github-actions bot commented Feb 5, 2024

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.

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.51%. Comparing base (c9ccde4) to head (c599f14).

❗ Current head c599f14 differs from pull request most recent head 698ab1e. Consider uploading reports for the commit 698ab1e to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22818      +/-   ##
===========================================
+ Coverage    68.49%   68.51%   +0.02%     
===========================================
  Files         1092     1088       -4     
  Lines        43170    42914     -256     
  Branches     11512    11426      -86     
===========================================
- Hits         29567    29399     -168     
+ Misses       13603    13515      -88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [2600e22]
Page Load Metrics (753 ± 15 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint87160106157
domContentLoaded9441773
load6958227533215
domInteractive9441773
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 86 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [add1d9d]
Page Load Metrics (832 ± 31 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint92151118157
domContentLoaded10301963
load72810118326531
domInteractive10301963
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 86 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [2f39f3f]
Page Load Metrics (779 ± 22 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint92156111167
domContentLoaded9211532
load7168887794522
domInteractive9211532
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 86 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [195fb6a]
Page Load Metrics (778 ± 12 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint871169884
domContentLoaded10211631
load7368607782512
domInteractive10211631
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 86 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [4f97800]
Page Load Metrics (722 ± 16 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint811178994
domContentLoaded9221631
load6877897223416
domInteractive9221631
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 86 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [bbed57f]
Page Load Metrics (811 ± 23 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint82136105136
domContentLoaded9371984
load7238988114923
domInteractive9371984
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 86 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [c599f14]
Page Load Metrics (1029 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1323722084924
domContentLoaded973372512
load925129810298943
domInteractive973372512
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 86 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

} = require('../../helpers');
const { PAGES } = require('../../webdriver/driver');

// TODO: Have to turn on the setting every time we want to test the setting!?!
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to add this to the fixture no?

Copy link
Contributor Author

@tmashuang tmashuang Feb 21, 2024

Choose a reason for hiding this comment

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

Yes, we should be able to. The issuesis that any type of refresh of the state that happens reverts the request queue setting behavior to default, the setting is off even though it is supposed to be on. This behavior can be replicated in prod with the steps in the next line comment.

css: 'p',
});

// TODO: Request Queuing bug when opening both dapps at the same time will have them stuck on the same network, with will be incorrect for one of them.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// TODO: Request Queuing bug when opening both dapps at the same time will have them stuck on the same network, with will be incorrect for one of them.
// TODO: Request Queuing bug when opening both dapps at the same time will have them stuck on the same network, which will be incorrect for one of them.

also, thats an odd one! defs something to look into. Might be worth making a branch that has a failing test as described here.

'[data-testid="page-container-footer-cancel"]',
);

// TODO: No second confirmation from dapp two will show, have to go back to the extension to see the switch chain & dapp two's tx.
Copy link
Contributor

Choose a reason for hiding this comment

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

nice find on getting this to work!

Similar to above, it might be good to have a failing test on a branch so we can track this as things are updated /merged

Copy link
Contributor

@BelfordZ BelfordZ left a comment

Choose a reason for hiding this comment

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

great work!

Let me know if you need me to re-approve after rebase/updating the branch!

@metamaskbot
Copy link
Collaborator

Builds ready [698ab1e]
Page Load Metrics (1911 ± 87 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1054801948239
domContentLoaded10101392713
load16322236191118287
domInteractive10101392713
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 86 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@adonesky1 adonesky1 merged commit ff7a70d into develop Feb 23, 2024
65 of 66 checks passed
@adonesky1 adonesky1 deleted the e2e-request-queuing branch February 23, 2024 15:26
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2024
@metamaskbot metamaskbot added the release-11.13.0 Issue or pull request that will be included in release 11.13.0 label Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testSuite release-11.13.0 Issue or pull request that will be included in release 11.13.0 team-wallet-api-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants