gui tests: every short default timeout gets a minute to load the page (#4787)
nav-timeout was red on main: five page and panel setDefaultTimeout calls had no setDefaultNavigationTimeout beside them, so on a busy machine their first page.goto had only 5s or 8s: - account-rows-fit (834c6c7df) - profile-rename (1cb4d4301) - quota-caption-contrast, page and panel (95a61a5d1) - window-visibility (dfe868a1e) Each now also gets setDefaultNavigationTimeout(60000), as the other files already do. Only the time a page gets to load changes. Clicks and waits keep their short limit. Run on mote at37cc86b3bplus this change: nav-timeout, account-rows-fit, profile-rename, quota-caption-contrast and window-visibility at --test-concurrency=2, chromium and webkit: 48 of 48 pass. Red on the old code: nav-timeout listed these five calls at origin/main84da86ebd(comment on #4787). Not tried: the whole GUI suite. Nothing outside these test files changes.
This commit is contained in:
@@ -68,6 +68,7 @@ for (const engine of engines) {
|
||||
t.after(() => browser.close());
|
||||
const page = await browser.newPage({ viewport: { width, height: 900 }, reducedMotion: "reduce" });
|
||||
page.setDefaultTimeout(5000);
|
||||
page.setDefaultNavigationTimeout(60000);
|
||||
const errors = [];
|
||||
page.on("pageerror", (e) => errors.push(e.message));
|
||||
const reads = { n: 0 };
|
||||
|
||||
@@ -65,6 +65,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
const w = words[lang], calls = [], errors = [];
|
||||
const page = await (await browser.newContext({ viewport: panel ? { width: 360, height: 420 } : { width: 900, height: 560 } })).newPage();
|
||||
page.setDefaultTimeout(5000);
|
||||
page.setDefaultNavigationTimeout(60000);
|
||||
page.on("pageerror", (e) => errors.push(e.message));
|
||||
await page.route("**/*", server(lang, calls));
|
||||
await page.goto("http://magpie.test/" + (panel ? "?mode=panel" : ""));
|
||||
|
||||
@@ -84,6 +84,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
const errors = [];
|
||||
const page = await ctx.newPage();
|
||||
page.setDefaultTimeout(8000);
|
||||
page.setDefaultNavigationTimeout(60000);
|
||||
page.on("pageerror", (e) => errors.push(e.message));
|
||||
await page.route("**/*", serve(lang, theme, true));
|
||||
await page.goto("http://magpie.test/?view=usage");
|
||||
@@ -102,6 +103,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await ctx.addInitScript(() => { try { localStorage.setItem("magpie.panelTab", "usage"); } catch {} });
|
||||
const panel = await ctx.newPage();
|
||||
panel.setDefaultTimeout(8000);
|
||||
panel.setDefaultNavigationTimeout(60000);
|
||||
await panel.route("**/*", serve(lang, theme, false));
|
||||
await panel.goto("http://magpie.test/?mode=panel");
|
||||
await panel.locator(".pq-card .pq-sub").first().waitFor();
|
||||
|
||||
@@ -36,6 +36,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
t.after(() => browser.close());
|
||||
const page = await browser.newPage();
|
||||
page.setDefaultTimeout(5000);
|
||||
page.setDefaultNavigationTimeout(60000);
|
||||
await page.route("**/*", serve());
|
||||
await page.goto("http://magpie.test/?view=providers");
|
||||
await page.waitForFunction(() => typeof window.magpieWindowVisibility === "function");
|
||||
|
||||
Reference in New Issue
Block a user