80 lines
2.6 KiB
JavaScript
80 lines
2.6 KiB
JavaScript
import { test, expect } from "@playwright/test";
|
|
|
|
test.describe("General - Dashboard - Netdata", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/dash-netdata", { waitUntil: "load" });
|
|
});
|
|
|
|
test("Title", async ({ page }) => {
|
|
const title = await page.title();
|
|
expect(title).toBe("Difuse - Dashboard - Netdata");
|
|
});
|
|
|
|
test("Check Netdata iframe loading", async ({ page }) => {
|
|
const iframeElement = await page.locator("#netdataFrame");
|
|
await expect(iframeElement).toBeTruthy();
|
|
|
|
const netdataContent = await page.locator(
|
|
`//div[@class='flex-sc-1m6gk2e-0 layout__Wrapper-sc-1d05imu-0 frXvTZ kLLhdj']`
|
|
);
|
|
expect(netdataContent).toBeTruthy();
|
|
});
|
|
|
|
test("Netdata Key Elements", async ({ page }) => {
|
|
const systemOverview = await page.getByRole("heading", {
|
|
name: "System Overview",
|
|
});
|
|
const CPUs = await page.getByRole("heading", { name: "Memory" });
|
|
const disks = await page.getByRole("heading", { name: "Disks" });
|
|
const newtworkStack = await page.getByRole("heading", {
|
|
name: "Networking Stack",
|
|
});
|
|
const Ipv4 = await page.getByRole("heading", { name: "IPv4 Networking" });
|
|
const Ipv6 = await page.getByRole("heading", { name: "IPv6 Networking" });
|
|
const networkInterfaces = await page.getByRole("heading", {
|
|
name: "Network Interfaces",
|
|
});
|
|
const firewall = await page.getByRole("heading", {
|
|
name: "Firewall (netfilter)",
|
|
});
|
|
const netdataMonitoring = await page.getByRole("heading", {
|
|
name: "Netdata Monitoring",
|
|
});
|
|
|
|
expect(
|
|
systemOverview &&
|
|
CPUs &&
|
|
disks &&
|
|
newtworkStack &&
|
|
Ipv4 &&
|
|
Ipv6 &&
|
|
networkInterfaces &&
|
|
firewall &&
|
|
netdataMonitoring
|
|
).toBeTruthy();
|
|
});
|
|
|
|
test("Display System Overview Chart", async ({ page }) => {
|
|
const diskRead = await page.locator("#easypiechart-system.io-1-chart");
|
|
await expect(diskRead).toBeTruthy();
|
|
|
|
const diskWrite = await page.locator("#easypiechart-system.io-2-chart");
|
|
await expect(diskWrite).toBeTruthy();
|
|
|
|
const CPUguage = await page.locator("#gauge-system.cpu-3-chart");
|
|
await expect(CPUguage).toBeTruthy();
|
|
|
|
const netInbound = await page.locator("#easypiechart-system.net-4-chart");
|
|
await expect(netInbound).toBeTruthy();
|
|
|
|
const netOutbound = await page.locator("#easypiechart-system.net-5-chart");
|
|
await expect(netOutbound).toBeTruthy();
|
|
|
|
const userRAM = await page.locator("#easypiechart-system.ram-6-chart");
|
|
await expect(userRAM).toBeTruthy();
|
|
|
|
await expect(
|
|
diskRead && diskWrite && CPUguage && netInbound && netOutbound && userRAM
|
|
).toBeTruthy();
|
|
});
|
|
});
|