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.
This commit is contained in:
yetone
2026-10-28 13:55:32 +08:00
parent c48fccfad7
commit 7b007e9866
2 changed files with 9 additions and 2 deletions
+6 -2
View File
@@ -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, []);
});
@@ -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) {