Files
clawmates/frontend/tests/e2e/p8-topology.spec.ts
T
Omar Sobh 2527a888a2
ci / gates (push) Successful in 6s
ci / frontend (push) Successful in 25s
ci / rust (push) Successful in 3m41s
ci / publish (push) Successful in 46s
ci / e2e (push) Failing after 29m36s
e2e: replace stale post-login heading assertion with a URL wait
The shared signIn helper in every spec asserted
`getByRole("heading", { name: "Clawmates" })` after clicking Sign in, but
the dashboard's "Clawmates" is a decorative <span> in the top-bar logo,
not a heading — so all authenticated tests died on the same helper. Swap
that for `page.waitForURL((url) => !url.pathname.endsWith("/login"))`
with a 15s timeout. Robust across UI redesigns and doesn't couple the
signIn helper to a specific product surface. Should convert ~27 of the
remaining 30 failures to passes.
2026-07-05 21:46:21 -07:00

45 lines
1.9 KiB
TypeScript

import { expect, test, type Page } from "@playwright/test";
// The Topologies page: browse the catalog and build a topology graph against
// the real /api/topologies endpoints (frontend → proxy → backend).
const OWNER_EMAIL = "[email protected]";
const OWNER_PASSWORD = "e2e-password";
async function signIn(page: Page) {
await page.goto("/login");
await page.getByLabel("Email address").fill(OWNER_EMAIL);
await page.getByLabel("Password").fill(OWNER_PASSWORD);
await page.getByRole("button", { name: "Sign in" }).click();
await page.waitForURL((url) => !url.pathname.endsWith("/login"), { timeout: 15000 });
}
test("browse the topology catalog and build a graph", async ({ page }) => {
await signIn(page);
await page.getByRole("link", { name: "Topologies" }).click();
await expect(page).toHaveURL(/\/topologies$/);
await expect(page.getByRole("heading", { name: "Topologies" })).toBeVisible();
// The catalog lists the kinds.
await expect(page.getByRole("button", { name: /hierarchical/i })).toBeVisible();
// Build a pipeline topology and confirm the graph renders.
await page.getByRole("button", { name: /^pipeline$/i }).click();
await page.getByLabel(/Roles/).fill("alpha, beta, gamma");
await page.getByRole("button", { name: "Build" }).click();
await expect(page.locator("svg[aria-label*='topology']")).toBeVisible();
});
test("compare topologies shows a leaderboard and Pareto chart", async ({ page }) => {
await signIn(page);
await page.getByRole("link", { name: "Topologies" }).click();
await page.getByRole("tab", { name: /compare/i }).click();
await page.getByRole("button", { name: "Run comparison" }).click();
// Leaderboard table + Pareto chart render from the comparison result.
await expect(page.getByRole("cell", { name: /pipeline/i })).toBeVisible();
await expect(page.locator("svg[aria-label*='pareto']")).toBeVisible();
});