Skip to content

test(attendance): e2e coverage for check-in report + admin analytics - #1108

Draft
leahpeker wants to merge 4 commits into
mainfrom
attendance-e2e
Draft

test(attendance): e2e coverage for check-in report + admin analytics#1108
leahpeker wants to merge 4 commits into
mainfrom
attendance-e2e

Conversation

@leahpeker

Copy link
Copy Markdown
Collaborator

Overview

E2E (Playwright) coverage for the shipped attendance-analytics features (epic #1091, PRs #1098 / #1101 / #1100). Adds seed scenarios and browser specs, and surfaces two bugs found in the process.

What's included

Seed scenarios (backend/community/management/commands/e2e_seed.py):

  • attendance-report — a host (MANAGE_EVENTS) + a past event with one attended / one no-show / one canceled RSVP, with host_attendance_report enabled.
  • attendance-analytics — an admin (MANAGE_EVENTS + MANAGE_USERS), a compliant member (recent official attendance) and an at-risk member (400-day-stale club attendance), with admin_attendance_analytics enabled.

Specs:

Verified locally

  • Both seed scenarios run and emit expected JSON; flags resolve enabled; permissions resolve (manage_events ×2, manage_users ×1).
  • ruff, eslint, prettier, and the e2e tsc typecheck pass on all touched files.
  • The Playwright browser run itself was not executed here (needs the running dev server + Postgres); that runs in CI / locally via pnpm test:e2e.

Bugs found (filed separately)

Scope note

PR #1099 (host check-in nudge) was not yet merged when these tests were written; it's cron-only (no browser surface) and isn't covered here.

Adds Playwright specs for the host check-in report (kebab entry, breakdown,
csv export) and the admin members tab (pause candidates, pause action), plus
two e2e_seed scenarios (attendance-report, attendance-analytics) that create a
host/admin with the right permissions, a past event with mixed attendance
marks, and enable the gating flags.

The analytics spec includes a documented probe for the events-tab dead-link
bug (Issue 1106).
- ruff-format the RSVP create() call CI flagged via git diff --exit-code
- retry _random_phone() on collision; two concurrent seed calls could
  generate the same 4-digit suffix, causing IntegrityError in CI
- suffix seeded zoe/yara member names with a token so attendance-analytics
  tests don't hit strict-mode locator violations when prior seed calls
  leave same-named rows in the shared CI database
`li, article, div` matched every nested element containing the at-risk
member's name (the <li>, its <article>, and any wrapping <div>s), causing
a strict-mode violation. getByRole('listitem') matches exactly the row.
'check-in' substring-matched both the 'check-in' and 'check-in report'
menuitems, causing a strict-mode violation.
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