From b7df1b7c6dc1d747992fff7192c9b8eb2c159132 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 13 Oct 2026 03:44:27 +0800 Subject: [PATCH] gui tests: library-mcp-tools wheels down to Check again, which the Hooks tab put under the window's foot at 420 in German Cause: e3a497d7a (Hooks, a fifth Library category). It is intended, since Hooks were asked for (#1790). The new tab adds a row to the Library's head at 420 points wide in German, which pushes the tool list's Check again button under the window's foot. The app puts back Playwright's own scroll, as any scroll that isn't the reader's, so in WebKit the click times out. Bisected with the test: green on e3a497d7a^, red from e3a497d7a. Change: wheel to the button with reader.cjs's reach before the test reads the scroll and presses it. The test's assertions are unchanged: the list stays and the scroll doesn't move while it checks. Run (worktree on origin/main 31c1e3ab1, playwright 1.62.0, alone): 10/10 in chromium and webkit. Before: 9/10 in webkit. Not run: the full GUI suite. --- internal/gui/tests/library-mcp-tools.test.cjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/gui/tests/library-mcp-tools.test.cjs b/internal/gui/tests/library-mcp-tools.test.cjs index 37d3fa941..e2db900b8 100644 --- a/internal/gui/tests/library-mcp-tools.test.cjs +++ b/internal/gui/tests/library-mcp-tools.test.cjs @@ -11,6 +11,7 @@ const fs = require("node:fs/promises"); const path = require("node:path"); const { test } = require("node:test"); const { chromium, webkit } = require("playwright"); +const { reach } = require("./reader.cjs"); const assets = path.resolve(__dirname, "../assets"); const HOME = "/Users/nf"; @@ -144,7 +145,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await list.locator(".lib-tooldesc").first().click(); assert.equal(await page.evaluate(() => document.querySelector("#modal").classList.contains("lib")), false); - // Check again checks that one afresh; the list stays while it does + // Check again checks that one afresh; the list stays while it does. + // At 420 in German it is under the window's foot since the Hooks + // tab came in (e3a497d7a): the reader scrolls down to it + await reach(page, list.locator(".lib-toolfoot button", { hasText: w.check })); const at = await scrollTop(), pillThen = await where(); await list.locator(".lib-toolfoot button", { hasText: w.check }).click(); for (let i = 0; i < 50 && checks.length < 2; i++) await page.waitForTimeout(20);