1.1.0 #1
2 changed files with 158 additions and 2 deletions
148
tests/dashboards/network-analyzer/deep-packet-inspection.spec.js
Normal file
148
tests/dashboards/network-analyzer/deep-packet-inspection.spec.js
Normal file
|
@ -0,0 +1,148 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('General - Dashboard - Network Analyzer - Deep Packet Inspection', () => {
|
||||
test.describe('Overview', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('network-analyzer/deep-packet-inspector', { waitUntil: 'load' });
|
||||
|
||||
await page.waitForSelector('.card-content', { timeout: 3000 });
|
||||
});
|
||||
|
||||
test('Title', async ({ page }) => {
|
||||
const title = await page.title();
|
||||
expect(title).toBe(
|
||||
'Difuse - Dashboard - Network Analyzer - Deep Packet Inspector (DPI)'
|
||||
);
|
||||
});
|
||||
|
||||
test('Deep Packet Inspection (DPI)', async ({ page }) => {
|
||||
expect(await page.$('p:has-text("Deep Packet Inspection (DPI)")')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Tabs', async ({ page }) => {
|
||||
const overviewTab = await page.locator('#overview-tab-dpi');
|
||||
const detailExplorerTab = await page.locator('#detail-tab-dpi');
|
||||
const liveViewTab = await page.locator('#liveview-tab-dpi');
|
||||
const settingsTab = await page.locator('#settings-tab-dpi');
|
||||
|
||||
expect(overviewTab && detailExplorerTab && liveViewTab && settingsTab).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Overview Top Cards', async ({ page }) => {
|
||||
const inspectedFlows = await page.getByRole('heading', { name: 'Inspected Flows' });
|
||||
const inspectedFlowsIcon = await page.locator('.mdi-magnify');
|
||||
|
||||
const inspectedFlowsValue = await page.textContent('#tip');
|
||||
expect(typeof parseInt(inspectedFlowsValue)).toBe('number');
|
||||
|
||||
const applications = await page.getByRole('heading', { name: 'Applications' });
|
||||
const applicationsIcon = await page.locator('.mdi-apps');
|
||||
|
||||
const applicationsValue = await page.textContent('#tia');
|
||||
expect(typeof parseInt(applicationsValue)).toBe('number');
|
||||
|
||||
const countries = await page.getByRole('heading', { name: 'Countries' });
|
||||
const countriesIcon = await page.locator('.mdi-earth');
|
||||
|
||||
const countriesValue = await page.textContent('#tcc');
|
||||
expect(typeof parseInt(countriesValue)).toBe('number');
|
||||
|
||||
const domains = await page.getByRole('heading', { name: 'Domains' });
|
||||
const domainsIcon = await page.locator('.mdi-server');
|
||||
|
||||
const domainsValue = await page.textContent('#tia');
|
||||
expect(typeof parseInt(domainsValue)).toBe('number');
|
||||
|
||||
expect(inspectedFlows && applications && countries && domains).toBeTruthy();
|
||||
expect(inspectedFlowsIcon && applicationsIcon && countriesIcon && domainsIcon).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Connections by Country', async ({ page }) => {
|
||||
expect(await page.$('p:has-text("Connections by Country")')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('DPI Map', async ({ page }) => {
|
||||
const dpiMap = await page.locator('#dpi-map');
|
||||
const isVisible = await dpiMap.isVisible();
|
||||
const isEnabled = await dpiMap.isEnabled();
|
||||
|
||||
expect(isVisible && isEnabled).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Detected Applications', async ({ page }) => {
|
||||
expect(await page.$('p:has-text("Detected Application")')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Detected Applications Filter', async ({ page }) => {
|
||||
const filterField = await page.locator('#filter-field-apps');
|
||||
const loadFilterField = await filterField.isVisible();
|
||||
expect(loadFilterField).toBeTruthy();
|
||||
await filterField.selectOption({ label: 'Category' });
|
||||
|
||||
const typeField = await page.locator('#filter-type-apps');
|
||||
const loadType = await typeField.isVisible();
|
||||
expect(loadType).toBeTruthy();
|
||||
await typeField.selectOption({ label: '=' });
|
||||
|
||||
const valueField = await page.locator('#filter-value-categories');
|
||||
const loadValue = await typeField.isVisible();
|
||||
expect(loadValue).toBeTruthy();
|
||||
await valueField.selectOption({ label: 'CDN' });
|
||||
|
||||
const filterFieldValue = await filterField.inputValue();
|
||||
expect(filterFieldValue).toBe('category');
|
||||
|
||||
const typeValue = await typeField.inputValue();
|
||||
expect(typeValue).toBe('=');
|
||||
|
||||
const value = await valueField.inputValue();
|
||||
expect(value).toBe('CDN');
|
||||
});
|
||||
|
||||
test('Clear Filter',async({page})=>{
|
||||
const clearFilter = await page.locator('#filter-clear-apps')
|
||||
expect(await clearFilter.isVisible()).toBeTruthy()
|
||||
})
|
||||
|
||||
test('Download PDF Button',async({page})=>{
|
||||
const button = await page.$('button[data-type="PDF"]');
|
||||
const isVisible =await button.isVisible()
|
||||
const isEnabled =await button.isEnabled()
|
||||
const buttonName = await button.textContent()
|
||||
|
||||
expect(isVisible && isEnabled).toBeTruthy()
|
||||
expect(buttonName).toBe('Download PDF')
|
||||
})
|
||||
|
||||
test('Download XLSX Button',async({page})=>{
|
||||
const button = await page.$('button[data-type="XLSX"]');
|
||||
const isVisible =await button.isVisible()
|
||||
const buttonName = await button.textContent()
|
||||
|
||||
expect(isVisible).toBeTruthy()
|
||||
expect(buttonName).toBe('Download XLSX')
|
||||
})
|
||||
|
||||
test('Download CSV Button',async({page})=>{
|
||||
const button = await page.$('button[data-type="CSV"]');
|
||||
const isVisible =await button.isVisible()
|
||||
const isEnabled =await button.isEnabled()
|
||||
const buttonName = await button.textContent()
|
||||
|
||||
expect(isVisible && isEnabled).toBeTruthy()
|
||||
expect(buttonName).toBe('Download CSV')
|
||||
})
|
||||
|
||||
test('Download JSON Button',async({page})=>{
|
||||
const button = await page.$('button[data-type="JSON"]');
|
||||
const isVisible =await button.isVisible()
|
||||
const isEnabled =await button.isEnabled()
|
||||
const buttonName = await button.textContent()
|
||||
|
||||
expect(isVisible && isEnabled).toBeTruthy()
|
||||
expect(buttonName).toBe('Download JSON')
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
});
|
|
@ -6,6 +6,7 @@ test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () =>
|
|||
await page.goto('network-analyzer/traffic-monitor', {
|
||||
waitUntil: 'networkidle'
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
test('Title', async ({ page }) => {
|
||||
|
@ -16,7 +17,7 @@ test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () =>
|
|||
});
|
||||
|
||||
test('Traffic Monitor', async ({ page }) => {
|
||||
expect(await page.$('header:has-text("Traffic Monitor")')).toBeTruthy();
|
||||
expect(await page.$('p:has-text("Traffic Monitor")')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Traffic Monitor select Date', async ({ page }) => {
|
||||
|
@ -51,7 +52,6 @@ test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () =>
|
|||
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');
|
||||
|
||||
|
@ -153,25 +153,33 @@ test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () =>
|
|||
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();
|
||||
const isEnabled = await groupedByMac.isEnabled();
|
||||
expect(isVisible).toBeTruthy();
|
||||
expect(isEnabled).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();
|
||||
const isEnabled = await groupedByIp.isEnabled();
|
||||
expect(isVisible).toBeTruthy();
|
||||
expect(isEnabled).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();
|
||||
const isEnabled = await groupedByProtocol.isEnabled();
|
||||
expect(isVisible).toBeTruthy();
|
||||
expect(isEnabled).toBeTruthy();
|
||||
});
|
||||
|
||||
test('JSON Dump Download Button', async ({ page }) => {
|
||||
const jsonDump = await page.locator('a:has-text("JSON Dump")');
|
||||
const isVisible = await jsonDump.isVisible();
|
||||
const isEnabled = await jsonDump.isEnabled();
|
||||
expect(isVisible).toBeTruthy();
|
||||
expect(isEnabled).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue