fix tests
This commit is contained in:
parent
56b5d9f7df
commit
e544b946c9
4 changed files with 44 additions and 4 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue