Add and Completed Netdata Test
This commit is contained in:
parent
0436480a44
commit
725ec5d6b0
3 changed files with 81 additions and 4 deletions
|
@ -1,3 +0,0 @@
|
|||
URL=https://192.168.1.1
|
||||
ADMIN_USER=<username>
|
||||
ADMIN_PASS=<password>
|
|
@ -5,7 +5,7 @@ const authFile = 'playwright/.auth/user.json';
|
|||
test('Authenticate', async ({ page }) => {
|
||||
await page.goto('/login');
|
||||
await page.waitForSelector('input[name="user"]', { timeout: 3000 });
|
||||
await page.getByPlaceholder('Username').fill( process.env.ADMIN_USER);
|
||||
await page.getByPlaceholder('Username').fill(process.env.ADMIN_USER);
|
||||
await page.getByPlaceholder('Password').fill(process.env.ADMIN_PASS);
|
||||
await page.getByRole('link', { name: 'Login' }).click();
|
||||
await page.waitForSelector('span:has-text("Quick Actions")', { timeout: 3000 });
|
||||
|
|
80
tests/dashboards/netdata.spec.js
Normal file
80
tests/dashboards/netdata.spec.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
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();
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue