diff --git a/internal/gui/tests/settings-hints.test.cjs b/internal/gui/tests/settings-hints.test.cjs index effb1c816..92ebb6e7d 100644 --- a/internal/gui/tests/settings-hints.test.cjs +++ b/internal/gui/tests/settings-hints.test.cjs @@ -18,7 +18,7 @@ const fs = require("node:fs/promises"); const path = require("node:path"); const { test } = require("node:test"); const { chromium, webkit } = require("playwright"); -const { watchSettingsReads, settingsDrawn, openPart } = require("./reader.cjs"); +const { watchSettingsReads, settingsDrawn, openPart, reach } = require("./reader.cjs"); const assets = path.resolve(__dirname, "../assets"); @@ -110,7 +110,10 @@ for (const engine of engines) { // the pointer resting on the row: a card with the whole line, and // nothing moves - await mcp.evaluate((e) => e.scrollIntoView({ block: "center" })); + // wheeled into sight, as a reader would: the app puts back a scroll + // by code, so in ja and de at 420px, where the row starts below the + // window, the pointer landed on the row above (#6353) + await reach(page, mcp.locator(":scope > .who > .name")); await page.mouse.move(1, 1); const before = await page.evaluate(boxes); await mcp.locator(":scope > .who > .name").hover(); diff --git a/internal/gui/tests/settings-lines-wrap.test.cjs b/internal/gui/tests/settings-lines-wrap.test.cjs index 95902a110..a17650754 100644 --- a/internal/gui/tests/settings-lines-wrap.test.cjs +++ b/internal/gui/tests/settings-lines-wrap.test.cjs @@ -16,7 +16,7 @@ const fs = require("node:fs/promises"); const path = require("node:path"); const { test } = require("node:test"); const { chromium, webkit } = require("playwright"); -const { watchSettingsReads, settingsDrawn, openPart } = require("./reader.cjs"); +const { watchSettingsReads, settingsDrawn, openPart, reach } = require("./reader.cjs"); const assets = path.resolve(process.env.MAGPIE_WRAP_ASSETS || path.join(__dirname, "../assets")); @@ -121,8 +121,10 @@ for (const engine of engines) { await s.waitFor({ state: "attached" }); if (await s.evaluate((e) => getComputedStyle(e).getPropertyValue("--hint").trim() === "1")) { // out of sight at rest: the row's card shows it whole - await s.evaluate((e) => e.closest(".row.pref").scrollIntoView({ block: "center" })); - await s.locator("xpath=ancestor::div[contains(concat(' ', @class, ' '), ' pref ')][1]").locator(":scope > .who > .name").hover(); + // wheeled into sight: a scroll by code is put back (#6353) + const name = s.locator("xpath=ancestor::div[contains(concat(' ', @class, ' '), ' pref ')][1]").locator(":scope > .who > .name"); + await reach(page, name); + await name.hover(); const card = page.locator(".set-hint.on"); await card.waitFor(); assert.ok((await card.textContent()).includes((await s.textContent()).trim()), `${sel} isn't in its card`);