From 9f0831b239769be862cb54d3ed195bd7f6ecbc1e Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 9 Oct 2026 01:02:20 +0800 Subject: [PATCH] gui tests: copilot-ghe gives the device-sign-in window it opens an empty page instead of the real github.com and acme.ghe.com (#1307's sibling) Like login-import's ChatGPT window, only the page was routed, so the window GitHub's device sign-in opens loaded the real site (304 requests to github.githubassets.com in one full Chromium run). It wasn't red here (10 at once in Chromium: 0/20 failed), but its outcome rested on pages the test doesn't control. Chromium and WebKit, en and zh: pass, and no request went past the two window URLs, which the route answers. --- internal/gui/tests/copilot-ghe.test.cjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/gui/tests/copilot-ghe.test.cjs b/internal/gui/tests/copilot-ghe.test.cjs index 16e6d887..dadcb681 100644 --- a/internal/gui/tests/copilot-ghe.test.cjs +++ b/internal/gui/tests/copilot-ghe.test.cjs @@ -44,6 +44,10 @@ for (const engine of engines) for (const lang of ["en", "zh"]) { const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)]; return route.fulfill({ body: await fs.readFile(file), contentType }); }); + // the sign-in opens GitHub's device page in a new window: it gets an + // empty page, not the real github.com or acme.ghe.com, whose pages a + // test can't control (ChatGPT's Cloudflare challenge hung clicks, #1307) + await page.context().route((url) => url.hostname !== "magpie.test", (route) => route.fulfill({ contentType: "text/html", body: "" })); await page.goto("http://magpie.test/"); await page.waitForFunction((l) => state.settings.lang === l, lang); await page.evaluate(() => {