gui tests: signin-paste-codex, signin-again and signin-closes-sheet give the sign-in window they open an empty page instead of the real vendor's (#1307's siblings)

Found by logging every off-host request in a full Chromium GUI run:
signin-paste-codex opened the real auth.openai.com (Cloudflare's
challenge, the page that hung login-import's clicks), signin-again
loaded www.codebuddy.cn with its downloads and trackers, and
signin-closes-sheet example.com. Each routed only its page. Now the
context answers anything off magpie.test with an empty page; a rerun
logged only the three window URLs, no subresources. Chromium and
WebKit, all three files: 9/9 pass each.
This commit is contained in:
yetone committed 2026-10-09 01:07:41 +08:00
1 parent f9a1ca0355
commit 88f2eb8aa5
3 files changed
+12

No files matched your search

+4
View File
@@ -68,6 +68,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const errors = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", serve(lang, [c.done]));
// the vendor's sign-in page, opened in a new window, gets an empty page:
// the real one is a page the test can't control (ChatGPT's Cloudflare
// challenge hung clicks on this page in Chromium, #1307)
await page.context().route((url) => url.hostname !== "magpie.test", (route) => route.fulfill({ contentType: "text/html", body: "" }));
await page.goto("http://magpie.test/?view=providers");
await page.locator(".row.provider", { hasText: "WorkBuddy" }).click();
const add = page.locator(".editor .accts .acc.add").first();
@@ -62,6 +62,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
page.setDefaultTimeout(5000);
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", serve(lang));
// the vendor's sign-in page, opened in a new window, gets an empty page:
// the real one is a page the test can't control (ChatGPT's Cloudflare
// challenge hung clicks on this page in Chromium, #1307)
await page.context().route((url) => url.hostname !== "magpie.test", (route) => route.fulfill({ contentType: "text/html", body: "" }));
await page.goto("http://magpie.test/?view=providers");
await page.locator("#providers .row").nth(9).waitFor();
await page.locator("#addProvider").click();
@@ -70,6 +70,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const errors = [], posted = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", server(lang, posted));
// the vendor's sign-in page, opened in a new window, gets an empty page:
// the real one is a page the test can't control (ChatGPT's Cloudflare
// challenge hung clicks on this page in Chromium, #1307)
await page.context().route((url) => url.hostname !== "magpie.test", (route) => route.fulfill({ contentType: "text/html", body: "" }));
await page.goto("http://magpie.test/?view=providers");
await page.locator("#addProvider").click();
const sheet = page.locator("#addSheet");