gui tests: routing-manual and routing-time follow the group editor's hints under Routing — a802d98b (#576) added a second hint under the editor's Routing segs (a group among the models keeps its own routing), so routing-manual's row.locator(".hint") matched two and failed strict mode, and the taller editor put Add a rule below the fold in routing-time, where Playwright's scroll into view is put back by the app (only the reader moves the view) and the click timed out. The UI change was deliberate: routing-manual reads the routing's own hint as the row's first .hint, and routing-time wheels Add a rule into the middle of the view first, as routing-manual already does for its rows. All 30 routing-*.test.cjs (85 tests) pass in WebKit; no app code changed.

This commit is contained in:
yetone
2026-10-04 09:38:13 +08:00
parent 7cfb6d35e7
commit 077e7e0b79
2 changed files with 17 additions and 5 deletions
+4 -3
View File
@@ -136,11 +136,12 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await page.waitForTimeout(400);
};
await wheelTo(row);
assert.equal(await row.locator(".hint").textContent(), w.hint);
// the routing's own hint is the first; a group-in-group note follows it
assert.equal(await row.locator(".hint").first().textContent(), w.hint);
await row.locator(".segs .opt", { hasText: w.smart }).click();
assert.notEqual(await row.locator(".hint").textContent(), w.hint);
assert.notEqual(await row.locator(".hint").first().textContent(), w.hint);
await row.locator(".segs .opt", { hasText: w.manual }).click();
assert.equal(await row.locator(".hint").textContent(), w.hint);
assert.equal(await row.locator(".hint").first().textContent(), w.hint);
assert.ok((await ed.innerText()).includes(w.rulesWait));
const b = ed.locator("button.primary", { hasText: w.save });
await wheelTo(b);
+13 -2
View File
@@ -105,8 +105,19 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.equal(await days1.getAttribute("class"), "rt-cond on");
assert.equal(await rows.first().locator(".rt-rwarn").textContent(), w.night);
// a second rule: its hours typed, nothing moved by a click
await ed.locator("button", { hasText: w.add }).click();
// a second rule: its hours typed, nothing moved by a click. The
// reader wheels Add a rule into view first: the editor runs past the
// fold since the hints under Routing (a click's scroll is put back)
const wheelTo = async (x) => {
const d = await x.evaluate((e) => { const v = document.querySelector("#view-routing");
return Math.round(e.getBoundingClientRect().top - v.getBoundingClientRect().top - v.clientHeight / 2); });
await page.mouse.move(550, 400);
await page.mouse.wheel(0, d);
await page.waitForTimeout(400);
};
const addBtn = ed.locator("button", { hasText: w.add });
await wheelTo(addBtn);
await addBtn.click();
const row2 = rows.nth(1);
const tm2 = row2.locator(".rt-cond.tm");
await tm2.waitFor();