test: re-enable firefox browser tests - #5556
Conversation
|
maybe we should just reenable firefox tests? 🤔 |
The firefox instance was disabled in vueuse#4589 for flaky browser-session connection errors (vitest-dev/vitest#7377). That issue was fixed upstream in playwright's firefox build v1480 (microsoft/playwright#34586); this repo pins playwright 1.60.0 (firefox build v1522), so the instance can come back. Three tests relied on Chromium-specific behavior and are made browser-agnostic: - onClickOutside: programmatic iframe.focus() does not fire window blur in Firefox, so the nested-shadow-DOM test dispatches the blur itself -- the activeElement walk it verifies is unaffected. - onStartTyping: the invalid-characters test filled characters into a focused editable input, which blocks the callback regardless of key filtering (and 36 sequential fill round-trips timed out on Firefox). It now actually presses the invalid keys (arrows, F1-F12). - useIntersectionObserver: Firefox quantizes scroll positions to device pixels and reports intersectionRatio just below 1 for fully visible targets, so exact-boundary scrolls and a threshold of exactly 1 never fire there. The threshold test now overshoots boundaries by a few px and asserts ratio ranges. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
05d1044 to
5b47aac
Compare
|
@OrbisK good call — done. The blocker behind #4589 is fixed upstream (vitest-dev/vitest#7377 → playwright firefox build v1480; we pin playwright 1.60.0 = build v1522), and across repeated full firefox runs locally the connection flakiness never reappeared. It wasn't a pure uncomment though: three tests encoded Chromium-specific behavior and fail on firefox on their own — |
|
@harshit-d3v please make sure to never let an LLM speak for you
|
Before submitting the PR, please make sure you do the following
fixes #123).Description
Follow-up to @OrbisK's suggestion in the comments: instead of removing the dead
browser (firefox)script filters, this now re-enables the firefox instance itself.Why it's safe now: firefox was disabled in #4589 because of flaky
Failed to connect to the browser sessionerrors (vitest-dev/vitest#7377). That issue was closed as fixed in playwright's firefox build v1480 (microsoft/playwright#34586). This repo pins playwright1.60.0, which ships firefox build v1522 — well past the fix. Across several full-suite runs locally, the connection error never appeared.What else this needed: three tests encoded Chromium-specific behavior and fail on firefox regardless of the flakiness fix. Each is made browser-agnostic:
onClickOutside› nested shadow DOM iframeiframe.focus()sets theactiveElementchain but never fires windowblur, so thedetectIframelistener never runs (a real click does fire it — the single-level test passes)blurexplicitly; the test's purpose is the shadow-rootactiveElementwalk, which is unaffectedonStartTyping› invalid charactersuserEvent.fillround-trips exceed the 15s timeout — andfillnever pressed the keys the test is about anyway; it typed characters into a focused editable input, which blocks the callback regardless of key filtering{ArrowLeft}…{F12}) with no editable element focuseduseIntersectionObserver› thresholdscrollTo(0, 10)lands atscrollY = 9.95, target never touches the viewport) and reportsintersectionRatio = 0.9998for a fully visible target, so a threshold of exactly1never fires0.99as the fully-visible thresholdVerification (local, Windows, playwright 1.60.0 / Firefox 150.0.2):
vitest --project="browser (firefox)": 3 consecutive full runs, 88 files / 712 tests green each timevitest --project="browser (chromium)"and--project="browser (webkit)": green on the changed files; full-suite runs only showed pre-existing timing flakes (useTransition) that reproduce identically on unmodifiedmainCI runs Ubuntu, so it's worth watching the first few runs of the other browser tests step for anything environment-specific.
Additional context
On the last checkbox: as with the original version of this PR, an AI assistant did the investigation and the changes here, so I'm not ticking the box that asks me to confirm otherwise. Every claim above is reproducible: each of the three tests fails on firefox without its change and passes with it, and the root causes are observable in a debugger (the
blur-lessiframe.focus(), the fractionalscrollY, the0.9998ratio). Please close without hesitation if that isn't something you want to take.