Add Playwright e2e suite + multi-buy advantage undo regression spec - #286
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stand up
@playwright/testscaffolding 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-bootsnode server.json :5000 andnpx quasar devon :8080tests/e2e/fixtures/auth.js—loginAsTestxp(context)posts to/user/login, copies httpOnly cookies onto the browser contexttests/e2e/fixtures/seed.js—seedVampire/seedGarou/seedHunterclone a template character into testxp's ownership with fresh XP and emptyxp_log;deleteCharacter(table, id)for teardowntests/e2e/helpers/quasar.js—pickQSelect(label, value)andhideWebpackOverlay(page)tests/e2e/helpers/spendXp.js+tests/e2e/helpers/xpLog.js— domain helperstests/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/Htests/e2e/README.md— prereqs (MySQL, testxp, .env), conventions, roadmapTest plan
npm run test:e2e→ 3/3 pass in ~25s on a warm cachewebServer.reuseExistingServer: truelets the spec attach to dev servers if you already have them running locallyRoadmap (deferred to follow-up PRs)
npm run test:e2einto PR checks — deferred so the spec can prove stable locally firstSide note
The webServer logs surfaced an unrelated
Unknown column 'page' in 'field list'error from theritestable during a Werewolf editor load. Not in scope for this PR but worth filing — theRitesmodel expects a column the schema doesn't have.