gui tests: text-size zooms the page out only after the 100% post and the click's frame, as the webview does (scrolled from 120 to 61, max 78, since bd33e575's font rows made Settings run past the window's foot)

The test resized the page in the same frame as the click, while the Mac header still drew at 150%'s 33px: the view was 17px taller for a moment and the browser clamped its scroll to it. In magpie the webview zooms only once Go has the post (textsize.go), frames later. Before bd33e575 Settings fit the window and was clamped to 0 either way. Passes 3 runs in a row in Chromium and WebKit, and still fails 2 cases with newTextSize's reset (#911) taken out.
This commit is contained in:
yetone committed 2026-10-07 05:21:17 +08:00
1 parent 61838f7c94
commit 51626258d1
1 file changed
+7
+7
View File
@@ -227,6 +227,13 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert(before > 0, "the settings page must scroll");
await segs.nth(0).click();
await page.locator("#textSizeSegs .opt.on", { hasText: "100%" }).waitFor();
// the webview zooms out only once Go has the post (textsize.go), by
// when the page has drawn the click: the Mac header back at 50px. A
// resize before that frame is clamped to a view 17px too tall, which
// shows once the page runs past the window's foot (bd33e575's font
// rows made Settings that long)
for (let i = 0; i < 50 && !posts.length; i++) await page.waitForTimeout(20);
await page.evaluate(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))));
// the webview's zoom out: the same window is half as many CSS pixels again
await page.setViewportSize({ width: 1440, height: 900 });
await page.waitForTimeout(600);