import { expect, test } from "@playwright/test"; // One-off tooling to capture evidence screenshots for artifacts/evidence/final-summary.md. // Not part of the regular test suite (prefixed with `_` and excluded from CI runs). const OUT = "../artifacts/evidence/screenshots"; test("capture the seven main pages", async ({ page, request }) => { await request.post("http://localhost:8128/api/v1/demo/login", { data: { role: "operations_manager" }, }); await request.post("http://localhost:8128/api/v1/demo/reset"); await page.goto("/login"); await page.screenshot({ path: `${OUT}/1-login.png` }); await page.getByRole("button", { name: "Verken als Operationsmanager" }).click(); await expect(page.getByRole("heading", { name: "Operational metrics" })).toBeVisible(); await page.screenshot({ path: `${OUT}/2-dashboard.png`, fullPage: true }); await page.goto("/vehicles"); await expect(page.locator(".data-table")).toBeVisible(); await page.screenshot({ path: `${OUT}/3-vehicles.png`, fullPage: true }); await page.goto("/bookings"); await expect(page.locator(".data-table")).toBeVisible(); await page.screenshot({ path: `${OUT}/4-bookings.png`, fullPage: true }); await page.goto("/data-quality"); await expect(page.locator(".data-table")).toBeVisible(); await page.screenshot({ path: `${OUT}/5-data-quality.png`, fullPage: true }); await page.goto("/knowledge"); await page .getByPlaceholder(/What must I do when a vehicle returns with damage/) .fill("What must I do when a vehicle returns with damage?"); await page.getByRole("button", { name: "Ask" }).click(); await expect(page.getByText("Grounded in cited procedures")).toBeVisible(); await page.screenshot({ path: `${OUT}/6-knowledge.png`, fullPage: true }); await page.goto("/automation"); await expect(page.locator(".data-table")).toBeVisible(); await page.screenshot({ path: `${OUT}/7-automation.png`, fullPage: true }); await page.goto("/audit"); await expect(page.locator(".data-table")).toBeVisible(); await page.screenshot({ path: `${OUT}/8-audit.png`, fullPage: true }); await page.setViewportSize({ width: 360, height: 800 }); await page.goto("/dashboard"); await expect(page.getByRole("heading", { name: "Operational metrics" })).toBeVisible(); await page.screenshot({ path: `${OUT}/9-mobile-dashboard.png` }); });