-
Notifications
You must be signed in to change notification settings - Fork 5k
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
test: add simple notifications test, add page objects for test #27096
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. |
I have read the CLA Document and I hereby sign the CLA |
…as opted out for using 4Byte Resolution (#27203)
…iles to POM and TS (#27201) This pull request creates the AccountListPage class for the E2E tests page object model and migrates 4 test files in `test/e2e/tests/account` to POM **and** TypeScript, with enhanced log messages. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27155?quickstart=1) Fixes: #27163 Check code readability, make sure tests pass. <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> <!-- [screenshots/recordings] --> <!-- [screenshots/recordings] --> - [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/develop/.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/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Chloe Gao <[email protected]> Co-authored-by: chloeYue <[email protected]>
<!-- 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** Refer to [Slack thread](https://consensys.slack.com/archives/G01FXS64DFA/p1725383758137349?thread_ts=1724763550.024349&cid=G01FXS64DFA), it is discovered that `Application Opened` event is only emitted during the on-boarding flow, not every time the application is opened. And further is discussed in [this issue](MetaMask/MetaMask-planning#2847). In the end the decision made was to remove this event from codebase completely <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27102?quickstart=1) ## **Related issues** Fixes: MetaMask/MetaMask-planning#3210 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **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/develop/.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/develop/.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** The fix for the flaky test is related to the custom screen size of the window during execution. The flaky test was identified in multiple test scenarios with a similar pattern of false negatives in the automation tests. There were browser errors that appeared after navigating and opening the devTools, with the following error mentioned: ``` 2024-08-22T20:14:57.507Z [driver] Called 'navigate' with arguments [] -----Received an error from Chrome----- Request Storage.getStorageKeyForFrame failed. {"code":-32602,"message":"Frame tree node for given frame not found"} Request Storage.getStorageKeyForFrame failed. {"code":-32602,"message":"Frame tree node for given frame not found"} ----------End of Chrome error---------- 2024-08-22T20:15:04.239Z [driver] Called 'fill' with arguments ["#password","correct horse battery staple"] ``` And due to this error, the code mistakenly flags the test as failed and attempts to capture a screenshot, leading to Due to this error, the code mistakenly flags the test as failed and attempts to capture a screenshot, leading to another false `error: NoSuchWindowError: no such window: target window already closed.` - The test specific to responive UI requires a specific window size inorder to perform correctly and with help of @danjm suggestion I have include the `constrainWindowSize: true` which meets the test criteria. - Also I have noticed that the windows size is not required for the `swap-send-test-utils.ts` and hence removed it. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27067?quickstart=1) ## **Related issues** Fixes: #26898 #26900 #26637 #26112 #24624 ## **Manual testing steps** Run the below commands locally or in codespaces Webpack build yarn yarn build:test:webpack yarn build:test:webpack ENABLE_MV3=false yarn test:e2e:single test/e2e/tests/swap-send/swap-send-erc20.spec.ts --browser=chrome ENABLE_MV3=false yarn test:e2e:single test/e2e/tests/swap-send/swap-send-eth.spec.ts --browser=chrome ENABLE_MV3=false yarn test:e2e:single test/e2e/tests/account/metamask-responsive-ui.spec.js --browser=chrome ## **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/develop/.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 - [ ] 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/develop/.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.
## **Description** Removes unused code. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27211?quickstart=1) ## **Related issues** Fixes: None ## **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/develop/.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/develop/.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** Bumps: - `@metamask/profile-sync-controller` from `^0.7.0` to `^0.8.0` - `@metamask/notification-services-controller` from `^0.6.0` to `^0.7.0` This fixes a critical issue where we were not using the same UserStorage hashed entry. See release library changelog https://github.com/MetaMask/core/blob/main/packages/profile-sync-controller/CHANGELOG.md#fixed [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27224?quickstart=1) ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/NOTIFY-1118 ## **Manual testing steps** Test notifications flow: - Enable/Disable Notifications ## **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** - [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/develop/.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/develop/.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.
## **Description** In order to figure out which currencies we should support 24hr % change, we need to know which currencies are the most popular. Adds currency change dropdown event to telemetry events. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26876?quickstart=1) ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MMASSETS-344 ## **Screenshots/Recordings** ## **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/develop/.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/develop/.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** This PR fixes a typo for a property used by the event emitted by the toggle to turn basic functionality on or off. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27228?quickstart=1) ## **Related issues** N/A ## **Manual testing steps** N/A ## **Screenshots/Recordings** N/A ### **Before** N/A ### **After** 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/develop/.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/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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.
Quality Gate passedIssues Measures |
Builds ready [c7f7fb2]
Page Load Metrics (1912 ± 138 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Quality Gate passedIssues Measures |
async goToNotifiationsList(): Promise<void> { | ||
this.openAccountOptionsMenu(); | ||
this.accountOptionsMenu.clickNotificationsMenuItem(); | ||
} |
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.
With this implementation, for notifications, we use clickNotificationsMenuItem
in the AccountOptionsMenu
page, but we click lockMetaMaskButton
using the selectors in the header-navbar
page directly. However, the notificationsMenuItem
and the lockMetaMaskButton
are on the same modal, which creates inconsistency. I suggest that we don't create a new page class for AccountOptionsMenu
because it only has a few buttons without complex interactions on AccountOptionsMenu
. We can just add the notificationsMenuItem
selector in the header-navbar
page and click on it directly here. This provides an easier implementation.
constructor(driver: Driver) { | ||
this.driver = driver; | ||
this.headerNavbar = new HeaderNavbar(driver); | ||
this.accountOptionsMenu = new AccountOptionsMenu(driver); |
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.
since we will not create accountOptionsMenu
page class, this line can be deleted, accountOptionsMenu
is a part of headerNavbar
} | ||
|
||
async clickTurnOnNotifications(): Promise<void> { | ||
await this.driver.clickElement(this.turnOnButton); |
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.
use clickElementAndWaitToDisappear
to make sure the modal closes, that will reduce flakiness in the test execution
… e2e/enable-notifications
… e2e/enable-notifications
Description
E2E Test for enabling notifications for the first time
Key Changes:
E2E Testing:
enable-notifications.ts
,first-time-turn-on-modal.ts
, andnotifications-list.ts
.enable-notifications-first-time.js
).mocks.ts
).Added a
data-testid
for the Notifications menu item.Added a utility selectors (
util.js
) for using test id selector.Testing:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist