feat: add status check tests for Admin and Public dashboards, remove obsolete Telemetry status checks

This commit is contained in:
Nawaz Dhandala
2026-04-03 09:37:35 +01:00
parent f0d0d81a9b
commit 92a48f1e17
4 changed files with 45 additions and 39 deletions

View File

@@ -91,7 +91,9 @@ E2E/
│ ├── Home/ # Homepage tests
│ ├── IncomingRequestIngest/
│ ├── ProbeIngest/
── StatusPage/ # Status page tests
── StatusPage/ # Status page tests
│ ├── PublicDashboard/
│ └── AdminDashboard/
├── Config.ts # Environment configuration
├── playwright.config.ts # Playwright configuration
└── package.json

View File

@@ -0,0 +1,20 @@
import { BASE_URL } from "../../Config";
import { Page, expect, test } from "@playwright/test";
import URL from "Common/Types/API/URL";
test.describe("check admin dashboard", () => {
test("check if admin dashboard is available", async ({
page,
}: {
page: Page;
}) => {
page.setDefaultNavigationTimeout(120000); // 2 minutes
const response = await page.goto(
`${URL.fromString(BASE_URL.toString()).addRoute("/admin/env.js").toString()}`,
);
expect(response?.ok()).toBeTruthy();
const content: string = (await page.textContent("body")) || "";
expect(content).toContain("window.process.env");
});
});

View File

@@ -0,0 +1,22 @@
import { BASE_URL } from "../../Config";
import { Page, expect, test } from "@playwright/test";
import URL from "Common/Types/API/URL";
test.describe("check public dashboard", () => {
test("check if public dashboard is available", async ({
page,
}: {
page: Page;
}) => {
page.setDefaultNavigationTimeout(120000); // 2 minutes
const response = await page.goto(
`${URL.fromString(BASE_URL.toString())
.addRoute("/public-dashboard")
.toString()}`,
);
expect(response?.ok()).toBeTruthy();
const content: string = await page.content();
expect(content).toContain("/public-dashboard/dist/Index.js");
});
});

View File

@@ -1,38 +0,0 @@
import { BASE_URL } from "../../Config";
import { Page, expect, test } from "@playwright/test";
import URL from "Common/Types/API/URL";
test.describe("check live and health check of telemetry", () => {
test("check if telemetry status is ok", async ({ page }: { page: Page }) => {
page.setDefaultNavigationTimeout(120000); // 2 minutes
await page.goto(
`${URL.fromString(BASE_URL.toString())
.addRoute("/telemetry/status")
.toString()}`,
);
const content: string = await page.content();
expect(content).toContain('{"status":"ok"}');
});
test("check if telemetry is ready", async ({ page }: { page: Page }) => {
page.setDefaultNavigationTimeout(120000); // 2 minutes
await page.goto(
`${URL.fromString(BASE_URL.toString())
.addRoute("/telemetry/status/ready")
.toString()}`,
);
const content: string = await page.content();
expect(content).toContain('{"status":"ok"}');
});
test("check if telemetry is live", async ({ page }: { page: Page }) => {
page.setDefaultNavigationTimeout(120000); // 2 minutes
await page.goto(
`${URL.fromString(BASE_URL.toString())
.addRoute("/telemetry/status/live")
.toString()}`,
);
const content: string = await page.content();
expect(content).toContain('{"status":"ok"}');
});
});