Skip to content

Commit 9f6803e

Browse files
authored
test: improve logInWithBalanceValidation function in e2e test (MetaMask#25139)
## **Description** Remove the delay in function `logInWithBalanceValidation` to avoid slowing down tests, especially considering its potential extensive usage. ## **Related issues** Fixes: ## **Manual testing steps** E2E tests should all pass. ## **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** - [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.
1 parent 1af66fb commit 9f6803e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/e2e/helpers.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ const TEST_SEED_PHRASE_TWO =
863863
const locateAccountBalanceDOM = async (driver, ganacheServer) => {
864864
const balance = await ganacheServer.getBalance();
865865

866-
await driver.findElement({
866+
await driver.waitForSelector({
867867
css: '[data-testid="eth-overview__primary-currency"]',
868868
text: `${balance} ETH`,
869869
});
@@ -906,9 +906,8 @@ async function unlockWallet(
906906

907907
const logInWithBalanceValidation = async (driver, ganacheServer) => {
908908
await unlockWallet(driver);
909-
await locateAccountBalanceDOM(driver, ganacheServer);
910909
// Wait for balance to load
911-
await driver.delay(500);
910+
await locateAccountBalanceDOM(driver, ganacheServer);
912911
};
913912

914913
function roundToXDecimalPlaces(number, decimalPlaces) {

0 commit comments

Comments
 (0)