Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Fix flaky test: "Custom network customNetwork should add mainne…
…t network" (#24895) ## **Description** This PR addresses the flakiness in e2e test "Custom network customNetwork should add mainnet network." Root Cause: The flakiness happens due to occasionally hitting the API rate limit while fetching the token symbol, resulting in the warning message `"Ticker symbol verification data is currently unavailable..."`, as indicated by the failure screenshots in the CI job. However, the test is intended to verify the presence of a different warning: `"The token symbol doesn't match the network or chainID..."`. Both warnings share the same data-testid but differ in text. Consequently, when the first warning appears, the test mistakenly identifies it as the second warning, leading to test failure. Fix Implemented: The solution for this test is to refine the selector for the specific warning message we aim to verify. By making the selector more precise, we ensure that the test accurately checks for the intended warning, thereby eliminating the flakiness caused by the confusion between the two warnings. ![Screenshot 2024-05-30 at 13 55 57](https://github.com/MetaMask/metamask-extension/assets/105063779/85e9dd36-6be1-4960-8920-f2e9f5d505a0) ![Screenshot 2024-05-30 at 11 57 16](https://github.com/MetaMask/metamask-extension/assets/105063779/5e47af8d-4c0f-4b31-a05e-0b9f9da04106) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24895?quickstart=1) ## **Related issues** Fixes: #24634 ## **Manual testing steps** 1. Run the test several times yarn test:e2e:single test/e2e/tests/network/add-custom-network.spec.js --browser=firefox --leave-running --retryUntilFailure --retries=10 2. Check ci jobs ## **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 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. --------- Co-authored-by: seaona <[email protected]>
- Loading branch information