Files
Hartmut b41c1d2501
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61)
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61)

Co-authored-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
Co-committed-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
2026-05-21 16:28:40 +02:00

64 lines
2.2 KiB
TypeScript

import { expect, test, type Page } from "@playwright/test";
async function signIn(page: Page) {
await page.goto("/auth/signin");
await page.fill('input[type="email"]', "admin@nexus.dev");
await page.fill('input[type="password"]', "admin123");
await page.click('button[type="submit"]');
await expect(page).toHaveURL(/\/(dashboard|resources)/);
}
test.describe("Bench Board", () => {
test.beforeEach(async ({ page }) => {
await signIn(page);
await page.goto("/bench");
});
test("bench board page loads with heading", async ({ page }) => {
await page.waitForLoadState("networkidle");
await expect(page.locator("h1", { hasText: "Bench Board" })).toBeVisible({ timeout: 10000 });
});
test("date range filter inputs are visible", async ({ page }) => {
await page.waitForLoadState("networkidle");
const dateInputs = page.locator('input[type="date"]');
await expect(dateInputs.first()).toBeVisible({ timeout: 10000 });
// Should have at least a From and To date input
expect(await dateInputs.count()).toBeGreaterThanOrEqual(2);
});
test("shows bench results or no-resources empty state", async ({ page }) => {
await page.waitForLoadState("networkidle");
await expect(
page
.locator("table")
.or(page.locator("text=No resources on bench"))
.or(page.locator("text=No results"))
.first(),
).toBeVisible({ timeout: 15000 });
});
test("role filter input is present", async ({ page }) => {
await page.waitForLoadState("networkidle");
// There should be a text input to filter by role/name
await expect(
page.locator('input[type="text"]').or(page.locator('input[placeholder*="role" i]')).first(),
).toBeVisible({ timeout: 10000 });
});
test("no console errors on load", async ({ page }) => {
const consoleErrors: string[] = [];
page.on("console", (msg) => {
if (msg.type() === "error") {
consoleErrors.push(msg.text());
}
});
await page.goto("/bench");
await page.waitForLoadState("networkidle");
const appErrors = consoleErrors.filter(
(e) => !e.includes("extension") && !e.includes("favicon"),
);
expect(appErrors, `Unexpected console errors: ${appErrors.join("\n")}`).toHaveLength(0);
});
});