diff --git a/internal/gui/tests/plugin-move.test.cjs b/internal/gui/tests/plugin-move.test.cjs index edc0fb884..bff18d0ce 100644 --- a/internal/gui/tests/plugin-move.test.cjs +++ b/internal/gui/tests/plugin-move.test.cjs @@ -134,7 +134,16 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await page.waitForTimeout(80); if (await at() === was) break; } - const top = await at(); + // WebKit can still be applying the last wheel when the loop ends + // (367, then 397 a moment later): the place the reader left is + // where the scroll settles, two reads 150ms apart agreeing + let top = await at(); + for (let i = 0; i < 40; i++) { + await page.waitForTimeout(150); + const now = await at(); + if (now === top) break; + top = now; + } assert.ok(top > 0, "the editor doesn't scroll: the test proves nothing about keeping its place"); // a press where the button is, as the reader's mouse does const press = async () => {