Fixed flaky staff password acceptance tests - #29378
Conversation
no ref The password form applies its intended focus after a short delay, which could race with Playwright filling another field and redirect the input. Waiting for the expected focus makes the interaction deterministic without retries or sleeps.
WalkthroughThe staff password acceptance tests now verify that the new-password field is focused when opening another staff member’s password form. The own-password flow captures password and save controls, asserts focus on the old-password field, fills the new and confirmation passwords, verifies the validation message, and then fills the old password. Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 2m 38s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin |
✅ Succeeded | 2m 17s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 20s | View ↗ |
nx run-many -t lint -p @tryghost/admin,ghost-mo... |
✅ Succeeded | 53s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 36s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-16 12:31:40 UTC

What changed
Why
The password form applies focus 100 ms after it opens. Playwright fills password inputs in separate focus/select and text-insertion steps, so the delayed focus could land between those steps and redirect text into a different field. That caused the self-password validation assertion to intermittently observe the wrong validation state on main.
Failed run: https://github.com/TryGhost/Ghost/actions/runs/29460895269/job/87504062007
Validation