Repository navigation
fix(playwright): open the own profile by URL after the Users.spec password reset - #37113
Conversation
…sword reset A password change now ends the user's sign-ins (#36952), so the UI's logout call 401s. The 401 handler stores the current page, the user's own profile, as the post-login redirect. After the re-sign-in the app returns there on its own, and visitOwnProfilePage then clicks View Profile on the page that is already open: nothing navigates, no user request fires, and its waitForResponse hangs until the test timeout. Open the profile by URL instead and assert the owner-only Manage Profile button, which proves the new password signed in this user.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟢 Low risk · The Playwright-only update changes navigation and assertions in two password-reset tests; application runtime behavior remains unchanged. Test-only fix to the Users.spec Reset Password tests, which now open the own profile by URL after re-sign-in and assert Manage Profile to confirm the new password signed in the correct user. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes
Pages/Users.spec.ts› Reset Password for Data Consumer and Reset Password for Data Steward. Both started failing on every attempt in AUT nightly 41934979088 (1.12.14 ➡ main): Data Consumer failed on MySQL and PostgreSQL, Data Steward on PostgreSQL. The night before (41784589036) both passed in about 9s.What failed. All 9 attempts stop at the same place, the last line of each test:
Root cause. #36952 (merged 2026-11-04) changed the backend so that password changes end sign-ins: a user's own password change now ends their live sessions. The trace shows what follows from that:
PUT /users/changePasswordreturns 200. The test then logs out through the UI, andPOST /api/v1/users/logoutnow returns 401.handleStoreProtectedRedirectPath(AuthProvider.tsx) while the page is still the user's own profile. That writesredirectUrlPath=/users/<name>.signIn()lands on/my-data.PermissionProvider.redirectToStoredPaththen sends the app back to/users/<name>with no user action. The trace has the profileGET …?fields=…&include=allat 06:28:06.546. The dropdown click happens at 06:28:06.64, and theuser-nameclick with its listener at 06:28:06.84.visitOwnProfilePagethen clicks View Profile on the profile page that is already open. Nothing navigates, so no new user request fires, and the wait runs until the 60s test timeout.The return-to-last-page behaviour is intended: after a forced sign-out, the user lands back where they were. So this is a test bug, not a product bug. The test assumed the re-sign-in always leaves the page on
/my-data.Fix. After the re-sign-in, both tests now open the profile by URL instead of through the dropdown, following handbook §Navigation. Then they assert Manage Profile (
user-profile-manage-btn). That button renders only for the profile's owner or an admin (hasEditPermission), and neither role is an admin, so it proves the new password signed in this user. The old dropdown click never asserted that. This works whether or not the app restored the redirect first: if it did, the goto targets the same path andredirectToStoredPathdoes not navigate again.The shared
visitUserProfilePagehelper is not used here. It checksuser-email-value, and the email is masked for non-admin viewers, so it only works when an admin is viewing.Result (HTML report screenshot): attach
users-spec-report.png: fullUsers.spec.ts, 27/27 passedType of change:
High-level design:
N/A, a test-only change in one spec.
Tests:
Use cases covered
/my-dataor returns to the profile it stored before the forced sign-out.Unit tests
Not applicable, Playwright only.
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
playwright/e2e/Pages/Users.spec.ts, the two Reset Password tests only.yarn lint:playwrightshows 0 errors.tsc -p playwright/tsconfig.jsonshows no errors in the file (2 pre-existing errors in unrelated specs).:8585, after--project=setup, with--no-deps --retries=0. That backend predates fix(security): third batch of backend security-hardening fixes #36952, so the logout there does not 401. To reproduce the CI state, a throwaway, uncommitted edit seeded theredirectUrlPathcookie that the 401 handler writes, just before the re-sign-in:origin/mainspec + seeded cookie: 2 failed, with the exact CI error (waitForResponse "/api/v1/users/name/*?fields=*&include=all"atcommon.ts:634, test timeout).--repeat-each=3: 6 passed.--repeat-each=3: 6 passed.Users.spec.tsas committed (entity-matrix tests excluded: they needentity-data-setup): 27 passed.Checklist:
🤖 Generated with Claude Code