51 lines
2.3 KiB
TypeScript
51 lines
2.3 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
test.setTimeout(120_000);
|
|
|
|
test("renders live object detail and lazy tab requests", async ({ page }) => {
|
|
const apiRequests: string[] = [];
|
|
const consoleErrors: string[] = [];
|
|
|
|
page.on("request", (request) => {
|
|
const url = new URL(request.url());
|
|
if (url.pathname.startsWith("/api/v1")) {
|
|
apiRequests.push(`${url.pathname}${url.search}`);
|
|
}
|
|
});
|
|
page.on("console", (message) => {
|
|
if (message.type() === "error") {
|
|
consoleErrors.push(message.text());
|
|
}
|
|
});
|
|
|
|
await page.goto("/");
|
|
await page.getByRole("button", { name: /Objects/i }).click();
|
|
|
|
await expect(page.getByRole("heading", { name: "MFT object" })).toBeVisible({ timeout: 70_000 });
|
|
await expect(page.getByText("5A179648B3EF2369DCE7BDB58140FF7DC7060ABF.mft").first()).toBeVisible();
|
|
await expect(page.getByText("Final status: valid")).toBeVisible();
|
|
const objectDetail = page.getByRole("complementary", { name: "Live object detail" });
|
|
await expect(objectDetail.getByText("Authoritative", { exact: true })).toBeVisible();
|
|
expect(apiRequests.some((request) => request.includes("/objects/ff44545d40ad3732405b46ec/parsed"))).toBe(false);
|
|
|
|
await page.getByRole("tab", { name: "Parsed" }).click();
|
|
await expect(page.getByText("Projection unavailable")).toBeVisible({ timeout: 30_000 });
|
|
expect(apiRequests.some((request) => request.includes("/objects/ff44545d40ad3732405b46ec/parsed"))).toBe(true);
|
|
|
|
await page.getByRole("tab", { name: "Chain" }).click();
|
|
await expect(page.getByText("No chain edges recorded for this object.")).toBeVisible({ timeout: 30_000 });
|
|
expect(apiRequests.some((request) => request.includes("/objects/ff44545d40ad3732405b46ec/chain"))).toBe(true);
|
|
|
|
await page.getByRole("tab", { name: "Validation" }).click();
|
|
await page.getByRole("button", { name: "Explain validation" }).click();
|
|
await expect(page.getByText("audit_projection")).toBeVisible({ timeout: 30_000 });
|
|
await expect(objectDetail.getByText("false").last()).toBeVisible();
|
|
expect(apiRequests.some((request) => request.includes("/validation/explain"))).toBe(true);
|
|
|
|
await page.screenshot({
|
|
path: "../../../../specs/develop/20260617/m5_playwright/rpki-explorer-object-detail-live.png",
|
|
fullPage: true
|
|
});
|
|
expect(consoleErrors).toEqual([]);
|
|
});
|