Skip to content

test(e2e): use bounding box for quick-open hover positioning - #21505

Merged
AmethystLiang merged 1 commit into
mainfrom
auto-e2e-tests-autofix-scheduled-ci-1h-run-64-20260918T0700
Sep 19, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
auto-e2e-tests-autofix-scheduled-ci-1h-run-64-20260918T0700

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6
Prod 0 0 0 0

Problem

The test was hovering over UI elements using hardcoded pixel positions (x: 20, y: 12 and x: 40, y: 12). These positions are fragile—if the element moves or renders differently, the hover fails and the test flakes.

Solution

Get the actual bounding box of the element being tested, then calculate hover positions relative to it. This way, the test works regardless of where the element actually appears on screen.

What Changed

Replaced two hardcoded .hover() calls with a more robust approach:

  • Query the Quick Open result by text to find the exact element
  • Verify it's visible
  • Get its bounding box
  • Move the mouse to coordinates calculated from the box (not hardcoded screen positions)
  • Throw a clear error if the element remounts during the test

Why

Hardcoded positions break when layout changes, screen resolution differs, or the element renders in a different spot. Using the element's actual bounding box makes the test resilient to UI changes while still verifying the hover-tooltip behavior.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Self-reviewed for correctness
  • Cross-platform impact considered (test helper, not platform-specific)

N/A: Visual proof (test-only change), SSH/remote impact

Handle cases where the quick-open result element remounts by tracking
its current bounding box and using absolute mouse positioning instead
of relative row.hover() calls.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1f8cf530-1d31-4114-aebf-b58e0998e11f

📥 Commits

Reviewing files that changed from the base of the PR and between f24f38b and 4df1375.

📒 Files selected for processing (1)
  • tests/e2e/quick-open-file-paths.spec.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The quick-open E2E test now re-queries the result row inside the retry loop. It checks that the row is visible and reads its current bounding box. If the bounding box is unavailable, the test throws an error so the retry runs again. Pointer movements now use the fresh bounding box coordinates instead of hovering a previously captured row element.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 4df13

No actionable correctness or stability risk remains in this test-only change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the problem and solution, but it omits several required template sections, including ELI5, Linked Issue with an issue reference, Visual Proof, AI Disclosure, Review, Agent ski… Update the description to use the required template. Add an ELI5 section, a Linked Issue entry such as Fixes #123``, a Visual Proof section containing N/A with the test-only reason, AI Disclosure, Review, Agent skill upstream boundary, No…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: replacing hardcoded hover coordinates with bounding-box positioning in the Quick Open E2E test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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: Description check

Explanation

The description explains the problem and solution, but it omits several required template sections, including ELI5, Linked Issue with an issue reference, Visual Proof, AI Disclosure, Review, Agent skill upstream boundary, Notes, and the complete checklist. It also leaves the testing checkboxes unchecked.

Resolution

Update the description to use the required template. Add an ELI5 section, a Linked Issue entry such as Fixes #123``, a Visual Proof section containing N/A with the test-only reason, AI Disclosure, Review, Agent skill upstream boundary, Notes, and the required checklist items. Document automated test verification and the platforms tested, or explain why those checks are covered by CI.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

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

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Bounding-box hover positioning: tests/e2e/quick-open-file-paths.spec.ts re-queries the Quick Open result row inside the existing toPass retry loop, reads its boundingBox(), and drives two raw mouse.move() calls at box-relative offsets, throwing to force a retry when the row remounts between the visibility check and measurement. The final expect(tooltip).toBeVisible() assertion is unchanged, so the test still fails when the hover-tooltip behavior regresses.

One note for the record (not blocking): locator.hover({ position }) is already element-relative — Playwright resolves position from the top-left of the element's padding box, not from screen coordinates — so the hardcoded x: 20/40 offsets were not broken by the element moving. The effective gain here is bypassing Playwright's stability wait / scroll-into-view while results stream. The sibling spec tests/e2e/tab-create-entry-file-paths.spec.ts:58-63 documents that remount rationale inline; a matching comment here would keep the two specs consistent.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@AmethystLiang
AmethystLiang merged commit 58de75a into main Sep 19, 2026
34 of 36 checks passed
@nwparker nwparker mentioned this pull request Oct 4, 2026
6 of 8 tasks
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