Skip to content

test(e2e): expand the Playwright suite to cover the primary browser flows - #2

Merged
wegamekinglc merged 3 commits into
mainfrom
test/playwright-e2e-suite
Aug 15, 2026
Merged

test(e2e): expand the Playwright suite to cover the primary browser flows#2
wegamekinglc merged 3 commits into
mainfrom
test/playwright-e2e-suite

Conversation

@wegamekinglc

Copy link
Copy Markdown
Owner

Summary

The existing CI e2e job ran 11 browser tests concentrated on valuation and Curve Lab. This PR grows the suite to 21 tests covering the pages that previously had no browser-level coverage, all running against the canned Playwright backend (real FastAPI routers, in-memory store, deterministic canned pricing at unit PV 8.0):

  • portfolios.spec.ts — create via UI, seed product/model/trade via API, add trade, price the portfolio (asserts canned PV = 8.0 x notional, locale-formatted), cross-checks the run on /valuations, remove trade, delete with the confirmation dialog.
  • trades.spec.ts — create/update/delete (update driven through the real PUT endpoint since the page has no edit UI; UI re-verified after reload), plus the 409 delete guard for a product still referenced by a trade.
  • product_builder.spec.ts — all three templates load with the expected row counts, the DAL debug dump renders, save + load-back round-trips the editor state.
  • models.spec.ts — BS create/update/delete, Dupire wrong-shape surface shows the 422 banner, model delete guard.
  • dashboard.spec.ts — entity count cards, recent-run status badges (a synthetic failed run is route-mocked on top of the real list response, mirroring curves.spec.ts), valuation details expansion.

CI integration

The existing Browser smoke (Playwright) job runs the whole suite via npm run test:e2e (no workflow restructuring needed). Added one step: on failure the job uploads frontend/playwright-report and frontend/test-results (traces) as a 7-day artifact, so e2e failures are debuggable without rerunning locally.

Verification

  • DAL_PLAYWRIGHT_TEST_BACKEND=1 npm run test:e2e: 21 passed, three consecutive local runs (2.5 min each).
  • npm run build green; check_consistency.py green.

One known residual flake risk is documented in the suite: valuation.spec.ts asserts on the newest /valuations row, so run-producing specs gate on its UI-created trade to keep ordering deterministic; CI's retries: 1 cushions the rest.

…lows

New specs against the canned Playwright backend (real routers, in-memory
store, deterministic canned pricing):

- portfolios: create, add trade, price (canned PV), valuations list
  cross-check, remove trade, delete with confirmation
- trades: create/update/delete in place, and the 409 delete guard for a
  product still referenced by a trade
- product_builder: every builder template loads, debug dump renders, save
  and load-back round-trip
- models: BS create/update/delete, Dupire wrong-shape 422 banner, model
  delete guard
- dashboard: entity count cards, recent-run status badges (failed runs
  route-mocked on top of the real list response), valuation details expand

11 -> 21 e2e tests. The CI e2e job now uploads the Playwright report and
traces as an artifact on failure. README describes the suite's scope.
Copilot AI lite review requested due to automatic review settings August 14, 2026 20:16
@codacy-production

codacy-production Bot commented Aug 14, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 36 complexity · 19 duplication

Metric Results
Complexity 36
Duplication 19

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Biome's Qwik-specific useQwikValidLexicalScope rule fires on the new e2e
specs; this is a React project, so the rule is a false positive. Exclude
frontend/tests from the Biome engine, mirroring the Bandit exclusion for
backend tests.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands the frontend Playwright E2E suite to cover additional primary browser workflows (dashboard, products/product builder, models, trades, portfolios) against the canned Playwright test backend, and improves CI debuggability by uploading Playwright reports/traces when failures occur.

Changes:

  • Added new Playwright E2E specs covering CRUD flows, valuation lifecycles, delete-guard behavior, and dashboard/valuations UI assertions.
  • Documented the expanded E2E coverage in the README.
  • Updated CI to upload Playwright HTML report + trace artifacts on E2E failures.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Updates test documentation to describe expanded E2E coverage and CI artifact behavior.
frontend/tests/e2e/trades.spec.ts Adds trade lifecycle coverage (create/update via API PUT/delete) and product delete-guard assertions.
frontend/tests/e2e/product_builder.spec.ts Adds coverage for loading templates, debug dump rendering, and save/load round-trip behavior.
frontend/tests/e2e/portfolios.spec.ts Adds end-to-end portfolio lifecycle coverage including pricing and valuation list verification.
frontend/tests/e2e/models.spec.ts Adds model CRUD coverage, Dupire validation error coverage, and model delete-guard coverage.
frontend/tests/e2e/dashboard.spec.ts Adds dashboard and valuations-page coverage including synthetic failed-run badge/details verification.
.github/workflows/ci.yml Uploads Playwright report and trace artifacts on CI E2E failures (7-day retention).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +38 to +39
// Seeds product + model + trade via the API, prices the trade, and polls until
// the canned backend settles the run. Returns the valuation id.

@wegamekinglc wegamekinglc Aug 15, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 71d9df1: seedCompletedTradeValuation now returns pending.id (typed Promise<string>), so the comment is accurate and future callers can use the id. Verified locally — the dashboard spec passes (2 passed).

The comment claimed the helper returns the valuation id but the function
returned nothing. Return pending.id (typed Promise<string>) so the comment
is true and future callers can use it. Addresses Copilot review on PR #2.
@wegamekinglc
wegamekinglc merged commit 4b6e5e6 into main Aug 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants