Rebrands the product from MobilityOps to Fleet Ops across the UI, backend defaults and knowledge base, and makes nl-BE/en-GB/fr-BE full first-class languages: i18next with eager-bundled per-namespace resources, a persisted accessible language switcher (topbar and mobile drawer), locale-aware date/number formatting, and a coverage test that fails the build on any missing or empty translation key. Backend dynamic content (demo scenarios, blocked-reason text, integration status) moves from fixed English/Dutch prose to stable message codes + params so the frontend can localize it; the demo knowledge base gains a fully translated NL/EN/FR procedure corpus (11 documents each) with per-language retrieval and localized evidence-state messages. The Demo Guide becomes breakpoint-adaptive: a docked rail on extra-wide desktop, a floating panel that auto-collapses to a persistent, closable progress chip on standard desktop/tablet, and a collapsed/half/full bottom sheet on mobile -- with scroll+focus+ highlight on "go to this step", Escape handling, and reduced-motion support. The Data Quality Workbench gets accessible choice-card decisions with a clear primary/ secondary/tertiary action hierarchy; the Automation ledger groups repeated successes and uses meaningful short refs; the Audit trail groups events by correlation id with human action labels and readable before/after diffs. Attention Queue, Today's movements, Vehicles, Bookings and Data Quality rows are fully clickable (stretched-link pattern) with independent secondary links, keyboard support and mobile touch targets. Fixes a topbar overflow on mobile caused by the new language switcher (moved into the mobile drawer at <=960px) and two dangling aria-labelledby references introduced this session. Updates all affected Playwright specs for the new nl-BE default and the new Audit/DemoGuide DOM structure, and adds new i18n-coverage, demo-guide-adaptive and clickable-rows specs. 131 backend tests, Ruff and mypy, and 71 Playwright tests pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
62 lines
3.1 KiB
TypeScript
62 lines
3.1 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
test.describe.configure({ mode: "serial" });
|
|
|
|
test("demo entry screen names the fictional org and never shows a password", async ({ page }) => {
|
|
await page.goto("/login");
|
|
await expect(page.getByText(/Northstar Mobility/)).toBeVisible();
|
|
await expect(page.getByText(/Synthetische demo/)).toBeVisible();
|
|
await expect(page.getByRole("button", { name: "Start begeleide demo" })).toBeVisible();
|
|
await expect(page.getByRole("button", { name: "Verken als Operations Manager" })).toBeVisible();
|
|
await expect(page.getByRole("button", { name: "Verken als Rental Employee" })).toBeVisible();
|
|
await expect(page.locator('input[type="password"]')).toHaveCount(0);
|
|
});
|
|
|
|
test("start guided demo logs in as Operations Manager and opens the guide at step 1", async ({ page }) => {
|
|
await page.goto("/login");
|
|
await page.getByRole("button", { name: "Start begeleide demo" }).click();
|
|
// The ?guide=start marker is a one-shot signal the dashboard strips immediately after
|
|
// consuming it, so assert on its effect (the guide panel opens at step 1) rather than
|
|
// the transient URL, which can already be gone by the time this assertion runs.
|
|
await expect(page).toHaveURL(/\/dashboard/);
|
|
await expect(page.getByText("Amelie De Ridder")).toBeVisible();
|
|
await expect(page.getByRole("dialog", { name: "Gegidste demo" })).toBeVisible();
|
|
await expect(page.getByRole("heading", { name: "1. Begrijp de operationele status" })).toBeVisible();
|
|
});
|
|
|
|
test("permanent demo badge shows a popover with last reset info and a working About link", async ({ page }) => {
|
|
await page.goto("/login");
|
|
await page.getByRole("button", { name: "Verken als Operations Manager" }).click();
|
|
await expect(page).toHaveURL(/\/dashboard$/);
|
|
|
|
const trigger = page.getByRole("button", { name: /Synthetische demo/ });
|
|
await expect(trigger).toBeVisible();
|
|
await trigger.click();
|
|
await expect(page.getByRole("dialog", { name: "Over deze demo-omgeving" })).toBeVisible();
|
|
await expect(page.getByText(/Laatste reset:/)).toBeVisible();
|
|
|
|
await page.getByRole("link", { name: /Over deze demo/ }).click();
|
|
await expect(page).toHaveURL(/\/about$/);
|
|
await expect(page.getByRole("heading", { name: "Wat Fleet Ops wel en niet is" })).toBeVisible();
|
|
await expect(page.getByText("Northstar Mobility").first()).toBeVisible();
|
|
await expect(page.getByText("Demomodus").first()).toBeVisible();
|
|
await expect(page.getByText("Niet gekoppeld").first()).toBeVisible();
|
|
});
|
|
|
|
test("badge popover closes on Escape and outside click", async ({ page }) => {
|
|
await page.goto("/login");
|
|
await page.getByRole("button", { name: "Verken als Operations Manager" }).click();
|
|
await expect(page).toHaveURL(/\/dashboard$/);
|
|
|
|
const trigger = page.getByRole("button", { name: /Synthetische demo/ });
|
|
await trigger.click();
|
|
await expect(page.getByRole("dialog")).toBeVisible();
|
|
await page.keyboard.press("Escape");
|
|
await expect(page.getByRole("dialog")).toBeHidden();
|
|
|
|
await trigger.click();
|
|
await expect(page.getByRole("dialog")).toBeVisible();
|
|
await page.mouse.click(10, 10);
|
|
await expect(page.getByRole("dialog")).toBeHidden();
|
|
});
|