diff --git a/e2e/invoice-pay.spec.ts b/e2e/invoice-pay.spec.ts new file mode 100644 index 00000000..01cfa139 --- /dev/null +++ b/e2e/invoice-pay.spec.ts @@ -0,0 +1,73 @@ +import { test, expect } from '@playwright/test'; + +// Characterization spec for the Invoice Pay wizard (the first genuine multi-data-step +// wizard: choose-method -> payment-details, merged at submit). Captures CURRENT +// (pre-migration) behavior so the migration onto the session-backed engine can be proven +// behavior-preserving. The seed's lone unpaid invoice (UNPAID-001, Test Vendor, $150, +// client TEST) is payable; its client has one visible check bank account (Test Checking). +test.beforeEach(async ({ request }) => { await request.post('/test-reset'); }); + +// Select the unpaid invoice on the grid and open the pay wizard (choose-method step). +async function openPayWizard(page: any) { + await page.setExtraHTTPHeaders({ 'x-clients': '"mine"' }); + await page.goto('/invoice'); + await page.waitForSelector('#entity-table tbody tr'); + await page.locator('#entity-table tbody input[type="checkbox"]').first().click(); + await page.waitForTimeout(300); + // #pay-button's container hx-gets /invoice/pay on click; wait for the wizard to land. + await page.locator('#pay-button').first().click(); + await page.waitForTimeout(900); +} + +// The bank-account card's method options (print-check / debit / handwrite-check) live in a +//