mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat: add status check tests for Admin and Public dashboards, remove obsolete Telemetry status checks
This commit is contained in:
@@ -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
|
||||
|
||||
20
E2E/Tests/AdminDashboard/StatusCheck.spec.ts
Normal file
20
E2E/Tests/AdminDashboard/StatusCheck.spec.ts
Normal 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");
|
||||
});
|
||||
});
|
||||
22
E2E/Tests/PublicDashboard/StatusCheck.spec.ts
Normal file
22
E2E/Tests/PublicDashboard/StatusCheck.spec.ts
Normal 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");
|
||||
});
|
||||
});
|
||||
@@ -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"}');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user