fix tests
All checks were successful
Build and publish Docker image / build-and-push (push) Successful in 5m12s
CI / Check (push) Successful in 9m1s

This commit is contained in:
Andras Schmelczer 2026-07-14 14:11:59 +01:00
parent 56b5d9f7df
commit e544b946c9
4 changed files with 44 additions and 4 deletions

View file

@ -483,6 +483,12 @@ async function tryResolveTarget(
const locator = ctx.page.locator(target.selector).first();
try {
await locator.waitFor({ state: 'visible', timeout: timeoutMs });
// Playwright's "visible" only means the element has a box; a filter-card
// button can sit scrolled out of the bottom sheet's viewport, and a blind
// click at its coordinates would land on the map behind the sheet.
// Scrolling it into view first makes the click (and the recording of it)
// honest.
await locator.scrollIntoViewIfNeeded({ timeout: timeoutMs }).catch(() => {});
const box = await locator.boundingBox({ timeout: timeoutMs });
if (!box) return null;
return { x: box.x + box.width / 2, y: box.y + box.height / 2 };