Skip to content

Commit b011c80

Browse files
committed
test: update switch network test to validate expected balances
This commit modifies the switch network test to replace checks for local node balances with assertions for expected balances in both ETH and USD. This change enhances the clarity of the test by ensuring it verifies the correct balance display after switching networks, improving overall test accuracy and maintainability.
1 parent 6b0163a commit b011c80

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/e2e/tests/network/switch-network.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,20 @@ describe('Switch network - ', function (this: Suite) {
4545
await loginWithBalanceValidation(driver);
4646
const homePage = new HomePage(driver);
4747

48-
// Validate the switch network functionality to Ethereum
48+
// Test starts with a custom network localhost:8545
49+
50+
// In the send flow we use Ethereum token which changes the network to Ethereum on the home page becuase custom network was previously selected
4951
await switchToNetworkFromSendFlow(driver, 'Ethereum');
50-
await homePage.checkLocalNodeBalanceIsDisplayed();
52+
await homePage.checkExpectedBalanceIsDisplayed('25', 'ETH');
5153

5254
// Add Arbitrum network
5355
await searchAndSwitchToNetworkFromGlobalMenuFlow(driver, 'Arbitrum');
54-
await homePage.checkLocalNodeBalanceIsDisplayed();
56+
await homePage.checkExpectedBalanceIsDisplayed('$85,000.00', 'USD');
5557

56-
// Validate the switch network functionality back to Ethereum
58+
// Switching network in send flow should not affect the home page network filter
5759
await switchToNetworkFromSendFlow(driver, 'Ethereum');
5860
await homePage.checkPageIsLoaded();
59-
await homePage.checkLocalNodeBalanceIsDisplayed();
61+
await homePage.checkExpectedBalanceIsDisplayed('$85,000.00', 'USD');
6062
},
6163
);
6264
});

0 commit comments

Comments
 (0)