Files
MobilityOps/frontend/e2e/_capture-screenshots.spec.ts
NuklearRabbit 37a362c4a0 fix: translate remaining NL/FR interface gaps
Role names, audit/scenario labels, and status text were previously either
left in English or only partially translated:
- auth.json/demo.json role labels actually translated (not just labelled
  as translated): Operationsmanager/Verhuurmedewerker,
  Responsable des operations/Collaborateur de location.
- "Audit trail" -> Auditgeschiedenis/Piste d'audit (title, column header,
  and every mid-sentence occurrence across demo.json, quality.json,
  returns.json -- these embedded leaks were previously invisible to the
  whole-string identity check).
- "Open" (status) -> Openstaand, "Recent" -> Recentste,
  "Start scenario" -> Scenario starten / Demarrer le scenario.

Matching Playwright spec text updated in the same commit so the suite
never regresses through a broken intermediate state.
2026-08-04 03:03:46 +02:00

54 lines
2.3 KiB
TypeScript

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` });
});