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

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.
This commit is contained in:
Jinjing
2026-09-18 10:57:24 -07:00
parent 2bdf281433
commit 4df1375f9c
+8 -2
View File
@@ -49,8 +49,14 @@ test('cmd+p quick open prioritizes the filename and reveals the full path on hov
// tooltip left open from a prior attempt can swallow the next hover.
await expect(async () => {
await orcaPage.mouse.move(8, 8)
await row.hover({ position: { x: 20, y: 12 }, timeout: 2_000 })
await row.hover({ position: { x: 40, y: 12 }, timeout: 2_000 })
const currentRow = dialog.getByRole('option').filter({ hasText: 'QuickOpenTarget.tsx' }).first()
await expect(currentRow).toBeVisible()
const currentBox = await currentRow.boundingBox()
if (!currentBox) {
throw new Error('Quick Open result remounted before hover')
}
await orcaPage.mouse.move(currentBox.x + 20, currentBox.y + 12)
await orcaPage.mouse.move(currentBox.x + 40, currentBox.y + 12)
await expect(tooltip).toBeVisible({ timeout: 2_000 })
}).toPass({ timeout: 15_000, intervals: [100, 250, 500] })