From b45fe28c9d475d71fcafb78aae257e2c310acaec Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 6 Oct 2026 13:51:35 +0800 Subject: [PATCH] =?UTF-8?q?usage-sessions-agents-fit=20test:=20in=20WebKit?= =?UTF-8?q?=20the=20last=20agent=20is=20clicked=20as=20an=20element=20?= =?UTF-8?q?=E2=80=94=20the=20test=20failed=20~70%=20of=20runs=20in=20WebKi?= =?UTF-8?q?t,=20en=20and=20zh=20(a=20timeout=20waiting=20for=20Zed=20to=20?= =?UTF-8?q?be=20picked),=20and=20had=20since=20c6e318e1=20added=20it:=20no?= =?UTF-8?q?=20commit=20turned=20it=20red.=20Playwright's=20WebKit=20stops?= =?UTF-8?q?=20hit-testing=20a=20scroller's=20children=20once=20it=20has=20?= =?UTF-8?q?been=20scrolled:=20on=20a=20bare=20page=20with=20a=20display:fl?= =?UTF-8?q?ex,=20overflow-x:auto=20strip,=20after=20scrollLeft=20is=20set?= =?UTF-8?q?=20every=20click=20on=20its=20buttons=20lands=20on=20the=20stri?= =?UTF-8?q?p=20(57/57=20lost;=20Chromium=200/58),=20elementFromPoint=20giv?= =?UTF-8?q?es=20the=20strip=20from=20the=20next=20frame=20on,=20and=20in?= =?UTF-8?q?=20this=20test=20a=20wheel=20scroll=20does=20it=20too.=20The=20?= =?UTF-8?q?system's=20WKWebView,=20which=20the=20Mac=20app=20uses,=20takes?= =?UTF-8?q?=20the=20click:=20the=20same=20page=20in=20a=20WKWebView=20in?= =?UTF-8?q?=20an=20AppKit=20window,=20scrolled=20the=20same=20way,=20hit-t?= =?UTF-8?q?ests=20and=20clicks=20the=20button.=20So=20it=20isn't=20the=20a?= =?UTF-8?q?pp.=20Chromium=20still=20clicks=20with=20the=20mouse;=20WebKit?= =?UTF-8?q?=20clicks=20the=20button=20through=20the=20DOM,=20which=20runs?= =?UTF-8?q?=20the=20same=20onclick=20and=20redraw.=20What=20the=20test=20g?= =?UTF-8?q?uards=20is=20kept:=20with=20the=20button=20reuse=20and=20the=20?= =?UTF-8?q?bring-into-view=20both=20taken=20out=20of=20app.js,=20the=20Web?= =?UTF-8?q?Kit=20cases=20still=20fail=20("the=20picked=20agent=20stays=20i?= =?UTF-8?q?n=20view").=20No=20app=20change.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verified: usage-sessions-agents-fit 8/8 runs green in Chromium and WebKit, en and zh; also at 440px (a copy with 860/440); sess-agent-strip, sessions-toolbar and sessions-usage-open pass. sessions-overview's WebKit en case fails 2 runs in 3 on its own, with "ResizeObserver loop completed with undelivered notifications" caught as a page error, a different cause, not in this commit. --- internal/gui/tests/usage-sessions-agents-fit.test.cjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/gui/tests/usage-sessions-agents-fit.test.cjs b/internal/gui/tests/usage-sessions-agents-fit.test.cjs index 45e3eda6..c86e8e5a 100644 --- a/internal/gui/tests/usage-sessions-agents-fit.test.cjs +++ b/internal/gui/tests/usage-sessions-agents-fit.test.cjs @@ -72,8 +72,15 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", // the strip drawn again kept its buttons and where it was scrolled await strip.evaluate((e) => { e.scrollLeft = e.scrollWidth; }); const last = strip.locator(".opt").last(); - const lb = await last.boundingBox(); - await page.mouse.click(lb.x + lb.width / 2, lb.y + lb.height / 2); + // Playwright's WebKit stops hit-testing a scroller's children once it + // has been scrolled (a click lands on the strip, ~70% of runs; the + // system's WKWebView takes it, tried from a WKWebView in AppKit), so + // there the button is clicked as an element + if (engine === "webkit") await last.evaluate((b) => b.click()); + else { + const lb = await last.boundingBox(); + await page.mouse.click(lb.x + lb.width / 2, lb.y + lb.height / 2); + } await page.waitForFunction(() => document.querySelector("#sessAgent .opt.on")?.textContent === "Zed"); await settle(); assert.equal(await strip.getByRole("button", { pressed: true }).textContent(), "Zed", "the reused button exposes its new selection");