diff --git a/e2e/script.js b/e2e/script.js index 703b426d..40714502 100644 --- a/e2e/script.js +++ b/e2e/script.js @@ -21,7 +21,7 @@ const BASE_URL = "http://127.0.0.1:8787"; // Check if the path is reachable async function checkPath(page, path) { - const res = await page.goto(`${BASE_URL}${path}`); + const res = await page.goto(`${BASE_URL}${path}`, { timeout: 60_000 }); check(res, { [`GET ${path} → 200`]: (r) => r && r.status() === 200 }); } @@ -54,9 +54,8 @@ async function checkButton(page, path, buttonText) { // Check if the button is enabled // Note: In some cases, the button might be visible but not enabled - const isEnabled = await btn.isEnabled(); - check(isEnabled, { - [`Button "${buttonText}" on "${path}" is enabled`]: () => isEnabled, + check(btn, { + [`Button "${buttonText}" on "${path}" is enabled`]: () => btn.isEnabled(), }); } @@ -129,7 +128,6 @@ const PAGES = [ async function runChecks(page) { for (const { path, buttons = [], links = [] } of PAGES) { await checkPath(page, path); - await page.goto(`${BASE_URL}${path}`, { waitUntil: "networkidle" }); for (const btn of buttons) { await checkButton(page, path, btn); }