From 7b007e9866c2aede6c8907a33b097c7ae8cb3d80 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 28 Oct 2026 13:55:28 +0800 Subject: [PATCH] gui tests: routing-pause and routing-rule-effort press once a group's editor has opened (#3410, #3411) Both were red on main since 91b0be836 (10-23), filed as #3410 and #3411 with no owner. Bisected on mote from b0b076421 (green) to 3b10a403d: 91b0be836 is the first red. It opens a group's row into its editor in ~700ms of motion. press() read how far to wheel the page while the editor was still growing, found it near enough, and clicked where the target ended up after the growth: at y 3108 in a 1400px window, so nothing. press() now waits for every finite animation to end before it measures. That let "a rule that pauses a model at some hours" reach its Save, where c888ef272 (10-25) saves hours set in the browser with its zone. The fixture never saw it, as the test stopped before. The page's zone is pinned to Asia/Tokyo and the edited rule expects it; the untouched rule keeps none. Run on mote at this tree (origin/main 7b63feb90 + this): routing-pause and routing-rule-effort --test-concurrency=1, both engines, every language: 32/32. At 7b63feb90: 4 pass, 28 fail; the same at 7dcc0aedc^, so not #3955. Broken by hand: the wait moved after the measure (where the 300ms settle was): 28 red again. Not fixed here: routing-model-rest, -intent-entry, -manual, -row-swap, -rule-drag are red alone on main too (16 pass / 28 fail), looked at next. --- internal/gui/tests/routing-pause.test.cjs | 8 ++++++-- internal/gui/tests/routing-rule-effort.test.cjs | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/gui/tests/routing-pause.test.cjs b/internal/gui/tests/routing-pause.test.cjs index e309ccb52..1111dfbb8 100644 --- a/internal/gui/tests/routing-pause.test.cjs +++ b/internal/gui/tests/routing-pause.test.cjs @@ -78,7 +78,7 @@ const EDIT = { en: "Edit", zh: "编辑", "zh-TW": "編輯", ja: "編集", de: "B async function open(engine, lang, width, t) { const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" })); t.after(() => browser.close()); - const page = await (await browser.newContext({ viewport: { width, height: 1400 } })).newPage(); + const page = await (await browser.newContext({ viewport: { width, height: 1400 }, timezoneId: "Asia/Tokyo" })).newPage(); page.setDefaultTimeout(5000); const errors = [], posts = []; page.on("pageerror", (e) => errors.push(e.message)); @@ -92,6 +92,9 @@ async function open(engine, lang, width, t) { // click never moves the page, so Playwright's own scroll is put back), then // the mouse on it once it holds still async function press(page, x) { + // a group opening into its editor moves its height and parts for ~700ms + // (91b0be836): where x will be is read once that has stopped + await page.waitForFunction(() => !document.getAnimations().some((a) => a.playState === "running" && Number.isFinite(a.effect?.getComputedTiming().endTime))); const d = await x.evaluate((e) => { const v = document.querySelector("#view-routing"); return Math.round(e.getBoundingClientRect().top - v.getBoundingClientRect().top - v.clientHeight / 2); }); if (Math.abs(d) > 100) { @@ -178,7 +181,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert(save, `saved: ${JSON.stringify(posts)}`); assert.deepEqual(save.body.rules.map((r) => [r.use, !!r.pause, r.tokens || 0, r.time]), [ ["a/glm", true, 0, { from: "14:00", to: "18:00", days: WEEKDAYS }], - ["b/other", true, 0, { from: "09:00", to: "12:00", days: [] }], + // hours set here are in the browser's zone, saved with them (c888ef272) + ["b/other", true, 0, { from: "09:00", to: "12:00", days: [], zone: "Asia/Tokyo" }], ]); assert.deepEqual(errors, []); }); diff --git a/internal/gui/tests/routing-rule-effort.test.cjs b/internal/gui/tests/routing-rule-effort.test.cjs index c3c53165e..08b7f54ed 100644 --- a/internal/gui/tests/routing-rule-effort.test.cjs +++ b/internal/gui/tests/routing-rule-effort.test.cjs @@ -77,6 +77,9 @@ async function open(engine, lang, width, t) { // a click as the reader's: wheeled into the middle of the view first (a // click never moves the page), then the mouse on it once it holds still async function press(page, x) { + // a group opening into its editor moves its height and parts for ~700ms + // (91b0be836): where x will be is read once that has stopped + await page.waitForFunction(() => !document.getAnimations().some((a) => a.playState === "running" && Number.isFinite(a.effect?.getComputedTiming().endTime))); const d = await x.evaluate((e) => { const v = document.querySelector("#view-routing"); return Math.round(e.getBoundingClientRect().top - v.getBoundingClientRect().top - v.clientHeight / 2); }); if (Math.abs(d) > 100) {