Files
Convivo/e2e
Lago c49a94fe80 fix(admin): per-row check-in toggle; feat(db): front-desk gate + badge copies
Registrations table felt buggy because both row actions did
setBusy(true) -> write -> reloadRegistrations() -> setBusy(false):
the list is sorted by points, so a reload made the row you just
touched jump (or vanish under a Checked-in filter), and the single
`busy` flag disabled every control in the table for the whole
request. The fix is per-row in-flight state (busyIds + withRowBusy)
and no reload at all: the toggle patches its own row's checked_in
plus the points delta the RPC returns, the type change patches
`type`; a rejected write rolls both back. Only the touched row is
disabled, shows a "Saving…" pulse, and two rows can save at once.
Toggle hit area is now 40x41 px with a focus-visible ring.

Front-desk gate: checkin_attendee reads registrations.checked_in
and raises "This attendee needs to be checked in at the front desk
first." when it is not true, and no longer sets checked_in as a
side effect. checkins has no INSERT policy, so the RPC is the only
write path and the gate cannot be bypassed. The scanner shows a
dedicated "Not checked in yet" sheet instead of a toast.

Badge copies: events.badge_copies (1..4, default 1). welcome_checkin
sends that many pgmq jobs in one transaction (the Pi prints one
label per job, so N jobs = N labels; no worker change) and clamps
the value again itself. preview_welcome_checkin gained a `copies`
column (drop + recreate) so the popup states the real count. Manual
reprint still prints exactly one. Set from Settings -> Badge
printing (active event) and the Events form, always as a
single-column update; the Settings badge section now renders even
when the LLM settings call fails.

Tests: badge_print 113 (+6), leaderboard 47 (+1), new
registration-checkin-toggle (6), front-desk-gate (3),
welcome-badge-copies (3); the stale registrations-PATCH mock in
registration-ticket-merge now targets set_registration_checked_in,
the ambiguous Save button is "Save copies", and the print-copy
assertion tolerates the typographic apostrophe. Docs updated
(rpcs, schema, printing, tests, admin-app, screens) with a release
record; NOT deployed - see docs/releases/2026-10-19.md.
2026-10-19 15:10:20 +02:00
..

Convivo E2E Acceptance Suite

Playwright-based end-to-end acceptance tests for the Convivo application, covering all four roles (Staff, Attendee, Speaker, Sponsor) across the full spec (CONV-STAFF-AUTH-001 → CONV-E2E-002).

Running

cd e2e
npm install          # first time
npx playwright install chromium   # first time
npx playwright test              # full suite
npx playwright test <name>       # a subset (e.g. `feedback`, `sponsor`)
npx playwright show-report reports/html

The suite runs against the live local stack (app :3000, Kong :54321, Postgres container supabase_db_Convivo). Every test resets the relevant backend state first (see src/helpers/reset.ts), so the suite is self-contained and re-runnable.

Layout

  • playwright.config.ts — workers=1, 90s timeout, trace/screenshot/video on failure, HTML report to reports/html.
  • src/helpers/ — config (identities, session ids), db (psql assertions), api (PostgREST/Auth client for backend authorization checks), reset (state reset + temporary-identity setup), auth (login flows), multi (isolated per-user browser contexts).
  • src/pages/ — page objects (App, Home, Agenda, Scan, Connections, Profile, Feedback).
  • tests/ — the spec cases, grouped by feature.

Design decisions

  • Isolated BrowserContext per user — multi-user tests (real-time gate lift, connections, E2E journeys) create one context per participant so sessions never leak and real-time behaviour is observed naturally.
  • Backend state validation — assertions read the resulting persisted state through a psql helper (spec §40), not just UI toasts. Authorization cases call the RPC as a specific user (via their JWT) to prove the backend enforces the rule, not just the frontend (spec §30/§39).
  • Stable data-testid selectors — the app was instrumented with testids so the suite is resilient to copy/label changes.
  • Real-time = 4s polling — the app lifts the check-in gate via a 4s poll (not Supabase Realtime); the real-time tests wait for that poll to fire.

Results

44/44 passing (3.3 min, single worker).

Area Cases Status
Staff auth CONV-STAFF-AUTH-001..005 ✅
Staff UI CONV-STAFF-UI-001 ✅
Welcome check-in + attendee access CONV-CHECKIN-001..002, CONV-ATT-AUTH-001..003 ✅
Connections CONV-CONN-001..008 ✅
Session check-in CONV-SESSION-001..003 ✅
Profile visibility CONV-PROFILE-001..005 ✅
Speaker + material CONV-SPEAKER-001, CONV-MATERIAL-001..004 ✅
Sponsor CONV-SPONSOR-001 ✅
Feedback CONV-FEEDBACK-001..005 ✅
E2E journeys CONV-E2E-001..002 ✅
Role security matrix §39 (welcome/session check-in, material, feedback) ✅

Findings

  • Speakers have NULL qr_token in the seed — the reset helper assigns CVV-SPK-9001 and re-hashes the auth password so the speaker can log in.
  • No sponsors exist in the seed — the reset helper creates one ([email protected] / CVV-SPO-9001).
  • Real-time is 4s polling, not Supabase Realtime — the gate lift and check-in activation are driven by a 4s poll in App.tsx.
  • create_connection_request is idempotent — re-requesting an existing connection returns the existing row rather than erroring.
  • GoTrue 500s on NULL auth.users token columns — newly created auth users must set confirmation_token, email_change_token_new, email_change, recovery_token, reauthentication_token, phone_change_token to '' (empty string, not NULL) or the login endpoint returns a 500.
  • The speaker has 2 sessions — so the pending-material pill shows a count (not 0) even after uploading one session's material; tests assert the count decreases by exactly 1.