-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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: fix flaky tests Dapp viewed Event...
Permissions Page...
and Connections Page...
due to overlaying popup
#24580
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.
LGTM!
#24607) <!-- 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 the following flaky tests: - Permissions Page should redirect users to connections page when users click on connected permission - Connections page should disconnect when click on Disconnect button in connections page After this PR is merged, for fixing this tests we use the same approach, utilizing the new method for waiting for the notification to disappear after accepting it ``` async clickElementAndWaitToDisappear(rawLocator) { const element = await this.findClickableElement(rawLocator); await element.click(); await element.waitForElementState('hidden'); } ``` [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24607?quickstart=1) ## **Related issues** Fixes: #24597 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** Artifacts from ci ![image](https://github.com/MetaMask/metamask-extension/assets/54408225/e0bdfeab-8fec-4201-b447-e65dd552ebc7) <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask 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.
Dapp viewed Event...
Permissions Page...
and Connections Page...
due to overlaying popup
Builds ready [27477cb]
Page Load Metrics (910 ± 503 ms)
Bundle size diffs
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #24580 +/- ##
========================================
Coverage 67.37% 67.37%
========================================
Files 1289 1289
Lines 50220 50220
Branches 13005 13005
========================================
Hits 33835 33835
Misses 16385 16385 ☔ View full report in Codecov by Sentry. |
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.
LGTM! Thanks !
Builds ready [0766ef0]
Page Load Metrics (858 ± 520 ms)
Bundle size diffs
|
Description
This is a PR for fixing the flaky tests:
The problem seems to be that we are trying to click an element, but there is the previous notifcation element on top and has not disappeared yet at the moment we want to perform the click operation.
We can see this in the artifacts of the failure, where the blue notification popup is still there, despite having already clicked 'Got it'.
This is also confirmed by the error message in the logs:
The solution here is to wait for the element to disappear. Since this seems a case that can happen more often, a new driver function has been introduced, which basically clicks an element and waits until it disappears. This can be suitable for when accepting notifications/popup that whenever we accept them, those should disappear before we proceed with the next action.
Related issues
Fixes: #24575 and #24597
Manual testing steps
yarn test:e2e:single test/e2e/tests/metrics/dapp-viewed.spec.js --browser=chrome --leave-running=true
Screenshots/Recordings
Artifacts and logs from ci that helped in the investigation:
Pre-merge author checklist
Pre-merge reviewer checklist