Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
Test Snap Cronjob can trigger a cronjob to open a di...
flaky …
…tests (#28363) <!-- 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 flaky test is due to the dialog taking time to appear and disappear, which is the expected behavior. I have attached a video demonstrating the current behavior. https://github.com/user-attachments/assets/66c68d05-a2dc-4bb5-8870-c967ea9d630a To address this issue, I added retry logic and validation. However, I noticed that when the dialog does not appear, `switchToWindowWithTitle` method throws an exception and fails the test hence causing the retry logic to be ineffective. Implementation is in the first commit in this PR b97dbbe. Fixing this issue within the framework would require significant effort and could impact other tests. Therefore, I have implemented a wait period before attempting to switch to the window. This approach ensures that the dialog has enough time to appear, thereby reducing the likelihood of test failures. <!-- 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/28363?quickstart=1) ## **Related issues** Fixes: #28154 ## **Manual testing steps** Run the test locally or in codespaces using below command yarn yarn build:test:webpack ENABLE_MV3=false yarn test:e2e:single test/e2e/snaps/test-snap-cronjob.spec.js --browser=chrome --leave-running ## **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 - [ ] 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.
- Loading branch information