Skip to content

test: re-enable firefox browser tests - #5556

Open
harshit-d3v wants to merge 1 commit into
vueuse:mainfrom
harshit-d3v:chore/drop-dead-firefox-project-filter
Open

test: re-enable firefox browser tests#5556
harshit-d3v wants to merge 1 commit into
vueuse:mainfrom
harshit-d3v:chore/drop-dead-firefox-project-filter

Conversation

@harshit-d3v

@harshit-d3v harshit-d3v commented Jul 29, 2026

Copy link
Copy Markdown

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it. — the three test changes below fail on firefox without them and pass with them.
  • Confirm that this PR is based on your own understanding and review of the project, not solely generated or summarized by AI tools. — left unticked deliberately, see the note at the bottom.

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 session errors (vitest-dev/vitest#7377). That issue was closed as fixed in playwright's firefox build v1480 (microsoft/playwright#34586). This repo pins playwright 1.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:

test root cause on firefox fix
onClickOutside › nested shadow DOM iframe programmatic iframe.focus() sets the activeElement chain but never fires window blur, so the detectIframe listener never runs (a real click does fire it — the single-level test passes) dispatch the blur explicitly; the test's purpose is the shadow-root activeElement walk, which is unaffected
onStartTyping › invalid characters 36 sequential userEvent.fill round-trips exceed the 15s timeout — and fill never pressed the keys the test is about anyway; it typed characters into a focused editable input, which blocks the callback regardless of key filtering actually press the invalid keys ({ArrowLeft}…{F12}) with no editable element focused
useIntersectionObserver › threshold firefox quantizes scroll positions to device pixels (scrollTo(0, 10) lands at scrollY = 9.95, target never touches the viewport) and reports intersectionRatio = 0.9998 for a fully visible target, so a threshold of exactly 1 never fires overshoot each scroll boundary by a few px and assert ratio ranges; use 0.99 as the fully-visible threshold

Verification (local, Windows, playwright 1.60.0 / Firefox 150.0.2):

  • vitest --project="browser (firefox)": 3 consecutive full runs, 88 files / 712 tests green each time
  • vitest --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 unmodified main

CI 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-less iframe.focus(), the fractional scrollY, the 0.9998 ratio). Please close without hesitation if that isn't something you want to take.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. build tools labels Jul 29, 2026
@OrbisK

OrbisK commented Aug 3, 2026

Copy link
Copy Markdown
Member

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>
@harshit-d3v
harshit-d3v force-pushed the chore/drop-dead-firefox-project-filter branch from 05d1044 to 5b47aac Compare August 4, 2026 08:19
@harshit-d3v harshit-d3v changed the title chore: drop dead \rowser (firefox)\ project filters from test scripts test: re-enable firefox browser tests Aug 4, 2026
@harshit-d3v

Copy link
Copy Markdown
Author

@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 — iframe.focus() not firing window blur (onClickOutside), a fill-based test that never actually pressed the keys it was testing and timed out (onStartTyping), and exact-pixel scroll boundaries plus threshold: 1 never firing due to subpixel rounding (useIntersectionObserver). Each is now browser-agnostic; details in the updated PR description. Firefox suite is green 3/3 full runs locally (Windows), chromium/webkit unaffected.

@OrbisK

OrbisK commented Aug 4, 2026

Copy link
Copy Markdown
Member

@harshit-d3v please make sure to never let an LLM speak for you

  • All comments, issues, and pull request descriptions should be written in your own voice
  • We value clear, human communication over perfect grammar or spelling
  • Avoid copy-pasting AI-generated summaries that don't reflect your own understanding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build tools size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants