check-agents-grid.mjs 967 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { chromium } from "playwright-core";
  2. const browser = await chromium.launch({
  3. executablePath: "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
  4. headless: true
  5. });
  6. const page = await browser.newPage({
  7. viewport: { width: 1600, height: 1200 },
  8. deviceScaleFactor: 1
  9. });
  10. await page.goto("http://127.0.0.1:3000/agents", { waitUntil: "networkidle" });
  11. const result = await page.evaluate(() => {
  12. const list = document.querySelector(".agents-worklist");
  13. if (!(list instanceof HTMLElement)) {
  14. throw new Error("agents-worklist not found");
  15. }
  16. const style = window.getComputedStyle(list);
  17. const template = style.gridTemplateColumns;
  18. const count = template.split(" ").filter(Boolean).length;
  19. return {
  20. gridTemplateColumns: template,
  21. columnCount: count
  22. };
  23. });
  24. await page.screenshot({ path: "artifacts/agents-grid-check.png", fullPage: true });
  25. await browser.close();
  26. console.log(JSON.stringify(result, null, 2));