Repository navigation
test(e2e): use bounding box for quick-open hover positioning - #21505
AmethystLiang merged 1 commit into
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe 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 No actionable correctness or stability risk remains in this test-only change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation 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
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Bounding-box hover positioning:
tests/e2e/quick-open-file-paths.spec.tsre-queries the Quick Open result row inside the existingtoPassretry loop, reads itsboundingBox(), and drives two rawmouse.move()calls at box-relative offsets, throwing to force a retry when the row remounts between the visibility check and measurement. The finalexpect(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.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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: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
Checklist
N/A: Visual proof (test-only change), SSH/remote impact