const { chromium } = require("C:/Users/ramez/AppData/Roaming/npm/node_modules/playwright");

(async () => {
  console.log("Launching browser...");
  const browser = await chromium.launch({ headless: true });
  const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
  
  console.log("Navigating to http://localhost:3001 ...");
  try {
    await page.goto("http://localhost:3001", { waitUntil: "networkidle", timeout: 10000 });
  } catch (e) {
    console.log("Network idle timeout or error, proceeding to screenshot...", e.message);
  }

  const screenshotPath = "C:/Users/ramez/.gemini/antigravity-ide/brain/e16f5552-47ce-4483-9b25-8266bb395491/entropyk_ui_screenshot.png";
  await page.screenshot({ path: screenshotPath, fullPage: false });
  console.log(`Screenshot saved to ${screenshotPath}`);
  await browser.close();
})();
