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('.charts-body'); 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(); }); });