Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: "Phishing Detection Via Iframe should redirect users ..." flaky …
…test (#26779) <!-- 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** Fix for flaky test "Phishing Detection Via Iframe should redirect users ..." I am unable to reproduce the issue on my mac machine. However, based on the logs and screenshot, it appears that the Dapp was taking time to load after clicking the "Continue to the site" button on the phishing page. - ~~I added a delay to allow the Dapp sufficient time to load completely before proceeding with further actions.~~ - To prevent any race conditions from getting the header element and followed by getting the corresponding text from the element. I removed that code. - After Howard's suggestion, I updated the `switchToWindowWithTitle` method with a conditional wait provided by Selenium. This approach works effectively and provides logs in case of failure when the title is not loaded. <!-- 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/26779?quickstart=1) ## **Related issues** Fixes: #26505 ## **Manual testing steps** Run the below commands locally or in codespaces: yarn ENABLE_MV3=false yarn start:test ENABLE_MV3=false yarn test:e2e:single test/e2e/tests/phishing-controller/phishing-detection.spec.js --browser=firefox The test was executed x5 times against all the builds. Below is the link for the Firefox browser as reported in the flaky test failure: https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/98030/workflows/344ccffd-8671-46a9-83ab-5dce7a0b9cdd/jobs/3649076 ## **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 - [ ] 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.
- Loading branch information