SPB Git
716 B · 7 lines javascript
1import { chromium } from "@playwright/test";2const b = await chromium.launch(); const p = await b.newPage(); const logs = [];3p.on("console", (m) => { if (["error", "warning"].includes(m.type())) logs.push(`${m.type()}: ${m.text().slice(0, 300)}`); }); p.on("pageerror", (e) => logs.push("pageerror: " + e.message.slice(0, 300)));4await p.goto(process.argv[2] ?? "http://127.0.0.1:8540/", { waitUntil: "networkidle" }); await p.waitForTimeout(2500);5const box = p.getByRole("combobox", { name: "Search tools" }).first(); await box.fill("duck"); await p.waitForTimeout(1200); logs.push("listbox count: " + (await p.getByRole("listbox").count()));6console.log(logs.join("\n") || "no console errors"); await b.close();7
Files · ba7bd272caa00f8811bdea5814fbf1150547c055
Menu

Theme