test(e2e): stop setInputValue hanging when BUNYIP-331 auto-submit detaches the input #325

Merged
YousifShkara merged 1 commit from test/BUNYIP-331-setinputvalue-tolerate-detach into main 2026-07-03 12:04:58 +02:00
Owner

PR #324 CI failed at login.ts:186 setInputValue inside fillTotpStep: Test timeout of 180000ms exceeded waiting for the TOTP #code input's value readback. Root cause is a race between our write and the BUNYIP-331 six-digit auto-submit that landed on 2026-07-02 (ec861f5). The evaluate block dispatches the bubbling input event that the OTP snippet reacts to; the snippet calls form.requestSubmit() on the same event tick, so by the time we reach await loc.inputValue() on the next line the input has already detached from the DOM as the page navigates off /login/2fa. Playwright's default action timeout (180s) then burns waiting for the input to re-attach on a page that has moved on to /dashboard.

Fix: bound the readback to a short 500ms poll and treat "input is gone" the same as "value stuck" - return successfully. If we managed to run evaluate at all, the write took; a detach on the very next microtask means the form has already auto-submitted, not that we failed to fill. The 5-attempt retry loop remains honest for the email + password fields (no auto-submit, so a persistent wrong value keeps retrying). Long detach OR five persistent wrong-value attempts still throws with the current length.

The fillTotpStep post-fill waitForURL(!/\/login\/(2fa|mfa)/) (login.ts:240) and the fallback button click stay as-is; those already handle the auto-submit correctly at the caller level.

#BUNYIP-331

PR #324 CI failed at `login.ts:186 setInputValue` inside `fillTotpStep`: `Test timeout of 180000ms exceeded` waiting for the TOTP `#code` input's value readback. Root cause is a race between our write and the BUNYIP-331 six-digit auto-submit that landed on 2026-07-02 (ec861f5). The `evaluate` block dispatches the bubbling `input` event that the OTP snippet reacts to; the snippet calls `form.requestSubmit()` on the same event tick, so by the time we reach `await loc.inputValue()` on the next line the input has already detached from the DOM as the page navigates off `/login/2fa`. Playwright's default action timeout (180s) then burns waiting for the input to re-attach on a page that has moved on to `/dashboard`. Fix: bound the readback to a short 500ms poll and treat "input is gone" the same as "value stuck" - return successfully. If we managed to run `evaluate` at all, the write took; a detach on the very next microtask means the form has already auto-submitted, not that we failed to fill. The 5-attempt retry loop remains honest for the email + password fields (no auto-submit, so a persistent wrong value keeps retrying). Long detach OR five persistent wrong-value attempts still throws with the current length. The `fillTotpStep` post-fill `waitForURL(!/\/login\/(2fa|mfa)/)` (login.ts:240) and the fallback button click stay as-is; those already handle the auto-submit correctly at the caller level. #BUNYIP-331
test(e2e): stop setInputValue hanging when BUNYIP-331 auto-submit detaches the input
All checks were successful
E2E / Playwright against deployment (pull_request) Successful in 23s
Check / fmt + clippy + build + tests (pull_request) Successful in 16m48s
Create release / Create release from merged PR (pull_request) Has been skipped
8e55dce4dc
PR #324 CI failed at `login.ts:186 setInputValue` inside `fillTotpStep`: `Test timeout of 180000ms exceeded` waiting for the TOTP `#code` input's value readback. Root cause is a race between our write and the BUNYIP-331 six-digit auto-submit that landed on 2026-07-02 (ec861f5). The `evaluate` block dispatches the bubbling `input` event that the OTP snippet reacts to; the snippet calls `form.requestSubmit()` on the same event tick, so by the time we reach `await loc.inputValue()` on the next line the input has already detached from the DOM as the page navigates off `/login/2fa`. Playwright's default action timeout (180s) then burns waiting for the input to re-attach on a page that has moved on to `/dashboard`.

Fix: bound the readback to a short 500ms poll and treat "input is gone" the same as "value stuck" - return successfully. If we managed to run `evaluate` at all, the write took; a detach on the very next microtask means the form has already auto-submitted, not that we failed to fill. The 5-attempt retry loop remains honest for the email + password fields (no auto-submit, so a persistent wrong value keeps retrying). Long detach OR five persistent wrong-value attempts still throws with the current length.

The `fillTotpStep` post-fill `waitForURL(!/\/login\/(2fa|mfa)/)` (login.ts:240) and the fallback button click stay as-is; those already handle the auto-submit correctly at the caller level.

#BUNYIP-331
YousifShkara deleted branch test/BUNYIP-331-setinputvalue-tolerate-detach 2026-07-03 12:04:58 +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/bunyip!325
No description provided.