Add Puppeteer scripts for navigation testing and debugging

- Created nav-debug.cjs to log anchor tags and simulate clicks on the Voice navigation link, capturing click events and page navigation.
- Added nav-test.cjs to test the Voice link click and log the URL at various intervals, capturing any page errors.
- Introduced nav-test2.cjs to check the presence of specific elements on the /voice/ page and log any console errors.
- Implemented nav-test4019.cjs to monitor network requests and responses related to the Voice navigation, verifying button presence and click functionality.
This commit is contained in:
asepharyana
2026-08-15 19:23:17 +07:00
parent 1b56212d1a
commit 3c2c1c3b15
9 changed files with 789 additions and 38 deletions
+18
View File
@@ -0,0 +1,18 @@
const puppeteer = require("puppeteer-core");
(async () => {
const browser = await puppeteer.launch({ executablePath: "/usr/bin/google-chrome", headless: true, args: ["--no-sandbox","--disable-setuid-sandbox"] });
const page = await browser.newPage();
const errs = [];
page.on("pageerror", (e) => errs.push("PAGEERR: " + e.message));
page.on("console", (m) => { if (m.type() === "error" || m.type()==="warning") errs.push("CONS["+m.type()+"]: " + m.text().slice(0,100)); });
await page.goto("http://127.0.0.1:4019/voice/", { waitUntil: "domcontentloaded", timeout: 30000 });
await new Promise((r) => setTimeout(r, 4000));
const snap = await page.evaluate(() => ({
url: location.href,
hasVoice: !!Array.from(document.querySelectorAll("*")).find(e => e.textContent && e.textContent.includes("Live speakers")),
hasPicker: !!Array.from(document.querySelectorAll("select"))[0] || false,
}));
console.log("DIRECT /voice/ load:", JSON.stringify(snap));
console.log("ERRORS:", errs.slice(0,15).join("\n") || "none");
await browser.close();
})().catch((e) => { console.error("FAIL:", e.message); process.exit(1); });