metamask-extension
metamask-extension copied to clipboard
22542 add e2e test for update network
Description
This PR adds test coverage for update network which is critical flow in the extension.
Related issues
Fixes:
Manual testing steps
Run the tests locally yarn yarn start:test yarn test:e2e:single test/e2e/tests/network/update-network.spec.ts --browser=chrome --debug --leave-running yarn test:e2e:single test/e2e/tests/network/update-network.spec.ts --browser=firefox --debug --leave-running
Pre-merge author checklist
- [x] I’ve followed MetaMask Coding Standards.
- [x] I've clearly explained what problem this PR is solving and how it is solved.
- [ ] I've linked related issues
- [x] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [ ] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] 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.
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.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
3844eac
) 68.47% compared to head (babc8df
) 68.47%. Report is 3 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #22762 +/- ##
========================================
Coverage 68.47% 68.47%
========================================
Files 1088 1088
Lines 42956 42956
Branches 11436 11436
========================================
Hits 29410 29410
Misses 13546 13546
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
- Let's centralize those selectors, you're repeating some of the same ones in 3 places already. Create
/test/e2e/helpers/selectors.ts
and import from there. - This is an optional challenge, but it would be nice to write new tests in TypeScript. We're supposed to be writing all new things in TypeScript, but few people are following it. I wrote some samples of TS E2E in the
/test/e2e/accounts
folder.
@HowardBraham ,Thank you for your keen observation regarding centralizing the object selectors. I absolutely agree that there is duplication in that regard. Mariona is currently working on implementing the Page Object Model, which will be a significant framework change, and we will address this issue as part of that process.
I did explore TypeScript briefly, using your accounts as a reference, but I encountered some challenges. I plan to allocate some time today to give it another try. I agree with your recommendation that we should transition to writing our code in TypeScript.
Builds ready [698d395]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (871 ± 41 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 92 | 189 | 132 | 25 | 12 |
domContentLoaded | 12 | 69 | 28 | 16 | 8 | ||
load | 699 | 1053 | 871 | 86 | 41 | ||
domInteractive | 12 | 69 | 28 | 16 | 8 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [dee828c]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (817 ± 19 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 102 | 150 | 119 | 15 | 7 |
domContentLoaded | 10 | 45 | 18 | 9 | 4 | ||
load | 756 | 900 | 817 | 40 | 19 | ||
domInteractive | 10 | 45 | 18 | 9 | 4 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
I was thinking about what Mark Stacey said today with our very large CircleCI usage. In that context, it makes sense to combine and form larger tests. I tried, and this could be condensed into a single test that takes 55 seconds to run. This is true because nothing has to be "reset" in between tests.
How do other people feel about this?
Builds ready [57034e2]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (896 ± 97 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 86 | 165 | 124 | 21 | 10 |
domContentLoaded | 9 | 48 | 20 | 10 | 5 | ||
load | 755 | 1688 | 896 | 203 | 97 | ||
domInteractive | 9 | 47 | 20 | 10 | 5 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
I was thinking about what Mark Stacey said today with our very large CircleCI usage. In that context, it makes sense to combine and form larger tests. I tried, and this could be condensed into a single test that takes 55 seconds to run. This is true because nothing has to be "reset" in between tests.
How do other people feel about this?
Hi @HowardBraham , Yes, I always agree with the idea of smart coupling for e2e test, It reduces execution time, it's more "end-to-end" to test a user flow, it's closer to real user's behaviour, as real user don't have a clean setup each time. Additionally, as you mentioned, it saves money on CircleCI. We do acknowledge the downside that if one step fails, the whole test will fail, making it slightly more challenging to debug. However, overall, the advantages outweigh the disadvantages, making it reasonable to combine certain our e2e tests.
Builds ready [ec2d41b]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (930 ± 33 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 105 | 173 | 136 | 20 | 10 |
domContentLoaded | 10 | 66 | 28 | 17 | 8 | ||
load | 807 | 1086 | 930 | 69 | 33 | ||
domInteractive | 10 | 66 | 28 | 17 | 8 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [de97483]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (803 ± 31 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 86 | 199 | 111 | 26 | 12 |
domContentLoaded | 10 | 72 | 19 | 13 | 6 | ||
load | 724 | 1012 | 803 | 64 | 31 | ||
domInteractive | 10 | 72 | 19 | 13 | 6 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [05ef49b]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (744 ± 16 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 79 | 115 | 94 | 9 | 4 |
domContentLoaded | 9 | 18 | 13 | 3 | 1 | ||
load | 685 | 816 | 744 | 34 | 16 | ||
domInteractive | 9 | 18 | 13 | 3 | 1 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [6a70b6f]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (739 ± 14 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 83 | 122 | 91 | 9 | 4 |
domContentLoaded | 9 | 26 | 15 | 4 | 2 | ||
load | 690 | 812 | 739 | 28 | 14 | ||
domInteractive | 9 | 26 | 15 | 4 | 2 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [2079e33]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (765 ± 24 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 79 | 125 | 97 | 13 | 6 |
domContentLoaded | 9 | 24 | 17 | 4 | 2 | ||
load | 697 | 870 | 765 | 50 | 24 | ||
domInteractive | 9 | 24 | 17 | 4 | 2 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 153 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [8e45c04]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (919 ± 32 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 105 | 283 | 183 | 38 | 18 |
domContentLoaded | 9 | 67 | 29 | 23 | 11 | ||
load | 811 | 1033 | 919 | 66 | 32 | ||
domInteractive | 9 | 67 | 29 | 23 | 11 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 153 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [3e4b7a8]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1096 ± 66 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 118 | 286 | 202 | 45 | 21 |
domContentLoaded | 8 | 110 | 48 | 31 | 15 | ||
load | 856 | 1317 | 1096 | 137 | 66 | ||
domInteractive | 8 | 110 | 48 | 31 | 15 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 153 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [babc8df]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (970 ± 41 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 115 | 309 | 175 | 42 | 20 |
domContentLoaded | 9 | 98 | 38 | 30 | 14 | ||
load | 823 | 1108 | 970 | 86 | 41 | ||
domInteractive | 9 | 98 | 38 | 30 | 14 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 153 Bytes (0.00%)
- common: 0 Bytes (0.00%)