feat: Playwright E2E test suite — 41 tests across feedback, student management, and print flows - #74
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ubmitFeedback, backdateFeedback)
… for submission block Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add has_feedback/feedback_completed_at to WeeklyPacketSummary so the
plans page correctly shows "Edit Feedback" vs "Provide Feedback"
- Fix 204 No Content proxy crash in Next.js catch-all route
- Reset test DB on each run (delete + recreate) so stale data can't
cause test pollution across runs
- Kill any existing backend on port 8182 before starting fresh test
backend, preventing old code from serving tests
- Fix strict mode violations in test selectors (getByRole with exact
match, scope Mathematics to studentCard, Close button exact match)
- Remove .catch(() => {}) on createStudent calls so failures surface
instead of creating orphan packets without a student_profiles row
- Use unique student name in create-student test to avoid cross-run
collisions when DB reset fails
- Add label/id linkage to Input component for getByLabel locators
- Add role=dialog/aria-modal to Modal component for getByRole locators
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds an e2e-tests job that runs on every PR and push to main. The job: - Creates a Python venv and installs backend dependencies (uvicorn, etc.) - Installs Node dependencies and Playwright's chromium browser - Runs all 41 E2E tests via `npm run test:e2e` - Uploads the Playwright HTML report as an artifact on failure CI=true triggers stricter Playwright config: forbidOnly, retries=1, reuseExistingServer=false (always starts a fresh Next.js dev server). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
test:e2enpm script that spins up the FastAPI backend and Next.js dev server, seeds the SQLite test DB, runs 41 chromium tests, and tears downWhat's in this PR
Test infrastructure
frontend/playwright.config.ts— chromium, fullyParallel, global setup/teardown, webServer (port 3002)frontend/global-setup.ts— kills stale backends, reinitializes test DB, spawns fresh uvicornfrontend/global-teardown.ts— kills backend process on exitscripts/e2e_seed.py— CLI helpers:init_db(delete + recreate),create_packet,backdate_feedbackfrontend/e2e/fixtures/api.ts—createStudent,createPacket,submitFeedback,backdateFeedbackTest specs (41 tests, all passing)
frontend/e2e/feedback.spec.ts— 33 tests: plans page empty state, pending packet card, plan detail modal (open/close/print/feedback state), feedback modal (first submission + editing)frontend/e2e/students.spec.ts— 6 tests: create validation, create success, edit pre-population/rename, delete confirmation/executionfrontend/e2e/print.spec.ts— 2 tests: direct API response + Next.js proxy reachabilityBug fixes found during testing
src/main.py:WeeklyPacketSummarywas missinghas_feedbackandfeedback_completed_atfields — Pydantic filtered them out so the UI always showed "Provide Feedback" regardless of DB statefrontend/app/api/[...path]/route.ts: 204 No Content responses crashed the proxy (passed a body tonew NextResponsewith status 204) — DELETE student and feedback submit returned 502 through the UIfrontend/components/ui/Input.tsx: Addedid/htmlForlinkage sogetByLabellocators work in testsfrontend/components/ui/Modal.tsx: Addedrole="dialog"/aria-modalsogetByRole('dialog')locators workTest plan
npm run test:e2efromfrontend/— 41/41 passing, ~3 minhas_feedback: truein API response after fix🤖 Generated with Claude Code