import { expect, test } from "@playwright/test"; test("workspace navigation and primary controls expose accessible state", async ({ page }) => { await page.goto("/#analysis"); for (const workspace of ["Analysis", "Timeline", "Hunting", "Reports", "Settings"]) { await expect(page.getByRole("button", { name: workspace, exact: false }).first()).toBeEnabled(); } await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); await page.getByRole("button", { name: "Timeline", exact: false }).click(); await expect(page.getByRole("button", { name: "Timeline", exact: false }).first()).toHaveAttribute("aria-current", "page"); await expect(page.getByRole("textbox", { name: "Search normalized evidence" })).toBeVisible(); await expect(page.getByLabel("Filter by category")).toBeVisible(); await expect(page.getByLabel("Filter by level")).toBeVisible(); await expect(page.getByLabel("Filter by provider")).toBeVisible(); await expect(page.getByRole("button", { name: "Previous evidence" })).toHaveAttribute("aria-label", "Previous evidence"); await expect(page.getByRole("listitem").first()).toHaveAttribute("aria-setsize", /[0-9]+/); await page.getByRole("textbox", { name: "Search normalized evidence" }).focus(); await page.keyboard.press("Tab"); await expect(page.locator(":focus")).toBeVisible(); await page.getByRole("button", { name: "Hunting", exact: false }).click(); await expect(page.getByRole("textbox", { name: "Search hunting evidence" })).toBeVisible(); await page.getByRole("button", { name: "Reports", exact: false }).click(); await expect(page.getByRole("button", { name: "Export JSON", exact: true })).toBeVisible(); await page.getByRole("button", { name: "Settings", exact: false }).click(); await expect(page.getByRole("group", { name: "Timestamp display" })).toBeVisible(); await page.setViewportSize({ width: 700, height: 900 }); await page.getByRole("button", { name: "Timeline", exact: false }).click(); await expect(page.getByLabel("Evidence time window")).toBeVisible(); await expect(page.getByLabel("Hide informational noise")).toBeVisible(); await expect(page.getByLabel("Focus incident")).toBeVisible(); });