Skip to content

Commit f79ea68

Browse files
committed
test: add retry logic for dapp chain ID verification in EVM provider events
1 parent b51f158 commit f79ea68

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

e2e/specs/connections/evm-provider-events.spec.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { DappVariants } from '../../framework/Constants';
1818
import ToastModal from '../../pages/wallet/ToastModal';
1919
import AccountListBottomSheet from '../../pages/wallet/AccountListBottomSheet';
2020
import NetworkListModal from '../../pages/Network/NetworkListModal';
21+
import Utilities from '../../framework/Utilities';
2122

2223
describe(SmokeWalletPlatform('EVM Provider Events'), () => {
2324
beforeAll(async () => {
@@ -194,10 +195,20 @@ describe(SmokeWalletPlatform('EVM Provider Events'), () => {
194195
);
195196
await NetworkListModal.changeNetworkTo('Localhost');
196197

197-
const connectedChainIdAfter = await TestDApp.getConnectedChainId();
198-
if (connectedChainIdAfter !== '0x539') {
199-
throw new Error('selected chainId did not match expected end state');
200-
}
198+
await Utilities.executeWithRetry(
199+
async () => {
200+
const connectedChainIdAfter = await TestDApp.getConnectedChainId();
201+
if (connectedChainIdAfter !== '0x539') {
202+
throw new Error(
203+
`selected chainId (${connectedChainIdAfter}) did not match expected end state (0x539)`,
204+
);
205+
}
206+
},
207+
{
208+
timeout: 10000,
209+
description: 'wait for dapp chainId to update to 0x539',
210+
},
211+
);
201212
},
202213
);
203214
});

0 commit comments

Comments
 (0)