// Abnahme-Screenshots der neuen skillfactor-Landingpage (Factorial-Look).
import { createRequire } from "node:module";

const require = createRequire("C:/Program Files (x86)/TempoBill/Zeiterfassung.Cloud/Sites(staging)/package.json");
const puppeteer = require("puppeteer-core");

const browser = await puppeteer.launch({
  executablePath: "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe",
  headless: true,
  args: ["--no-sandbox"],
  defaultViewport: { width: 1920, height: 1080 },
});
const page = await browser.newPage();
await page.goto("https://zeiterfassung.cloud/skillfactor/", { waitUntil: "networkidle2", timeout: 60000 });
await new Promise((r) => setTimeout(r, 1500));
const out = "C:/dev/skillfactor/docs/screenshots";
await page.screenshot({ path: `${out}/landing-hero.png` });
await page.evaluate(() => window.scrollTo(0, 1400));
await new Promise((r) => setTimeout(r, 800));
await page.screenshot({ path: `${out}/landing-formula.png` });
await page.evaluate(() => window.scrollTo(0, 3300));
await new Promise((r) => setTimeout(r, 800));
await page.screenshot({ path: `${out}/landing-layers.png` });
await browser.close();
console.log("shots ok");
