const { chromium } = require("@playwright/test");

(async () => {
  const browser = await chromium.launch({
    executablePath:
      "C:/Users/MoBai/AppData/Local/ms-playwright/chromium_headless_shell-1228/chrome-headless-shell-win64/chrome-headless-shell.exe",
  });
  const page = await browser.newPage({ viewport: { width: 1200, height: 800 } });
  page.on("console", (msg) => console.log("[" + msg.type() + "]", msg.text().slice(0, 300)));
  page.on("pageerror", (err) => console.log("[pageerror]", String(err).slice(0, 500)));

  await page.goto("http://localhost:5173/");
  await page.waitForTimeout(6000);
  const html = await page.content();
  console.log("body length:", html.length);
  console.log(html.slice(0, 800));
  await browser.close();
})().catch((e) => {
  console.error(e);
  process.exit(1);
});
