From 92a48f1e178bb37ecbf9351495311c901ba1209d Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Fri, 3 Apr 2026 09:37:35 +0100 Subject: [PATCH] feat: add status check tests for Admin and Public dashboards, remove obsolete Telemetry status checks --- E2E/README.md | 4 +- E2E/Tests/AdminDashboard/StatusCheck.spec.ts | 20 ++++++++++ E2E/Tests/PublicDashboard/StatusCheck.spec.ts | 22 +++++++++++ E2E/Tests/TelemetryIngest/StatusCheck.spec.ts | 38 ------------------- 4 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 E2E/Tests/AdminDashboard/StatusCheck.spec.ts create mode 100644 E2E/Tests/PublicDashboard/StatusCheck.spec.ts delete mode 100644 E2E/Tests/TelemetryIngest/StatusCheck.spec.ts diff --git a/E2E/README.md b/E2E/README.md index 19f171c815..6e73a8876c 100644 --- a/E2E/README.md +++ b/E2E/README.md @@ -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 diff --git a/E2E/Tests/AdminDashboard/StatusCheck.spec.ts b/E2E/Tests/AdminDashboard/StatusCheck.spec.ts new file mode 100644 index 0000000000..9f80308393 --- /dev/null +++ b/E2E/Tests/AdminDashboard/StatusCheck.spec.ts @@ -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"); + }); +}); diff --git a/E2E/Tests/PublicDashboard/StatusCheck.spec.ts b/E2E/Tests/PublicDashboard/StatusCheck.spec.ts new file mode 100644 index 0000000000..1d7f6e0944 --- /dev/null +++ b/E2E/Tests/PublicDashboard/StatusCheck.spec.ts @@ -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"); + }); +}); diff --git a/E2E/Tests/TelemetryIngest/StatusCheck.spec.ts b/E2E/Tests/TelemetryIngest/StatusCheck.spec.ts deleted file mode 100644 index 058ab8968d..0000000000 --- a/E2E/Tests/TelemetryIngest/StatusCheck.spec.ts +++ /dev/null @@ -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"}'); - }); -});