diff --git a/internal/gui/tests/skill-how.test.cjs b/internal/gui/tests/skill-how.test.cjs index 59ac05b3..a2dad193 100644 --- a/internal/gui/tests/skill-how.test.cjs +++ b/internal/gui/tests/skill-how.test.cjs @@ -61,7 +61,12 @@ function server(lang, posts) { } const scrolled = (page) => page.evaluate(() => [window.scrollX, window.scrollY, ...[...document.querySelectorAll("*")].filter((e) => e.scrollTop || e.scrollLeft).map((e) => `${e.className}:${e.scrollTop},${e.scrollLeft}`)].join(" ")); +// A click at the middle of loc, as a mouse gives it. The dialog grows in from +// a third of its size: a box read while it does is where the button was, not +// where it is when the click lands (Library's way, left of Links), so the +// dialog is let settle first. const press = async (page, loc) => { + await page.waitForFunction(() => !document.querySelector("#modal").getAnimations({ subtree: true }).length); const b = await loc.boundingBox(); await page.mouse.click(b.x + b.width / 2, b.y + b.height / 2); };