test(e2e): make fillTotpStep + setInputValue aware of the BUNYIP-331 auto-submit #425

Merged
YousifShkara merged 1 commit from test/BUNYIP-331-autosubmit-aware-fillTotpStep into main 2026-07-03 12:05:01 +02:00
Owner

PR #424 CI failed at login.ts:231 fillTotpStep in global.setup.ts: Test timeout of 60000ms exceeded waiting for the submit button on the 2FA form. The trace shows the browser had already navigated off /login/2fa to 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 a data-otp-autosubmit snippet that calls form.requestSubmit() the moment a six-digit TOTP field is complete. setInputValue's bubbling input event 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-IP 2fa_verify rate limit and burn the current TOTP step, cascading into a red run every 30s from then on.

The credentials step (fillCredentialsStep guard above) is unaffected: no auto-submit runs there, so setInputValue's readback still verifies the values stuck exactly as before.

#BUNYIP-331

PR #424 CI failed at `login.ts:231 fillTotpStep` in `global.setup.ts`: `Test timeout of 60000ms exceeded` waiting for the submit button on the 2FA form. The trace shows the browser had already navigated off `/login/2fa` to 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 a `data-otp-autosubmit` snippet that calls `form.requestSubmit()` the moment a six-digit TOTP field is complete. `setInputValue`'s bubbling `input` event 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-IP `2fa_verify` rate limit and burn the current TOTP step, cascading into a red run every 30s from then on. The credentials step (`fillCredentialsStep` guard above) is unaffected: no auto-submit runs there, so `setInputValue`'s readback still verifies the values stuck exactly as before. #BUNYIP-331
test(e2e): make fillTotpStep + setInputValue aware of the BUNYIP-331 auto-submit
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 39s
Check / fmt + clippy + build + tests (pull_request) Successful in 3m39s
Integration / integration tests (pull_request) Successful in 13m49s
Create release / Gate (release-branch merges only) (pull_request) Successful in 1s
Create release / Create release from merged PR (pull_request) Has been skipped
da283a6915
PR #424 CI failed at `login.ts:231 fillTotpStep` in `global.setup.ts`: `Test timeout of 60000ms exceeded` waiting for the submit button on the 2FA form. The trace shows the browser had already navigated off `/login/2fa` to 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 a `data-otp-autosubmit` snippet that calls `form.requestSubmit()` the moment a six-digit TOTP field is complete. `setInputValue`'s bubbling `input` event 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-IP `2fa_verify` rate limit and burn the current TOTP step, cascading into a red run every 30s from then on.

The credentials step (`fillCredentialsStep` guard above) is unaffected: no auto-submit runs there, so `setInputValue`'s readback still verifies the values stuck exactly as before.

#BUNYIP-331
YousifShkara deleted branch test/BUNYIP-331-autosubmit-aware-fillTotpStep 2026-07-03 12:05:01 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!425
No description provided.