Skip to content

Universal Invoice Builder — manual E2E script ​

Use when adding Playwright later; run manually until automated.

Setup ​

  • Backend migrated + running
  • Admin logged in with billing.create, billing.read
  • One inventory invoice exists (regression)

Automated smoke (local) ​

With Admin (localhost:3000), Backend, DB, and qa-tests/.env + Backend/.env:

powershell
npm run invoice-builder:smoke --prefix d:\Client\Beentara\qa-tests

Checks: API custom_layout tab count, /new-invoice Custom toggle + builder, /invoice Custom layouts chip.

Optional deep checks (needs at least one saved custom invoice):

powershell
$env:INVOICE_BUILDER_DEEP=1; npm run invoice-builder:smoke --prefix d:\Client\Beentara\qa-tests

Validates singleinvoice JSON + PDF for the latest custom row.

Manual E2E ​

Flow A — Custom invoice happy path ​

  1. Create /new-invoice → Custom invoice → expand Table columns & calculations if needed
  2. Add 2 columns (Text + Currency), 2 rows, set currency column for subtotal
  3. Add shipping; verify grand total on form
  4. Publish (draft OK for portal skip)
  5. Detail /invoice-detail/:id — preview table + Custom badge
  6. Download PDF — compare to Resend email attachment (should match)
  7. Customer ledger — Custom badge + chip filter
  8. Main list /invoice — folder hint + Custom layouts chip

Flow B — Portal / pay (if enabled) ​

  1. Open pay link or portal invoice
  2. Confirm dynamic columns match layout labels

Flow C — Regression inventory ​

  1. Open old inventory invoice → PDF download → email table unchanged

Automation hints (Playwright) ​

  • Store invoiceId from create API or URL after publish
  • Assert GET /newinvoice/singleinvoice/:id/pdf returns application/pdf
  • Assert portal JSON includes invoice_mode: "custom" and custom_table.headers.length >= 2

Beentara — Business management made simple.