From aab2e4412ab68caffee8affdde5a69a2c0cf5ad9 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 6 Oct 2026 05:21:50 +0800 Subject: [PATCH] =?UTF-8?q?gui=20tests:=20routing-levels=20and=20rate-limi?= =?UTF-8?q?ted-sink=20wheel=20the=20group=20editor's=20row=20into=20sight?= =?UTF-8?q?=20before=20clicking=20it=20=E2=80=94=20the=20editor=20grew,=20?= =?UTF-8?q?so=20its=20Levels=20and=20Order=20rows=20sat=20at=20the=201400p?= =?UTF-8?q?x=20window's=20foot;=20WebKit's=20own=20scroll=20into=20view=20?= =?UTF-8?q?left=20a=203px=20sliver=20above=20the=20footer=20and=20clicked?= =?UTF-8?q?=20the=20footer=20("footer=20intercepts=20pointer=20events").?= =?UTF-8?q?=20They=20wheel=20as=20the=20tests'=20Save=20already=20does=20(?= =?UTF-8?q?the=20page=20puts=20back=20a=20scroll=20the=20reader=20didn't?= =?UTF-8?q?=20make).=20The=20click-moves-nothing=20checks=20are=20unchange?= =?UTF-8?q?d.=20Pass=20in=20Chromium=20and=20WebKit,=20en=20and=20zh;=20fa?= =?UTF-8?q?iled=20in=20WebKit=20on=206e623d16.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/gui/tests/rate-limited-sink.test.cjs | 9 +++++++++ internal/gui/tests/routing-levels.test.cjs | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/internal/gui/tests/rate-limited-sink.test.cjs b/internal/gui/tests/rate-limited-sink.test.cjs index 8b6b2417..64f219c8 100644 --- a/internal/gui/tests/rate-limited-sink.test.cjs +++ b/internal/gui/tests/rate-limited-sink.test.cjs @@ -160,6 +160,15 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", const field = label.locator("xpath=following-sibling::div[1]"); await label.waitFor(); assert.match(await field.locator(".opt", { hasText: new RegExp(`^${w.back}$`) }).getAttribute("class"), /\bon\b/); + // the editor runs under the window's foot: wheeled to, as the reader + // would (WebKit's own scroll left a sliver of In turn over the footer + // and clicked the footer) + const turn = ed.locator(".segs .opt", { hasText: new RegExp(`^${w.turn}$`) }).first(); + await page.mouse.move(550, 600); + for (let i = 0; i < 10 && (await turn.boundingBox()).y > 1400 - 260; i++) { + await page.mouse.wheel(0, 300); + await page.waitForTimeout(150); + } await ed.locator(".segs .opt", { hasText: new RegExp(`^${w.turn}$`) }).first().click(); assert.equal(await label.isVisible(), false, "in turn: nothing to pick"); await ed.locator(".segs .opt", { hasText: new RegExp(`^${w.order}$`) }).first().click(); diff --git a/internal/gui/tests/routing-levels.test.cjs b/internal/gui/tests/routing-levels.test.cjs index 01b1d4b0..1509faf8 100644 --- a/internal/gui/tests/routing-levels.test.cjs +++ b/internal/gui/tests/routing-levels.test.cjs @@ -96,7 +96,15 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.equal(await row().locator(".hint").textContent(), w.sharedHint); assert.equal(await row().locator(".rt-levels").isHidden(), true); - // named: one toggle per level, the shared ones on + // named: one toggle per level, the shared ones on (the row, under the + // window's foot as the editor grew, wheeled to as the reader would: + // WebKit's own scroll left a sliver of it over the footer and clicked + // the footer) + await page.mouse.move(550, 600); + for (let i = 0; i < 10 && (await row().boundingBox()).y > 1400 - 260; i++) { + await page.mouse.wheel(0, 300); + await page.waitForTimeout(150); + } await row().locator(".segs .opt", { hasText: w.named }).click(); assert.equal(await row().locator(".hint").textContent(), w.namedHint); assert.deepEqual(await chips().allTextContents(), ["none", "minimal", "low", "medium", "high", "xhigh", "max"]);