gui tests: login-import gives the sign-in window it opens an empty page instead of ChatGPT's real one, whose Cloudflare challenge hung this page's clicks in Chromium (#1307)

The browser sign-in calls window.open on auth.openai.com, and only the
page was routed, so the new window loaded the real site: Cloudflare's
challenge. While it runs, Playwright's clicks on the opener in Chromium
stall at "performing click action" past their 5s.

Shown with a page that opens the same window and then clicks a button
30 times, 8 at once: real window, every run had 1-2 clicks time out
(max 5.0-5.5s), twice over; window routed to an empty page, 0 timeouts
(max 1.2-4.0s at load ~100-117). The test itself, 10 at once in
Chromium (load 150-190): before 20/20 and 19/20 subtests failed (click
or fill timeouts at lines 111-117, after the window opened); after
0/20 twice. WebKit, 8 at once: 0/16. en and zh both run.
This commit is contained in:
yetone
2026-10-09 01:02:51 +08:00
parent 7ddea2c2e0
commit 9755201b44
+4
View File
@@ -66,6 +66,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
page.on("pageerror", (e) => errors.push(e.message));
const posted = [];
await page.route("**/*", serve(lang, posted));
// the browser sign-in opens ChatGPT's page in a new window, and the real
// one is Cloudflare's challenge: in Chromium, while it runs, clicks on
// this page hung past their 5s (#1307). The window gets an empty page
await context.route((url) => url.hostname !== "magpie.test", (route) => route.fulfill({ contentType: "text/html", body: "" }));
t.after(async () => {
if (process.env.ARTIFACT_DIR) {
await fs.mkdir(process.env.ARTIFACT_DIR, { recursive: true });