Skip to content

Commit a657e52

Browse files
committed
feat: add balance validation
1 parent e61eca0 commit a657e52

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

test/e2e/page-objects/flows/login.flow.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ export const loginWithoutBalanceValidation = async (
3131
* @param driver - The webdriver instance.
3232
* @param localNode - The local node server instance
3333
* @param password - The password used to unlock the wallet.
34+
* @param value - The balance value to be checked
3435
*/
3536
export const loginWithBalanceValidation = async (
3637
driver: Driver,
3738
localNode?: Ganache | Anvil,
3839
password?: string,
40+
value?: string,
3941
) => {
4042
await loginWithoutBalanceValidation(driver, password);
4143
const homePage = new HomePage(driver);
@@ -44,6 +46,6 @@ export const loginWithBalanceValidation = async (
4446
if (localNode) {
4547
await homePage.check_localNodeBalanceIsDisplayed(localNode);
4648
} else {
47-
await homePage.check_expectedBalanceIsDisplayed();
49+
await homePage.check_expectedBalanceIsDisplayed(value);
4850
}
4951
};

test/e2e/tests/hardware-wallets/ledger-erc20.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { Suite } from 'mocha';
2-
import { Driver } from '../../webdriver/driver';
32
import TestDappPage from '../../page-objects/pages/test-dapp';
43
import FixtureBuilder from '../../fixture-builder';
54
import { WINDOW_TITLES, withFixtures } from '../../helpers';
65
import { KNOWN_PUBLIC_KEY_ADDRESSES } from '../../../stub/keyring-bridge';
7-
import { loginWithoutBalanceValidation } from '../../page-objects/flows/login.flow';
6+
import { loginWithBalanceValidation } from '../../page-objects/flows/login.flow';
87
import CreateContractModal from '../../page-objects/pages/dialog/create-contract';
98

109
describe('Ledger Hardware', function (this: Suite) {
@@ -25,7 +24,12 @@ describe('Ledger Hardware', function (this: Suite) {
2524
KNOWN_PUBLIC_KEY_ADDRESSES[0].address,
2625
'0x100000000000000000000',
2726
)) ?? console.error('localNodes is undefined or empty');
28-
await loginWithoutBalanceValidation(driver);
27+
await loginWithBalanceValidation(
28+
driver,
29+
undefined,
30+
undefined,
31+
'1208925.8196',
32+
);
2933
const testDappPage = new TestDappPage(driver);
3034
await testDappPage.openTestDappPage();
3135
await testDappPage.check_pageIsLoaded();

0 commit comments

Comments
 (0)