Skip to content

Add Playwright e2e suite + multi-buy advantage undo regression spec - #286

Merged
Daelso merged 1 commit into
mainfrom
e2e-scaffolding
May 16, 2026
Merged

Add Playwright e2e suite + multi-buy advantage undo regression spec#286
Daelso merged 1 commit into
mainfrom
e2e-scaffolding

Conversation

@Daelso

@Daelso Daelso commented May 15, 2026

Copy link
Copy Markdown
Owner

Summary

Stand up @playwright/test scaffolding and the first browser-driven regression spec, codifying the multi-buy advantage undo flow that PR #284 fixed and that Round 2 QA verified by hand.

The structure is intentionally minimal — one spec, one auth fixture, one DB-seed helper module, two domain helpers (Quasar + Spend XP / XP Log) — but it's complete enough that follow-ups can add specs in ~10 minutes each.

What's in the box

  • playwright.config.js — single chromium project at 1600x900, serial one-worker (specs share MySQL state), webServer auto-boots node server.js on :5000 and npx quasar dev on :8080
  • tests/e2e/fixtures/auth.jsloginAsTestxp(context) posts to /user/login, copies httpOnly cookies onto the browser context
  • tests/e2e/fixtures/seed.jsseedVampire / seedGarou / seedHunter clone a template character into testxp's ownership with fresh XP and empty xp_log; deleteCharacter(table, id) for teardown
  • tests/e2e/helpers/quasar.jspickQSelect(label, value) and hideWebpackOverlay(page)
  • tests/e2e/helpers/spendXp.js + tests/e2e/helpers/xpLog.js — domain helpers
  • tests/e2e/xp-log/multi-buy-advantage-undo.spec.js — regression coverage for PR Fix XP-log undo overshoot for multi-buy advantage/flaw #284 across V/W/H
  • tests/e2e/README.md — prereqs (MySQL, testxp, .env), conventions, roadmap

Test plan

  • npm run test:e2e → 3/3 pass in ~25s on a warm cache
  • First-run cold compile of quasar dev fits inside the 240s webServer timeout
  • Spec leaves no DB rows behind (seed/teardown round-trips cleanly)
  • webServer.reuseExistingServer: true lets the spec attach to dev servers if you already have them running locally

Roadmap (deferred to follow-up PRs)

  • GitHub Action wiring npm run test:e2e into PR checks — deferred so the spec can prove stable locally first
  • More specs per the README: ±3xp summary-button buys, XP-log note editing persistence, cross-line favorites round-trip (now testable post-Fix /favorites/my 500 + edit-page render leak on V/W/H #285), Hunter edges/perks unlock, public-vs-edit auth check, PDF export
  • VtM clan-specific XP categories (Tremere rituals, Hecata oblivion ceremonies)

Side note

The webServer logs surfaced an unrelated Unknown column 'page' in 'field list' error from the rites table during a Werewolf editor load. Not in scope for this PR but worth filing — the Rites model expects a column the schema doesn't have.

Adds @playwright/test plus a minimal `tests/e2e/` layout that other
specs can build on:

- `playwright.config.js` — single chromium project at 1600x900 (the
  edit pages collapse the right-side nav at narrower widths), serial
  one-worker execution (specs share MySQL state), webServer auto-boots
  `node server.js` on :5000 and `npx quasar dev` on :8080.
- `fixtures/auth.js` — `loginAsTestxp(context)` posts to `/user/login`
  with the agreed test creds, copies the resulting httpOnly cookies
  onto the test browser context.
- `fixtures/seed.js` — `seedVampire` / `seedGarou` / `seedHunter`
  clone a template character into testxp's ownership with a fresh XP
  bank and empty `xp_log` so each spec starts from a known baseline;
  paired `deleteCharacter(table, id)` for teardown. Reads DB creds
  from `.env` directly.
- `helpers/quasar.js` — `pickQSelect(label, value)` encodes the
  click-then-pick ritual that's needed to drive Quasar's
  portal-rendered q-select dropdowns; `hideWebpackOverlay(page)`
  removes the runtime-error iframe (a benign ResizeObserver loop
  mostly) that intercepts pointer events and breaks subsequent clicks.
- `helpers/spendXp.js` + `helpers/xpLog.js` — open the dialogs, drive
  multi-buy purchases, undo top entries, read summary state.
- `xp-log/multi-buy-advantage-undo.spec.js` — regression coverage for
  PR #284 across all three game lines (VtM, Werewolf, Hunter): seed
  fresh char, buy Advantage x2 + x3 in one Spend XP session, save,
  undo top entry, assert advantages_remaining drops by exactly delta=3
  (not back to session-start). This is the empirical check the
  Round 2 QA report ran by hand; codifying it stops regressions.

Adds `npm run test:e2e` and `tests/e2e/README.md` documenting the
prereqs (MySQL, testxp user, .env) and conventions.

Deliberately deferred to follow-up PRs: GitHub Action (get the spec
stable locally first), W/H gift-purchase specs, Hunter edges/perks,
PDF export verification, favorites round-trip (depends on PR #285's
fix being on main, which it is). Ideas listed in the README roadmap.

Verified: `npm run test:e2e` → 3 passed in 24.6s.
@Daelso
Daelso merged commit 3620f90 into main May 16, 2026
2 checks passed
@Daelso
Daelso deleted the e2e-scaffolding branch May 16, 2026 00:06
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.

1 participant