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.
This commit is contained in:
yetone committed 2026-10-09 01:02:51 +08:00
1 parent 9755201b44
commit 9f0831b239
1 file changed
+4
+4
View File
@@ -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(() => {