test(e2e): make fillTotpStep + setInputValue aware of the BUNYIP-331 auto-submit #425
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-server!425
Loading…
Reference in a new issue
No description provided.
Delete branch "test/BUNYIP-331-autosubmit-aware-fillTotpStep"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR #424 CI failed at
login.ts:231 fillTotpStepinglobal.setup.ts:Test timeout of 60000ms exceededwaiting for the submit button on the 2FA form. The trace shows the browser had already navigated off/login/2fato the OIDC callback URL (?code=...&state=...) by the time we tried to click. Root cause is BUNYIP-331 (bunyip ec861f5, 2026-07-02): bunyip-web now ships adata-otp-autosubmitsnippet that callsform.requestSubmit()the moment a six-digit TOTP field is complete.setInputValue's bubblinginputevent triggers that path, so the form auto-navigates before our followup.click()lands - the button we are waiting for has already left the DOM.Two changes, both mirroring the fix that bunyip's own e2e (
bunyip/e2e/lib/login.ts:238) already carries for the same failure mode:setInputValue: bound the value readback to 500ms. If the input detaches (auto-submit fired mid-poll), treat it as "write took, form has already submitted" and return successfully. The 5-attempt retry loop stays honest for the email + password fields on the credentials step (no auto-submit, so a detach cannot happen there).fillTotpStep: after the write, wait up to 15s for the URL to leave/login/2fa(the auto-submit's landing). Only click the submit button as a fallback if the auto-submit did not fire, so we never double-POST - a second submit would trip the per-IP2fa_verifyrate limit and burn the current TOTP step, cascading into a red run every 30s from then on.The credentials step (
fillCredentialsStepguard above) is unaffected: no auto-submit runs there, sosetInputValue's readback still verifies the values stuck exactly as before.#BUNYIP-331