Skip to content

test: hover the grab target before clicking in the split grab e2e - #39868

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/e2e-split-grab-hover
Nov 8, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/e2e-split-grab-hover

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes a flaky e2e test: browser-split-grab-shortcut › "escape typed in the page exits grab, the copy toast and find".

Cause

The test sent mouseMove, mouseDown and mouseUp to the guest back to back. Two things make that racy:

  • The "Click or hover an element" banner appears while the picker is still arming, before the guest sets __orcaGrab.onPick.
  • The overlay records the hovered element in a requestAnimationFrame after mousemove. When the click arrives before that frame, getCurrentElement() is null, the pick resolves as cancelled, grab ends, and no "Copied" toast appears.

Fix

Hover like a user does. Wait for the guest picker to accept a pick, move the mouse, wait until the picker has a hovered element, then click. Only the test changes.

Evidence

  • Pinned to 2 cores (taskset -c 0,1), --repeat-each=20: before the fix it failed 3/20, and 6–7/20 in another build of the renderer. After the fix: 20/20 passes in both.
  • Instrumented runs showed the failing pick resolving cancelled with reason user at the moment of the click, with no navigation and no renderer-side cancel.
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​33
Prod 0 0 0 0

@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test adds helpers to read grab state in the guest webview and to wait for the picker to arm and detect the hovered element after a mouse-move event. The Escape/copy-toast test uses the hover helper. Its click events remain inline.

Merge Risk: Minimal · up to 93dfd

The change coordinates the test’s hover and click; no merge-blocking risk is established.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the primary change: the split grab e2e test now hovers the grab target before clicking. The title is short and specific, and it matches the raw summary, the objectives, and the descrip…
Description check Passed The description covers the core template sections that apply to this test-only fix. It explains the cause of the race, the fix, and the evidence from repeated runs. It states the change is test-only. …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the primary change: the split grab e2e test now hovers the grab target before clicking. The title is short and specific, and it matches the raw summary, the objectives, and the description. The 'test:' prefix matches the test-only scope of the change.

Full details: Description check

Explanation

The description covers the core template sections that apply to this test-only fix. It explains the cause of the race, the fix, and the evidence from repeated runs. It states the change is test-only. It does not fill in the ELI5, Linked Issue (the template requires 'Fixes #' with an issue number), Visual Proof (N/A is expected with a reason), Risk level, Testing checklist, or Review and Checklist sections. Because the change is small and the core rationale is present, the description is mostly complete.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77f838a7-8631-4b90-8512-40eea3d50d66
Commits

Reviewing files that changed from the base of the PR and between d464685 and 93dfdda.

Files selected for processing: 1

  • tests/e2e/browser-split-grab-shortcut.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@OrcaWin
OrcaWin merged commit 9f28435 into main Nov 8, 2026
47 checks passed
@OrcaWin
OrcaWin deleted the OrcaWin/e2e-split-grab-hover branch November 8, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant