Network-Analyzer: Traffic Monitor test Completed
This commit is contained in:
parent
d27f515d8e
commit
1038dfd9e7
1 changed files with 130 additions and 36 deletions
|
@ -1,50 +1,144 @@
|
||||||
import { test, expect } from '@playwright/test';
|
import { test, expect } from '@playwright/test';
|
||||||
|
|
||||||
test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () => {
|
test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.describe('Traffic Distribution', () => {
|
||||||
await page.goto('network-analyzer/traffic-monitor', {
|
test.beforeEach(async ({ page }) => {
|
||||||
waitUntil: 'networkidle'
|
await page.goto('network-analyzer/traffic-monitor', {
|
||||||
|
waitUntil: 'networkidle'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Title', async ({ page }) => {
|
||||||
|
const title = await page.title();
|
||||||
|
expect(title).toBe(
|
||||||
|
'Difuse - Dashboard - Network Analyzer - Traffic Monitor'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Traffic Distribution Top Cards', async ({ page }) => {
|
||||||
|
const hosts = await page.getByRole('heading', { name: 'Hosts' });
|
||||||
|
const hostsIcon = await page.locator('.mdi-server-network');
|
||||||
|
|
||||||
|
expect(hosts).toBeTruthy();
|
||||||
|
const hostsValue = await page.textContent('#thc');
|
||||||
|
expect(typeof parseInt(hostsValue)).toBe('number');
|
||||||
|
|
||||||
|
const upload = await page.getByRole('heading', { name: 'Upload' });
|
||||||
|
const uploadIcon = await page.locator('.mdi-upload');
|
||||||
|
|
||||||
|
const uploadValue = await page.textContent('#tuc');
|
||||||
|
expect(typeof parseInt(uploadValue)).toBe('number');
|
||||||
|
|
||||||
|
const download = await page.getByRole('heading', { name: 'Download' });
|
||||||
|
const downloadIcon = await page.locator('.mdi-download');
|
||||||
|
|
||||||
|
const downloadValue = await page.textContent('#tdc');
|
||||||
|
expect(typeof parseInt(downloadValue)).toBe('number');
|
||||||
|
|
||||||
|
const connections = await page.getByRole('heading', {
|
||||||
|
name: 'Connections'
|
||||||
|
});
|
||||||
|
const connectionsIcon = await page.locator('.mdi-lan-connect');
|
||||||
|
|
||||||
|
const connectionsValue = await page.textContent('#tcc');
|
||||||
|
expect(typeof parseInt(connectionsValue)).toBe('number');
|
||||||
|
|
||||||
|
expect(hosts && upload && download && connections).toBeTruthy();
|
||||||
|
expect(
|
||||||
|
hostsIcon && uploadIcon && downloadIcon && connectionsIcon
|
||||||
|
).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Traffic', async ({ page }) => {
|
||||||
|
expect(await page.$('header:has-text("Traffic")')).toBeTruthy();
|
||||||
|
expect(await page.isVisible('#chart-1'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Connections', async ({ page }) => {
|
||||||
|
expect(await page.$('header:has-text("Connections")')).toBeTruthy();
|
||||||
|
expect(await page.isVisible('#chart-2'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Traffic Distribution', async ({ page }) => {
|
||||||
|
expect(await page.$('header:has-text("Traffic Distribution")')).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Title', async ({ page }) => {
|
test.describe('Application Protocol', () => {
|
||||||
const title = await page.title();
|
test.beforeEach(async ({ page }) => {
|
||||||
expect(title).toBe(
|
await page.goto('network-analyzer/traffic-monitor', {
|
||||||
'Difuse - Dashboard - Network Analyzer - Traffic Monitor'
|
waitUntil: 'networkidle'
|
||||||
);
|
});
|
||||||
|
|
||||||
|
await page.click('#app-tab-bwm');
|
||||||
|
});
|
||||||
|
test('Download / Application', async ({ page }) => {
|
||||||
|
expect(await page.$('header:has-text("Download / Application")')).toBeTruthy();
|
||||||
|
expect(await page.isVisible('#chart-3'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Upload / Application', async ({ page }) => {
|
||||||
|
expect(await page.$('header:has-text("Upload / Application")')).toBeTruthy();
|
||||||
|
expect(await page.isVisible('#chart-4'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Application Protocol', async ({ page }) => {
|
||||||
|
expect(await page.$('header:has-text("Application Protocol")')).toBeTruthy();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Traffic Distribution Top Cards', async ({ page }) => {
|
test.describe('Internet Protocol', () => {
|
||||||
const hosts = await page.getByRole('heading', { name: 'Hosts' });
|
test.beforeEach(async ({ page }) => {
|
||||||
const hostsIcon = await page.locator('.mdi-server-network');
|
await page.goto('network-analyzer/traffic-monitor', {
|
||||||
|
waitUntil: 'networkidle'
|
||||||
|
});
|
||||||
|
|
||||||
expect(hosts).toBeTruthy();
|
await page.click('#app-tab-bwm');
|
||||||
const hostsValue = await page.textContent('#thc');
|
|
||||||
expect(hostsValue).toMatch(/^\d+$/); // check if it is an integer
|
|
||||||
|
|
||||||
const upload = await page.getByRole('heading', { name: 'Upload' });
|
|
||||||
const uploadIcon = await page.locator('.mdi-upload');
|
|
||||||
|
|
||||||
const uploadValue = await page.textContent('#tuc');
|
|
||||||
expect(uploadValue).toMatch(/^\d+(\.\d+)? MiB$/); // check if it is a float followed by MiB
|
|
||||||
|
|
||||||
const download = await page.getByRole('heading', { name: 'Download' });
|
|
||||||
const downloadIcon = await page.locator('.mdi-download');
|
|
||||||
|
|
||||||
const downloadValue = await page.textContent('#tdc');
|
|
||||||
expect(downloadValue).toMatch(/^\d+(\.\d+)? MiB$/); // check if it is a float followed by MiB
|
|
||||||
|
|
||||||
const connections = await page.getByRole('heading', {
|
|
||||||
name: 'Connections'
|
|
||||||
});
|
});
|
||||||
const connectionsIcon = await page.locator('.mdi-lan-connect');
|
|
||||||
|
|
||||||
const connectionsValue = await page.textContent('#tcc');
|
test('IPv4 vs. IPv6', async ({ page }) => {
|
||||||
expect(connectionsValue).toMatch(/^\d+(\.\d+)?K?$/); // check if it is a float or integer
|
expect(await page.$('header:has-text("IPv4 vs. IPv6")')).toBeTruthy();
|
||||||
|
expect(await page.isVisible('#chart-5'));
|
||||||
|
});
|
||||||
|
|
||||||
expect(hosts && upload && download && connections).toBeTruthy();
|
test('Dualstack Distribution', async ({ page }) => {
|
||||||
expect(
|
expect(await page.$('header:has-text("Dualstack Distribution")')).toBeTruthy();
|
||||||
hostsIcon && uploadIcon && downloadIcon && connectionsIcon
|
expect(await page.isVisible('#chart-6'));
|
||||||
).toBeTruthy();
|
});
|
||||||
|
|
||||||
|
test('Usage by Host', async ({ page }) => {
|
||||||
|
expect(await page.$('header:has-text("Usage by Host")')).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('Export', () => {
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await page.goto('network-analyzer/traffic-monitor', { waitUntil: 'load' });
|
||||||
|
await page.click('#export-tab-bwm');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Grouped By Mac (CSV) Download Button', async ({ page }) => {
|
||||||
|
const groupedByMac = await page.locator('a:has-text("Grouped By Mac (CSV)")');
|
||||||
|
const isVisible = await groupedByMac.isVisible();
|
||||||
|
expect(isVisible).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Grouped By IP (CSV) Download Button', async ({ page }) => {
|
||||||
|
const groupedByIp = await page.locator('a:has-text("Grouped By IP (CSV)")');
|
||||||
|
const isVisible = await groupedByIp.isVisible();
|
||||||
|
expect(isVisible).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Grouped By Protocol (CSV) Download Button', async ({ page }) => {
|
||||||
|
const groupedByProtocol = await page.locator('a:has-text("Grouped By Protocol (CSV)")');
|
||||||
|
const isVisible = await groupedByProtocol.isVisible();
|
||||||
|
expect(isVisible).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('JSON Dump Download Button', async ({ page }) => {
|
||||||
|
const jsonDump = await page.locator('a:has-text("JSON Dump")');
|
||||||
|
const isVisible = await jsonDump.isVisible();
|
||||||
|
expect(isVisible).toBeTruthy();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue