Repository navigation
fix: fix failed mfa e2e testing - #686
Conversation
There was a problem hiding this comment.
ℹ️ Minor suggestions only. The MFA fix itself is correct, and the rewritten passkey spec is in good shape. Two nits and one coverage note below.
Reviewed changes
- MFA sign-in setup fix —
mfa.spec.tsnow clicks the "Can't scan? Enter this key instead." button before reading the secret (the key is hidden behind that toggle inMfaLoginSetup.tsx) and bumps the setup heading wait to 15s. - Passkey spec rewrite —
passkeys.spec.tsis reworked into three scenarios (add → sign in → remove, forced setup on the sign-in page, credential-less authenticator refused) with a local CDP virtual-authenticator helper, and is gated to Chromium-based projects.
ℹ️ Two passkeys.feature scenarios are no longer implemented
apps/e2e/features/auth/passkeys.feature still specifies six scenarios, but the rewrite only implements four of them. The dropped two are the passkey-only challenge (mfa_methods is exactly ["passkey"] and the code form is absent) and the removal-confirmation scenario (the dialog never asks for a password, and removal fails when no authenticator can approve it). Those were the only assertions that removal re-auth is passkey-based rather than password-based, so their loss lets a future change to that flow ship green.
Technical details
# Missing passkey scenarios
## Affected sites
- `apps/e2e/features/auth/passkeys.feature:18` — "A passkey-only account is challenged for a passkey, not a code" (no implementing test after the rewrite)
- `apps/e2e/features/auth/passkeys.feature:30` — "Removal is confirmed with a passkey, not the password" (no implementing test after the rewrite)
- `apps/e2e/tests/auth/passkeys.spec.ts` — the rewrite dropped the `rawLogin` + `mfa_methods` assertion, the `dialog.getByLabel("Password")` absence check, and the `clearCredentials()` failure path
## Required outcome
Either restore those two scenarios in `passkeys.spec.ts`, or update `passkeys.feature` to match the reduced coverage (the README treats feature files as the specification).
## Suggested approach (optional)
The stranger-authenticator test already exercises the "cannot approve" path at sign-in; adding a `clearCredentials()`-style case to the remove dialog would cover the removal half.deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Reverted the
passkeys.spec.tsrewrite, restoring the file to itsmasterversion. This also retires the three findings from the prior review — the header now points atfeatures/auth/passkeys.feature,helpers/passkey.tsis imported again (no longer dead), and the two droppedpasskeys.featurescenarios are back. - Kept the MFA sign-in setup fix intact: click "Can't scan? Enter this key instead." before reading the secret (the key is hidden behind that toggle in
MfaLoginSetup.tsx), and wait 15s for the "Secure your account" heading.
The fix is correct — MfaLoginSetup.tsx:484 toggles setShowKey(true) to reveal the p.select-all secret, so the added click is exactly what unblocks the read.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Summary
Fixes the MFA e2e test that failed on every browser in run 41276372265, and confirms the existing passkey e2e spec passes alongside it.
The failure
mfa.spec.ts› "a protected user is walked through setup on the sign-in page" failed in all 5 browsers. The passkeys change (b2154cb) turned the sign-in setup screen into a method picker, and the authenticator secret now stays hidden until the user clicks "Can't scan? Enter this key instead." The test never clicked it, sop.select-allnever appeared.Changes
apps/e2e/tests/auth/mfa.spec.tspasskeys.spec.tsis unchanged from master. An earlier commit on this branch rewrote it by mistake, dropping two of its six scenarios; that rewrite is reverted.Testing
Against the local e2e docker stack:
mfa.spec.ts: 34/34 pass on chromium and mobile-chrome.passkeys.spec.ts(unchanged): 12/12 pass on chromium and mobile-chrome. It skips on the other browsers, which have no virtual authenticator.Not addressed
The same run also had a few tests that failed once and passed on retry (role-badges selector, "assigning roles without writing users", and single hits in project management, view-settings, git-task-detail and the login/pagination UX tests). I left those alone.