Files
MobilityOps/frontend/e2e/recruiter-polish.spec.ts
T
NuklearRabbit cb7edb0b84
MobilityOps acceptance / backend (push) Canceled after 0s
MobilityOps acceptance / frontend (push) Canceled after 0s
M31: align RAG verification with provider contract
2026-08-10 21:02:47 +02:00

85 lines
3.8 KiB
TypeScript

import { expect, test, type Page } from "@playwright/test";
test.describe.configure({ mode: "serial" });
async function loginAsOperationsManager(page: Page) {
await page.goto("/login");
await page.getByRole("button", { name: "Verken als Operationsmanager" }).click();
await expect(page).toHaveURL(/\/dashboard$/);
}
test("90-second recruiter entry exposes three verifiable engineering highlights", async ({ page }) => {
await page.goto("/login");
await page.getByRole("button", { name: "Bekijk de highlights in 90 seconden" }).click();
await expect(page).toHaveURL(/\/highlights$/);
await expect(page.getByRole("heading", { name: "De sterkste keuzes in 90 seconden" })).toBeVisible();
await expect(page.locator(".highlight-card")).toHaveCount(3);
await expect(page.getByText("Transactie · idempotency · outbox · degradatie")).toBeVisible();
await expect(page.getByText("RAGcore · citations · veilige degradatie")).toBeVisible();
});
test("Engineering Story exposes architecture, reliability and honest integration evidence", async ({ page }) => {
await loginAsOperationsManager(page);
await page.goto("/about");
await expect(page.getByRole("heading", { name: "Controle, betrouwbaarheid en uitlegbaarheid" }).first()).toBeVisible();
await expect(page.getByText("Commit eerst, orkestreer daarna")).toBeVisible();
await expect(page.getByText("AI moet bewijs tonen")).toBeVisible();
await expect(page.getByText("PostgreSQL + audittrail")).toBeVisible();
await expect(page.getByText(/nog niet live gekoppeld/)).toHaveCount(0);
await expect(page.getByText(/unknown procedures/)).toHaveCount(0);
});
test("mobile recruiter surfaces remain readable without horizontal overflow", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto("/login");
await page.getByRole("button", { name: "Bekijk de highlights in 90 seconden" }).click();
await expect(page).toHaveURL(/\/highlights$/);
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
expect(overflow).toBeLessThanOrEqual(1);
await expect(page.locator(".highlight-card").first()).toBeVisible();
});
test("remaining attention items use a compact, legible queue action", async ({ page, request }) => {
await request.post("/api/v1/demo/login", { data: { role: "operations_manager" } });
await request.post("/api/v1/demo/reset");
await loginAsOperationsManager(page);
const queueAction = page.locator(".queue-more a");
await expect(queueAction).toContainText("Nog 2 aandachtspunten");
await expect(queueAction).toContainText("Open de volledige werklijst");
const actionBox = await queueAction.boundingBox();
const arrowBox = await queueAction.locator(".queue-more-arrow svg").boundingBox();
expect(actionBox?.height).toBeLessThanOrEqual(70);
expect(arrowBox?.width).toBeLessThanOrEqual(16);
});
test("Knowledge Hub renders independently verified RAGcore index evidence", async ({ page }) => {
await loginAsOperationsManager(page);
await page.route("**/api/v1/knowledge/status**", async (route) => {
await route.fulfill({
contentType: "application/json",
body: JSON.stringify({
provider: "ragcore",
available: true,
detail: "11/11 managed sources verified",
tenant: "northstar-mobility-demo",
workspace: "mobilityops",
collection: "internal-procedures",
document_count: 11,
source_document_count: 11,
reported_synced_document_count: 33,
reported_failed_document_count: 0,
last_sync_at: "2026-08-10T16:00:00Z",
statistics_state: "verified",
}),
});
});
await page.goto("/knowledge");
await expect(page.getByText("11 procedures geïndexeerd")).toBeVisible();
await expect(page.getByText("exact gevonden en actief gepubliceerd")).toBeVisible();
});