Repository navigation
fix(e2e): say why the target refused the test account's sign-in - #2112
Merged
Merged
Conversation
The auth setup waited 30 seconds for the URL to leave /sign-in, so a 401 from a target with no such account surfaced as a bare waitForURL timeout (the first dev run of the post-deploy gate). It now reads the /Login/ response first and names the cause: 401 is an unknown email or wrong password, 403 an account that cannot sign in with its password. Checking the response also fixes a false pass: an unverified account's 403 sends Studio to /verifying, which leaves /sign-in too, so the setup saved a session-less state and passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A sign-in request that fails outright (central-manager down, or a proxy blocking it) never produces a response, so waiting for one sat out the 30-second timeout. Waiting for the request and reading its response() instead returns null on failure, and the setup now names the origin and the network error. Also trims comments the review found restating the messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
request.response() has no timeout of its own and Studio's API client gives up only at 60 seconds, the test's whole budget, so a central-manager that accepts the connection and never answers still ended in Playwright's generic test timeout. The setup now gives up after 30 seconds with the no-response message, reworded to cover a server that is down as well as one a proxy blocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage Report
File CoverageNo changed files found. |
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.
⊙ Problem
The first
devrun of the post-deploy gate (run 43892069560) failed its auth setup with a bare 30-secondwaitForURLtimeout. The real cause was a 401 from/Login/: the test account did not exist ondev. The setup also passed with no session for an unverified account, whose 403 sends Studio to/verifying, which also leaves/sign-in.💡 Solution
/Login/response before the URL and fails with the cause: 401 is an unknown email or a wrong password (accounts are per environment), 403 an account that cannot sign in with its password, no response within 30 s an unreachable central-manager, anything else a likely regression.🔧 Changes
auth.setup.tswaits for thePOST /Login/request around the Sign In click and reads itsresponse(), which isnullwhen the request failed outright and is cut off after 30 s, since neither it nor Studio's 60 s API timeout ends before the test does. It throws on either, and on any non-2xx, before the existing check that the URL left/sign-in.loginRefusal.ts(new) holds the message for each status and for no response, and the predicate that picks the sign-in request out of the page's traffic.deploying.md: the test-account prerequisite now says the account must exist and be verified on each target, and that sign-in answers 401 where it was never created.⚖️ Alternatives
/verifyingfrom the URL check and reading the form's inline error would depend on UI wording; the response status does not, and covers 401 and 403 alike.Sign-in returned ${status}would lose only the per-status advice, but the advice is the point, and a module lets it be unit-tested without a browser.✅ Verification
setupproject against a local Vite server whose central-manager was a localhost stub. A stubbed 401, a 403 and a stopped stub (ERR_CONNECTION_REFUSED) each fail within seconds with their message, a stub that never answers fails at 30 s, and a 200 still passes. Withstage's setup, the same 401 timed out after 30 s, and the 403 passed with no session.loginRefusal.unit.spec.tscovers each status, the no-response message and which requests count as the sign-in. Changing either status check, the body clip, the origin, the missing-error fallback, thePOSTcheck or the path match turns a test red.tsc -b, the e2e project'stsc --noEmitandunitproject (49), oxlint, dprint.🤖 Generated with Claude Code
Related PRs: #2107 overlaps (also edits
deploying.md)Complexity: easy
Deferred findings
384f4d7cf5467ea7nit correctness —e2e/tests/loginRefusal.ts— isLoginRequest endsWith('/Login/') broader than the login collection — NOT FILEDReview-Coverage: authored=claude; ran=gemini,cursor-composer,codex; adjudicated=domain; declined=cursor-grok,muse; rounds=3; full=2 @ 18a4177
Review-Attention: skim ~2m (decisions: do-less-alternative, hung-response-bound, fail-on-any-non-2xx) @ 18a4177