Skip to content

Commit

Permalink
feat: refactor faucet teardown to use mergeUtXos with all test wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
kneerose committed Feb 13, 2025
1 parent c034ce1 commit 5c28a7c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/govtool-frontend/playwright/tests/faucet.teardown.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import environments from "@constants/environments";
import { faucetWallet } from "@constants/staticWallets";
import { allStaticWallets } from "@constants/staticWallets";
import { setAllureEpic, setAllureStory } from "@helpers/allure";
import { skipIfMainnet } from "@helpers/cardano";
import { pollTransaction } from "@helpers/transaction";
import { test as cleanup, expect } from "@playwright/test";
import kuberService from "@services/kuberService";
import { StaticWallet } from "@types";
import walletManager from "lib/walletManager";

cleanup.describe.configure({ timeout: environments.txTimeOut });
cleanup.beforeEach(async () => {
Expand All @@ -14,16 +16,16 @@ cleanup.beforeEach(async () => {
});

cleanup("Refund faucet", async () => {
const registerDRepWallets: StaticWallet[] =
await walletManager.readWallets("registerDRepCopy");
const registeredDRepWallets: StaticWallet[] =
await walletManager.readWallets("registeredDRepCopy");
try {
const faucetRemainingBalance = await kuberService.getBalance(
faucetWallet.address
);

const transferBalance = Math.floor(faucetRemainingBalance) - 3;
const { txId, lockInfo } = await kuberService.transferADA(
[environments.faucet.address],
transferBalance
);
const { txId, lockInfo } = await kuberService.mergeUtXos([
...allStaticWallets,
...registerDRepWallets,
...registeredDRepWallets,
]);
await pollTransaction(txId, lockInfo);
} catch (err) {
console.log(err);
Expand Down

0 comments on commit 5c28a7c

Please sign in to comment.