20260728_2 修复rpki-explorer体验问题7项(#134):证书资源可展开、CMS对象新增EE Parsed Tab、Overview增加repo数KPI/修复Object types标签/Top repositories按objects排序(后端sort参数)/reject reasons按前缀聚类可下钻、Run选择器30s轮询

This commit is contained in:
2026-07-28 13:21:58 +08:00
parent 0d6bbec9f3
commit f7f80fe684
20 changed files with 676 additions and 70 deletions

View File

@@ -61,6 +61,22 @@ test("run selector pins the run via ?run= and pages use it", async ({ page }) =>
await expect.poll(() => requests.some((url) => url.includes("/runs/run_0001/"))).toBe(true);
});
test("run selector polls for new runs without a page refresh", async ({ page }) => {
test.setTimeout(60_000);
let runsRequests = 0;
page.on("request", (req) => {
const url = new URL(req.url());
if (/\/api\/v1\/runs$/.test(url.pathname)) runsRequests += 1;
});
await page.goto("/");
await expect(page.getByLabel("Run")).toBeVisible();
// Initial fetch happens immediately; the 30s refetchInterval issues another.
await expect
.poll(() => runsRequests, { timeout: 45_000, intervals: [1_000, 2_000, 5_000] })
.toBeGreaterThan(1);
});
test("topbar search routes to the search page with the query", async ({ page }) => {
await page.goto("/");
const input = page.getByRole("searchbox", { name: "Global search" });
@@ -87,11 +103,15 @@ test("deep links restore page state after reload", async ({ page }) => {
test("runs page lists runs, pins a run and expands artifacts", async ({ page }) => {
await page.goto("/runs");
await expect(page.getByRole("cell", { name: "run_0002" })).toBeVisible();
await expect(page.getByRole("cell", { name: "run_0001" })).toBeVisible();
// Scope to the row: the actions cell also contains the run id in its
// accessible name ("Use run run_0002 …"), so a bare cell lookup is ambiguous.
await expect(
page.getByRole("row", { name: /run_0002/ }).getByRole("cell").first(),
).toContainText("run_0002");
const row = page.getByRole("row", { name: /run_0001/ });
await expect(row.getByRole("cell").first()).toContainText("run_0001");
// Expand artifacts for run_0001
const row = page.getByRole("row", { name: /run_0001/ });
await row.getByRole("button", { name: "Artifacts" }).click();
await expect(page.getByText("/data/runs/run_0001/report.json")).toBeVisible();