-
Notifications
You must be signed in to change notification settings - Fork 5.4k
test: MMQA-224 add test eth to weth #31278
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. |
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.
Pull Request Overview
This PR adds an ETH to WETH swap test based on an earlier swap test PR, enhancing test coverage for token swap scenarios.
- Updated the mockSwapQuotes callback to handle ETH to WETH swaps.
- Added multiple test cases to cover both WETH-to-ETH and ETH-to-WETH swap scenarios.
- Introduced a new dismissManualTokenWarning method in the swap page for handling potential warnings.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/e2e/tests/swaps/swap-erc20-with-loaded-state.spec.ts | Updated swap tests to include both ETH to WETH and WETH to ETH scenarios with additional token balance checks |
| test/e2e/page-objects/pages/swap/swap-page.ts | Added new dismissManualTokenWarning function as part of the ETH to WETH test flow |
Comments suppressed due to low confidence (2)
test/e2e/tests/swaps/swap-erc20-with-loaded-state.spec.ts:282
- [nitpick] Consider revising the comment 'Remove ETH linea token...' for clarity. Verify if 'linea' is a typo or if a more descriptive comment is needed.
// Remove ETH linea token to avoid potential flakiness
test/e2e/tests/swaps/swap-erc20-with-loaded-state.spec.ts:214
- [nitpick] Token names in the test cases should be consistent. Consider standardizing the naming (e.g., using 'ETH' or 'Ether') across all test cases.
sourceToken: 'Ethereum',
Builds ready [554169e]
Page Load Metrics (2392 ± 273 ms)
Bundle size diffs
|
Builds ready [572b82e]
Page Load Metrics (4217 ± 2296 ms)
Bundle size diffs
|
Builds ready [c205921]
Page Load Metrics (2544 ± 186 ms)
Bundle size diffs
|
c205921 to
2e617a7
Compare
test/e2e/tests/swap-send/swap-send-eth-with-loaded-state.spec.ts
Outdated
Show resolved
Hide resolved
test/e2e/tests/swap-send/swap-send-eth-with-loaded-state.spec.ts
Outdated
Show resolved
Hide resolved
test/e2e/tests/swap-send/swap-send-eth-with-loaded-state.spec.ts
Outdated
Show resolved
Hide resolved
test/e2e/tests/swap-send/swap-send-eth-with-loaded-state.spec.ts
Outdated
Show resolved
Hide resolved
test/e2e/tests/swap-send/swap-send-eth-with-loaded-state.spec.ts
Outdated
Show resolved
Hide resolved
Builds ready [3461e6f]
Page Load Metrics (4760 ± 2671 ms)
Bundle size diffs
|
Builds ready [a02015b]
Page Load Metrics (2602 ± 348 ms)
Bundle size diffs
|
Builds ready [084d75d]
UI Startup Metrics (1212 ± 62 ms)
Bundle size diffs
|
## **Description** We recently decided that we wanted to sort by token name, rather than symbol. The problem is that native tokens for several chains display `Ethereum` when in actuality the name we get from the token API is something like `Linea`. This would cause native tokens on some EVM chains to be miscategorized in sort. This PR overrides the token name for this scenario. It also consolidates the `name` and `title` fields to support both EVM and nonEVM chains. [](https://codespaces.new/MetaMask/metamask-extension/pull/31302?quickstart=1) ## **Related issues** Fixes: #31235 ## **Manual testing steps** 1. Please test on both flask and non flask builds. 2. EVM and Solana tokens should now be sorted by their display name (not symbol) 3. Check on both firefox and chrome ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** Before scenarios in bug ticket linked. ### **After** Chrome: <img width="360" alt="Screenshot 2025-03-25 at 12 58 45 PM" src="https://github.com/user-attachments/assets/b5262950-c649-47da-b18c-1b1daa9c5c01" /> <img width="1087" alt="Screenshot 2025-03-25 at 1 01 00 PM" src="https://github.com/user-attachments/assets/a818d72a-22fc-438a-981b-318dc8faedaa" /> Firefox: <img width="539" alt="Screenshot 2025-03-25 at 1 07 11 PM" src="https://github.com/user-attachments/assets/f6a2143d-c4a3-4d83-b0ca-bc943b6ba77f" /> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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.
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- --> Updates the color of values from text-alternative to text-default. This allows users to focus on the information and improves consistency across pages. ## **Related issues** None ## **Manual testing steps** 1. Open MetaMask 2. Click on NFT Details ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="355" alt="Screenshot 2025-03-11 at 12 17 22 AM" src="https://github.com/user-attachments/assets/79db2057-7700-4fdc-8f4a-63b1ee621536" /> ### **After** <img width="353" alt="Screenshot 2025-03-11 at 12 19 28 AM" src="https://github.com/user-attachments/assets/05a3def1-53b9-42d5-9c45-1f622d94ede1" /> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. --------- Co-authored-by: Nick Gambino <35090461+gambinish@users.noreply.github.com>
) ## **Description** Prevent tab from opening upon every browser startup. A [recent PR](#29826) updated the logic for how we determine whether the extension was just installed or not; we used to check state, but now we use the `runtime.onInstalled` event instead to store a flag in session storage indicating whether the extension was just installed. Unfortunately this PR had a couple of bugs; the condition using this flag was accidentally reversed, and the read from session storage was never successful because of a race condition (the write had not finished yet). To address both problems, the logic for detecting first install was refactored to use a global variable instead of session storage. Globals can be accessed and written synchronously, preventing any possibility of a race condition. The solution was complicated by the fact that MV3 builds must add an `onInstalled` listener in the root service worker module, otherwise the listener is never called (we tested this experimentally). It was also unclear whether the listener would always run before or after the `background.js` script loading, and we need to trigger an action in `background.js` on install. But we've accounted for both possibilities in this solution. [](https://codespaces.new/MetaMask/metamask-extension/pull/31332?quickstart=1) ## **Related issues** Fixes: #30924 ## **Manual testing steps** * Create a production-like build (`yarn dist` and `yarn dist:mv2`), or download the builds from the `metamaskbot` comment * Test that the window opens only on first install, not on later browser restarts. ## **Screenshots/Recordings** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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.
…0970) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR fixes a rare issue when a user, usually a developer, manually opens notification.html in a browser tab. We avoid using `browser.windows.remove(id)` to prevent closing all tabs in a window. [](https://codespaces.new/MetaMask/metamask-extension/pull/30970?quickstart=1) ## **Related issues** * Fixes: #29821 ## **Manual testing steps** Test that browser tab does not auto-close: 1. Open MM in a browser tab 2. Change url path from /home.html => /notification.html 3. Browser tab should stay open (previously the entire window was closed) Test that notification popup auto-closes: 4. Open notification popup by visiting a dapp and doing something (like connecting) that requires permission 5. Cancel/Decline the request in the notification popup 6. Notification popup should auto-close. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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.
Builds ready [54ed212]
UI Startup Metrics (1169 ± 55 ms)
Bundle size diffs
|
Builds ready [2f2995d]
UI Startup Metrics (1182 ± 46 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
Add tests based on PR #30896
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist