Skip to content

Commit 4a5bf1a

Browse files
committed
fix: improve faucet setup balance retrieval with waited assertion
1 parent a17b0ee commit 4a5bf1a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/govtool-frontend/playwright/tests/faucet.setup.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { pollTransaction } from "@helpers/transaction";
66
import { test as setup } from "@fixtures/walletExtension";
77
import { loadAmountFromFaucet } from "@services/faucetService";
88
import kuberService from "@services/kuberService";
9+
import { functionWaitedAssert } from "@helpers/waitedLoop";
910

1011
setup.describe.configure({ timeout: environments.txTimeOut });
1112

@@ -16,9 +17,15 @@ setup.beforeEach(async () => {
1617
});
1718

1819
setup("Faucet setup", async () => {
19-
const balance = await kuberService.getBalance(faucetWallet.address);
20-
if (balance > 100_000) return;
20+
let balance: number;
21+
functionWaitedAssert(
22+
async () => {
23+
balance = await kuberService.getBalance(faucetWallet.address);
24+
},
25+
{ message: "get balance" }
26+
);
2127

28+
if (balance > 100_000) return;
2229
const res = await loadAmountFromFaucet(faucetWallet.address);
2330
await pollTransaction(res.txid);
2431
});

0 commit comments

Comments
 (0)