Skip to content

test(e2e): journey for changing the password in Profile, Security - #156

Merged
aRustyDev merged 2 commits into
mainfrom
test/e2e-change-password-journey
Nov 14, 2026
Merged

aRustyDev merged 2 commits into
mainfrom
test/e2e-change-password-journey

Conversation

@aRustyDev

@aRustyDev aRustyDev commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

What

A browser journey for the last step of the locked-out person's way back in: the stock app's Profile → Security page changing the password (POST /auth/change-password/, X09, D-039, merged in #151). It runs on both targets (Thrust and the pinned Plane), and it is one spec in e2e/journeys/, so the worker-cf e2e cell runs it.

Refs #46 (it does not close it: the other M2 screens still need their journeys).

Why a journey and not a Rust test

The route has a parity fixture, a model and contract tests on four targets (G-33). What only a browser can say is that the stock page works with what the route answers: the form's own validation lets the new password through, the CSRF token it fetches is accepted, the cookies the answer sets are the ones the app keeps using, and the app sends the browser whose session ended to the sign-in page.

The journey

Two browsers share one account.

  1. Browser A signs up and makes a workspace.
  2. Browser B (its own context and cookies) signs in with the old password and must be on a page of the workspace.
  3. A opens /settings/profile/security, fills the three fields, clicks "Change password" and sees "Password changed successfully."
  4. A reloads and is still signed in.
  5. B reloads and is at the sign-in page.
  6. The old password is refused at the sign-in form.
  7. The new password signs in.

It does not stop at the toast or at the 200 in its own network log: it asks the server's state three ways (B's next page, the old password, the new one). Where a page is, is judged by its path alone, because the sign-in page of a visitor sent there carries the workspace in its query (/?next_path=/<slug>/) and a URL match took that for being inside it (my first draft; it would have passed the last step with nothing signed in).

Controls (rule 8: each must fail, with its words, and must show it fired)

Control What the browser does The journey must fail at
change-refused answers the change with the pin's 5135 and sends nothing "change the password:"
change-dropped answers 200 and sends nothing, so the app shows its toast and the log holds a 200 while the server changed nothing "the other browser is signed out:"

slow-page (must pass) and the target and count guards (now 3 of 3) cover the new journey too.

Two things the pin leg needed

  1. The pin throttles email-check, sign-in and sign-up to 10 a minute per address and counts the refused calls (AuthenticationThrottle). The password journey makes 8 of them and M1 makes 2, so the sign-in journey after them was answered POST /auth/email-check/ 429 on its first call (its HAR shows it). Thrust has no per-address throttle on those routes. e2e/support/throttle.ts holds those three calls in the browser until the minute has room, on the pin only, and the pin gets longer timeouts.
  2. The sign-in journey's pin branch had never run (fix(web): replace the forgot-password popover with a line that names the way back in, and journey the sign-in page #145 recorded "not run yet"). It opened the pin's "Forgot your password?" popover to read the SMTP text and left it open over the submit button: "subtree intercepts pointer events", a 90 s timeout. It now presses Escape and asserts the popover is gone. This is a change to m2-sign-in-methods.spec.ts, in the branch that only runs on the pin.

Measured

Run Result
scripts/e2e.sh plane-oracle (the pinned Plane, 2026-11-14) 3 of 3 passed: M1 5.0 s, this journey 7.3 s, the sign-in journey 55.6 s (about 50 s of it the pacing's wait)
the same run before the popover fix M1 and this journey passed; the sign-in journey failed at the popover (the 429 was already gone)
the first run on the pin, before any pacing M1 and this journey passed; the sign-in journey got the 429
the worker-cf e2e cell of this PR (CI run 43563612570, a real Worker) 3 of 3, change-refused and change-dropped failed with their words, slow-page passed, the count guard held (VERDICT: PASS); 34 checks passed and web was skipped, as it is for changes outside web/
scripts/e2e.sh worker-memory controls (2026-11-13, and after the rebase onto main) 3 of 3, every control failed with its words, slow-page passed, the count guard refused a skip (VERDICT: PASS)

Not measured

  • The controls on the pin (scripts/e2e.sh plane-oracle controls): the new controls are browser-side and were measured on worker-memory only.
  • worker-memory was not re-run after the popover edit, which is in the branch that runs on the pin only.
  • Three pin runs never reached a journey (the oracle's migrator timed out twice under a machine load of 300 to 850, and RabbitMQ in the stack exited at start once, fine on a retry); none says anything about a journey.

Not covered by the journey

The strength refusal in the browser (the form keeps the button disabled for a weak password; the rule is the Rust suites'), the temporary-password path end to end (the operator makes the account, the person signs in with it, changes it: its halves are G-32's and G-33's tests, and no journey walks them in one run), a HAR of this journey, and a second browser's session ending by a request made with its old cookie (the contract test holds that). All listed in G-34.

Files

e2e/journeys/m2-change-password.spec.ts (new), e2e/support/throttle.ts (new), e2e/support/controls.ts, e2e/support/context.ts, e2e/playwright.config.ts, scripts/e2e.sh, e2e/journeys/m2-sign-in-methods.spec.ts, and the docs: docs/src/testing/status.md (G-34, G-31's stale sentence), docs/src/testing/techniques/app-and-e2e.md, tools/e2e-plane/README.md, .agents/plans/contrail/TRACEABILITY.md.

🤖 Generated with Claude Code

aRustyDev and others added 2 commits November 14, 2026 00:37
The route has a parity fixture, a model and contract tests on four targets
(G-33). What only a browser can say is that the stock page works with what
the route answers: the form lets the new password through, the CSRF token it
fetches is accepted, the cookies the answer sets are the ones the app keeps
using, and the app sends the browser whose session ended to the sign-in page.

The journey uses two browsers. A signs up and changes the password; B, signed
in with the old password beforehand, must land on the sign-in page on its next
load; the old password is refused at the sign-in form and the new one signs
in. It does not stop at the toast or at the 200 in its own log: it asks the
server's state three ways.

Controls, each of which must fail with its words and must show it fired:
`change-refused` fails at "change the password:", `change-dropped` (the toast
and a 200 in the log, a server that changed nothing) fails at "the other
browser is signed out:". `slow-page` and the target and count guards (now
3 of 3) cover the new journey too.

Where a page is, is judged by its path alone: the sign-in page of a visitor
sent there carries the workspace in its query, and a URL match took that for
being inside it.

The pinned Plane throttles email-check, sign-in and sign-up to 10 a minute per
address and counts the refused calls. This journey makes 8 of them and M1's
makes 2, so the sign-in journey after them was answered 429 on its first call
(the first run on the pin: M1 and this journey passed, that one did not).
support/throttle.ts holds those three calls in the browser until the minute
has room, on the pin only, and the pin gets longer timeouts.

With the pacing, the next pin run got past the throttle and failed in the
sign-in journey's own pin branch, which had never run: it opened the pin's
"Forgot your password?" popover to read the SMTP text and left it open over
the submit button ("subtree intercepts pointer events", a 90 s timeout). It
now presses Escape and asserts the popover is gone.

Measured: on the pinned Plane `scripts/e2e.sh plane-oracle` passes 3 of 3
(M1 5.0 s, this journey 7.3 s, the sign-in journey 55.6 s, about 50 s of it
the pacing's wait). On a Worker `scripts/e2e.sh worker-memory controls` passes
3 of 3 with every control failing with its words and slow-page passing, before
and after the rebase onto main (the popover edit came later and is in the
branch that runs on the pin only). Not measured: the controls on the
pin, and the worker-cf cell (CI runs it). Three pin runs never reached a
journey (the oracle's migrator timed out twice under a machine load of 300 to
850, and RabbitMQ exited at start once); none says anything about a journey.
G-34 and the traceability rows say so.

Refs: #46
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
PR #156's `worker-cf e2e` cell (CI run 43563612570) ran the three journeys on
a real Worker: 3 of 3 passed, `change-refused` and `change-dropped` failed
with their words, `slow-page` passed and the count guard held (VERDICT: PASS).
G-34 and the traceability row said the cell had not run yet; they now say what
it did, and G-34 no longer lists it as not covered.

Refs: #46
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@aRustyDev
aRustyDev merged commit 4658154 into main Nov 14, 2026
35 checks passed
@aRustyDev
aRustyDev deleted the test/e2e-change-password-journey branch November 14, 2026 06:35
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