diff options
| author | Adam Soltys <[email protected]> | 2026-03-01 12:42:16 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-01 12:42:16 -0800 |
| commit | 0167d3d9348d9e2cb1f85cd499ef346f6e85dad1 (patch) | |
| tree | 8c3048fdf0f4209618ff7a4cb2be612856d3780b /test/e2e/ark-vault-send-forward.spec.ts | |
| parent | 6ac0d3da9668149cb2c3b6322fa431a2f7f508a9 (diff) | |
| download | coinos-ui-0167d3d9348d9e2cb1f85cd499ef346f6e85dad1.tar.gz coinos-ui-0167d3d9348d9e2cb1f85cd499ef346f6e85dad1.zip | |
Fix ark e2e tests: consolidate into serial suite, fix VTXO contention
- Skip settle/refresh during tests via ark:skipSettle flag to prevent
VTXOs from being registered in never-completing ark rounds
- Add 3s timeout on syncPromise wait in sendArk to prevent hangs
- Fix ensureArkAccount to wait for autoUnlockArk and create account
via API with correct address (Schnorr signatures are non-deterministic)
- Consolidate all 6 ark tests into single serial file to prevent
server wallet contention
- Split playwright config into parallel (non-ark) and serial (ark) projects
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Diffstat (limited to 'test/e2e/ark-vault-send-forward.spec.ts')
| -rw-r--r-- | test/e2e/ark-vault-send-forward.spec.ts | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/test/e2e/ark-vault-send-forward.spec.ts b/test/e2e/ark-vault-send-forward.spec.ts deleted file mode 100644 index ac9d10fe..00000000 --- a/test/e2e/ark-vault-send-forward.spec.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { expect, test } from "@playwright/test"; -import { - aliceUsername, - alicePassword, - testSecret, - arkWalletPassword, - login, - ensureArkAccount, - createArkInvoiceViaUI, - sendArkFromTestEndpoint, - waitForInvoicePaid, - fillNumpadAmount, - waitForSendComplete, - waitForDashboard, - dockerExec, -} from "./helpers"; - -function getLiquidAddress(): string { - return dockerExec("lq", "elements-cli getnewaddress"); -} - -test("vault sends to external Liquid address via forward", async ({ page }) => { - test.slow(); - test.setTimeout(180_000); - test.skip(!testSecret, "E2E_TEST_SECRET is required for ark tests"); - - // --- Login and ensure ark account --- - await login(page, aliceUsername, alicePassword); - await ensureArkAccount(page, arkWalletPassword); - - // --- Fund vault --- - await page.goto(`/${aliceUsername}`); - await waitForDashboard(page); - - const { invoiceId, address: arkAddress } = await createArkInvoiceViaUI( - page, - arkWalletPassword, - ); - console.log(`[e2e] Alice vault address: ${arkAddress}, invoice: ${invoiceId}`); - - const fundAmount = 2000; - await sendArkFromTestEndpoint(page, arkAddress, fundAmount, invoiceId); - await waitForInvoicePaid(page, invoiceId, fundAmount); - console.log(`[e2e] Vault funded with ${fundAmount} sats`); - - // --- Get an external Liquid address --- - const liquidAddress = getLiquidAddress(); - console.log(`[e2e] External Liquid address: ${liquidAddress}`); - - // --- Navigate to send page with the Liquid address --- - await page.goto(`/${aliceUsername}`); - await waitForDashboard(page); - - // Set the ark account as active so the send uses the vault - const arkCard = page.locator('[data-testid="account-card"][data-account-type="ark"]'); - await expect(arkCard.first()).toBeVisible({ timeout: 10_000 }); - - // Paste the liquid address and navigate to send flow - await page.goto("/send"); - await page.waitForURL(/\/send/); - - const textarea = page.locator('textarea[name="text"]'); - await expect(textarea).toBeVisible({ timeout: 5_000 }); - await textarea.fill(liquidAddress); - await page.locator('button[type="submit"]').first().click(); - - // Should navigate to /send/bitcoin/{address} or similar - await page.waitForURL(/\/send\/bitcoin\//, { timeout: 15_000 }); - console.log(`[e2e] On send amount page: ${page.url()}`); - - // Enter send amount - const sendAmount = 1000; - await fillNumpadAmount(page, sendAmount); - - // Should navigate to confirmation page - await page.waitForURL(/\/send\/bitcoin\/.*\/\d+/, { timeout: 15_000 }); - console.log(`[e2e] On confirmation page: ${page.url()}`); - - // Handle WalletPass modal if it appears - const walletPassInput = page.getByTestId("walletpass-input"); - if (await walletPassInput.isVisible({ timeout: 3_000 }).catch(() => false)) { - await walletPassInput.fill(arkWalletPassword); - await page.getByTestId("walletpass-submit").click(); - } - - // Click send - const sendButton = page.locator('button[type="submit"]'); - await expect(sendButton).toBeVisible({ timeout: 5_000 }); - await sendButton.click(); - - // Wait for redirect to /sent/ or detect error (fails fast on send error) - await waitForSendComplete(page, 90_000); - console.log(`[e2e] Vault→Liquid forward payment sent: ${page.url()}`); - - // Verify we landed on the sent page with a valid payment ID - const sentMatch = page.url().match(/\/sent\/([^/?#]+)/); - expect(sentMatch, "Should have payment ID in /sent/ URL").toBeTruthy(); - console.log(`[e2e] Payment ID: ${sentMatch![1]}`); -}); |
