test(ui): cover redesigned journeys and responsive shell

This commit is contained in:
NuklearRabbit
2026-08-02 03:27:30 +02:00
parent fd9b25c25c
commit b3946af4e0
3 changed files with 71 additions and 15 deletions
+9 -7
View File
@@ -20,14 +20,14 @@ test("five-minute demo script end to end", async ({ page, request }) => {
await test.step("1. login as Operations Manager", async () => {
await page.goto("/login");
await expect(page.getByText("Synthetic demo environment")).toBeVisible();
await expect(page.getByText(/Synthetic proof of concept/)).toBeVisible();
await page.getByRole("button", { name: "Open as Operations Manager" }).click();
await expect(page).toHaveURL(/\/dashboard$/);
});
await test.step("2. verify dashboard metrics are loaded", async () => {
await expect(page.getByRole("heading", { name: "Operational metrics" })).toBeVisible();
const metricValues = page.locator(".metric-value");
await expect(page.getByRole("heading", { name: "Fleet readiness" })).toBeVisible();
const metricValues = page.locator(".metric-cell dd");
await expect(metricValues.first()).toBeVisible();
const values = await metricValues.allTextContents();
expect(values.length).toBeGreaterThan(0);
@@ -50,7 +50,9 @@ test("five-minute demo script end to end", async ({ page, request }) => {
await page.getByLabel("End odometer (km)").fill(String(lowReading));
await page.getByLabel("Fuel level (%)").fill("55");
await page.getByRole("button", { name: "Register return" }).click();
await page.getByRole("button", { name: "Review return" }).click();
await expect(page.getByRole("heading", { name: "Review return impact" })).toBeVisible();
await page.getByRole("button", { name: "Confirm return" }).click();
await expect(page.getByRole("heading", { name: "Return registered" })).toBeVisible();
});
@@ -83,14 +85,14 @@ test("five-minute demo script end to end", async ({ page, request }) => {
await page.goto("/audit");
await page.getByLabel("Action").fill("return_registered");
await expect(page.locator(".data-table tbody tr").first()).toBeVisible();
await expect(page.getByText("return_registered").first()).toBeVisible();
await expect(page.getByText("return registered").first()).toBeVisible();
});
await test.step("9. verify responsive navigation at mobile width", async () => {
await page.setViewportSize({ width: 360, height: 800 });
await page.goto("/dashboard");
await expect(page.getByText("Synthetic demo environment")).toBeVisible();
await expect(page.getByRole("link", { name: "Dashboard" })).toBeVisible();
await expect(page.getByText(/Synthetic demo data/).first()).toBeVisible();
await expect(page.getByRole("link", { name: "Overview" }).first()).toBeVisible();
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
const clientWidth = await page.evaluate(() => document.documentElement.clientWidth);
expect(scrollWidth).toBeLessThanOrEqual(clientWidth + 1);