Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

gui tests: routing-pause and routing-rule-effort press once a group's editor has opened (#3410, #3411)

yetone7b007e9866c2
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) {