aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/custodial-send-external-btc.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/custodial-send-external-btc.spec.ts')
-rw-r--r--test/e2e/custodial-send-external-btc.spec.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/e2e/custodial-send-external-btc.spec.ts b/test/e2e/custodial-send-external-btc.spec.ts
index 77440d9d..1efc3136 100644
--- a/test/e2e/custodial-send-external-btc.spec.ts
+++ b/test/e2e/custodial-send-external-btc.spec.ts
@@ -3,6 +3,8 @@ import {
bobUsername,
bobPassword,
loginNewContext,
+ apiLogin,
+ apiGetBalance,
getBitcoinAddress,
pasteAndSend,
fillNumpadAmount,
@@ -12,6 +14,16 @@ import {
test("custodial sends to external bitcoin address (bitcoind)", async ({ browser }) => {
test.setTimeout(90_000);
+ // Pre-check Bob's balance — external BTC sends need ~15k sats with fees
+ const { context: checkCtx, page: checkPage } = await loginNewContext(browser, bobUsername, bobPassword);
+ const checkToken = await apiLogin(checkPage, bobUsername, bobPassword);
+ const balance = await apiGetBalance(checkPage, checkToken);
+ await checkCtx.close();
+ if (balance < 20_000) {
+ test.skip(true, `Bob's balance too low for external BTC send: ${balance}`);
+ return;
+ }
+
// --- Get external bitcoin address from 'external' wallet (NOT 'coinos' hot wallet) ---
const externalAddress = getBitcoinAddress();
console.log(`[e2e] External bitcoin address: ${externalAddress}`);