55 - Add browser test for registration #62
No reviewers
Labels
No labels
app
backlog
bug
ci-cd
contribution welcome
duplicate
enhancement
good first issue
help wanted
question
testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/dishplanner#62
Loading…
Reference in a new issue
No description provided.
Delete branch "55-add-browser-test-for-registration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #55.
What this does
Adds
tests/Browser/Auth/RegisterTest.php— four Pest browser tests covering/register, following the conventions of the existingtests/Browser/Auth/LoginTest.php. Test-only: no production code, notests/Pest.phpchange, nophpunit.xmlchange.registers successfully/dashboardandassertSee('Test User')to prove the session is authenticated, not just redirectedrequires all registration fieldsassertScriptthat all four inputs are.required;assertAttributethat email istype="email"and both password inputs aretype="password"; then asserts the form did not submitrejects a mismatched password confirmation/register, seesconfirmation does not matchrejects a duplicate emailcreatePlanner(), then seeshas already been takenOne design decision worth reviewing
The ticket lists "missing fields" and "invalid email" under validation errors render in the form. They cannot render server-side messages. All four fields in
resources/views/auth/register.blade.phpcarryrequired, and email istype="email", so the browser blocks submission client-side — the request never reaches$request->validate().Both cases are therefore asserted as client-side gating (
assertScript/assertAttributeplus "the path did not change"), mirroring whatLoginTest.php:31-39already does. The server-sideemailrule remains covered at feature level intests/Feature/RegistrationTest.php. This was raised and approved during planning.Two supporting details, both verified rather than assumed:
Translatorand the vendoredvalidation.php(this repo has nolang/override), then asserted as distinctive substrings rather than full sentences.Rules\Password::defaults()resolves tomin(8)— nodefaultCallbackis registered anywhere. Tests usepassword123, deliberately off the boundary.Verification
The browser tests in this PR have never been executed. The dev container is Alpine/musl and Playwright's browser builds are glibc-linked, so
tests/Browserfails there regardless of correctness (documented in.claude/PLATFORM.md). CI on Debian is the first and only place these run — please confirm theBrowser testsCI step is green before merging. Correctness was otherwise derived by reading the rendered markup, the controller, and the reference test.Unrelated flaky test found (not fixed here)
The final gate run hit a failure in
tests/Unit/Schedule/ScheduleGeneratorTest.php:138:It is intermittent and unrelated to this branch — 5 of 6 runs on this identical tree were green, and this commit adds only a browser test that
phpunit.xmlnever executes.Root cause: schedule generation picks dishes with unseeded
->random()(RegenerateScheduleForDateForUsersAction.php:33,RegenerateScheduleDayForUserAction.php:28,45,DraftScheduleForDateAction.php:22,GenerateScheduleForMonthAction.php:90). The test fixture has two dishes, so whether the recurring one is scheduled more than once is a coin flip.Not fixed here deliberately — it touches an unrelated subsystem and would break commit atomicity. Note that
c3a5532 60 - Make schedule test assertion counts deterministicalready addressed this same flakiness class in this same file. Suggest a follow-up ticket.Update — CI is green, browser tests have now actually run.
The PR body's caveat that these tests "have never been executed" is no longer true. CI Run #26 succeeded (2m12s) on this branch, which is the Debian CI image running
vendor/bin/pest tests/Browser. All four new browser tests executed and passed there.Two notes for the reviewer:
9054c25 55 - Move the dev image to Debian so Playwright can runlanded onrelease/v0.9.0at 23:32, after this branch was cut fromb543f5f. Rebasing was considered and deliberately declined — this PR stays a test-only change. It merges cleanly regardless, since the two commits touch disjoint files./opt/playwrightmissing,PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1still set..claude/PLATFORM.mdhas been annotated with this. It does not affect CI, which has its own Debian image.The flaky
ScheduleGeneratorTestnoted in the description is unchanged and still worth a follow-up ticket.WIP: 55 - Add browser test for registrationto 55 - Add browser test for registration