DPI : Overview ,Detail Explorer ,Live View, Settings Test Completed
This commit is contained in:
parent
18b3574fcb
commit
5e8374adc3
2 changed files with 190 additions and 56 deletions
|
@ -4,8 +4,6 @@ test.describe('General - Dashboard - Network Analyzer - Deep Packet Inspection',
|
||||||
test.describe('Overview', () => {
|
test.describe('Overview', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('network-analyzer/deep-packet-inspector', { waitUntil: 'load' });
|
await page.goto('network-analyzer/deep-packet-inspector', { waitUntil: 'load' });
|
||||||
|
|
||||||
await page.waitForSelector('.card-content', { timeout: 3000 });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Title', async ({ page }) => {
|
test('Title', async ({ page }) => {
|
||||||
|
@ -75,74 +73,211 @@ test.describe('General - Dashboard - Network Analyzer - Deep Packet Inspection',
|
||||||
|
|
||||||
test('Detected Applications Filter', async ({ page }) => {
|
test('Detected Applications Filter', async ({ page }) => {
|
||||||
const filterField = await page.locator('#filter-field-apps');
|
const filterField = await page.locator('#filter-field-apps');
|
||||||
const loadFilterField = await filterField.isVisible();
|
expect(filterField).toBeTruthy();
|
||||||
expect(loadFilterField).toBeTruthy();
|
|
||||||
await filterField.selectOption({ label: 'Category' });
|
|
||||||
|
|
||||||
const typeField = await page.locator('#filter-type-apps');
|
const typeField = await page.locator('#filter-type-apps');
|
||||||
const loadType = await typeField.isVisible();
|
expect(typeField).toBeTruthy();
|
||||||
expect(loadType).toBeTruthy();
|
|
||||||
await typeField.selectOption({ label: '=' });
|
|
||||||
|
|
||||||
const valueField = await page.locator('#filter-value-categories');
|
const valueField = await page.locator('#filter-value-categories');
|
||||||
const loadValue = await typeField.isVisible();
|
expect(valueField).toBeTruthy();
|
||||||
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 }) => {
|
test('Clear Filter', async ({ page }) => {
|
||||||
const clearFilter = await page.locator('#filter-clear-apps')
|
const clearFilter = await page.locator('#filter-clear-apps');
|
||||||
expect(await clearFilter.isVisible()).toBeTruthy()
|
expect(clearFilter).toBeTruthy();
|
||||||
})
|
});
|
||||||
|
|
||||||
test('Download PDF Button', async ({ page }) => {
|
test('Download PDF Button', async ({ page }) => {
|
||||||
const button = await page.$('button[data-type="PDF"]');
|
const button = await page.$('button[data-type="PDF"].download-table-apps');
|
||||||
const isVisible =await button.isVisible()
|
expect(button).toBeTruthy();
|
||||||
const isEnabled =await button.isEnabled()
|
const buttonName = await button.textContent();
|
||||||
const buttonName = await button.textContent()
|
expect(buttonName).toBe('Download PDF');
|
||||||
|
});
|
||||||
expect(isVisible && isEnabled).toBeTruthy()
|
|
||||||
expect(buttonName).toBe('Download PDF')
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Download XLSX Button', async ({ page }) => {
|
test('Download XLSX Button', async ({ page }) => {
|
||||||
const button = await page.$('button[data-type="XLSX"]');
|
const button = await page.$('button[data-type="XLSX"].download-table-apps');
|
||||||
const isVisible =await button.isVisible()
|
expect(button).toBeTruthy();
|
||||||
const buttonName = await button.textContent()
|
const buttonName = await button.textContent();
|
||||||
|
expect(buttonName).toBe('Download XLSX');
|
||||||
expect(isVisible).toBeTruthy()
|
});
|
||||||
expect(buttonName).toBe('Download XLSX')
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Download CSV Button', async ({ page }) => {
|
test('Download CSV Button', async ({ page }) => {
|
||||||
const button = await page.$('button[data-type="CSV"]');
|
const button = await page.$('button[data-type="CSV"].download-table-apps');
|
||||||
const isVisible =await button.isVisible()
|
expect(button).toBeTruthy();
|
||||||
const isEnabled =await button.isEnabled()
|
const buttonName = await button.textContent();
|
||||||
const buttonName = await button.textContent()
|
expect(buttonName).toBe('Download CSV');
|
||||||
|
});
|
||||||
expect(isVisible && isEnabled).toBeTruthy()
|
|
||||||
expect(buttonName).toBe('Download CSV')
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Download JSON Button', async ({ page }) => {
|
test('Download JSON Button', async ({ page }) => {
|
||||||
const button = await page.$('button[data-type="JSON"]');
|
const button = await page.$('button[data-type="JSON"].download-table-apps');
|
||||||
const isVisible =await button.isVisible()
|
expect(button).toBeTruthy();
|
||||||
const isEnabled =await button.isEnabled()
|
const buttonName = await button.textContent();
|
||||||
const buttonName = await button.textContent()
|
expect(buttonName).toBe('Download JSON');
|
||||||
|
});
|
||||||
expect(isVisible && isEnabled).toBeTruthy()
|
});
|
||||||
expect(buttonName).toBe('Download JSON')
|
|
||||||
})
|
test.describe('Detail Explorer Tab', () => {
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await page.goto('network-analyzer/deep-packet-inspector', {
|
||||||
|
waitUntil: 'networkidle'
|
||||||
|
});
|
||||||
|
|
||||||
|
await page.click('#detail-tab-dpi');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Detail Explorer Top Cards', async ({ page }) => {
|
||||||
|
const disoveredIps = await page.$('header', { name: 'Discovered IPs' });
|
||||||
|
const dicoveredIpsIcon = await page.locator('.mdi-magnify');
|
||||||
|
|
||||||
|
const disoveredIpsValue = await page.textContent('#deips');
|
||||||
|
expect(typeof parseInt(disoveredIpsValue)).toBe('number');
|
||||||
|
|
||||||
|
const disoveredMacS = await page.$('header', { name: 'Discovered MACs' });
|
||||||
|
const disoveredMacSicon = await page.locator('.mdi-magnify');
|
||||||
|
|
||||||
|
const disoveredMacSValue = await page.textContent('#demacs');
|
||||||
|
expect(typeof parseInt(disoveredMacSValue)).toBe('number');
|
||||||
|
|
||||||
|
expect(disoveredIps && disoveredMacS).toBeTruthy();
|
||||||
|
expect(dicoveredIpsIcon && disoveredMacSicon).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Detected Network Peers', async ({ page }) => {
|
||||||
|
expect(await page.$('p:has-text("Detected Network Peers")')).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Detected Network Filter', async ({ page }) => {
|
||||||
|
const filterField = await page.locator('#filter-field-de1');
|
||||||
|
const loadFilterField = await filterField.isVisible();
|
||||||
|
expect(loadFilterField).toBeTruthy();
|
||||||
|
|
||||||
|
const typeField = await page.locator('#filter-type-de1');
|
||||||
|
const loadType = await typeField.isVisible();
|
||||||
|
expect(loadType).toBeTruthy();
|
||||||
|
|
||||||
|
const valueField = await page.locator('#filter-value-de1');
|
||||||
|
const loadValue = await valueField.isVisible();
|
||||||
|
expect(loadValue).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Explorer Clear Filter Button', async ({ page }) => {
|
||||||
|
const clearFilter = await page.locator('#filter-clear-de1');
|
||||||
|
expect(await clearFilter.isVisible()).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Explorer Download PDF Button', async ({ page }) => {
|
||||||
|
const button = await page.$('button[data-type="PDF"].download-table-de1');
|
||||||
|
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('Explorer Download XLSX Button', async ({ page }) => {
|
||||||
|
const button = await page.$('button[data-type="XLSX"].download-table-de1');
|
||||||
|
const isVisible = await button.isVisible();
|
||||||
|
const buttonName = await button.textContent();
|
||||||
|
|
||||||
|
expect(isVisible).toBeTruthy();
|
||||||
|
expect(buttonName).toBe('Download XLSX');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Explorer Download CSV Button', async ({ page }) => {
|
||||||
|
const button = await page.$('button[data-type="CSV"].download-table-de1');
|
||||||
|
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('Explorer Download JSON Button', async ({ page }) => {
|
||||||
|
const button = await page.$('button[data-type="JSON"].download-table-de1');
|
||||||
|
const isVisible = await button.isVisible();
|
||||||
|
const isEnabled = await button.isEnabled();
|
||||||
|
const buttonName = await button.textContent();
|
||||||
|
|
||||||
|
expect(isVisible && isEnabled).toBeTruthy();
|
||||||
|
expect(buttonName).toBe('Download JSON');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Explore Peer Table', async ({ page }) => {
|
||||||
|
const table = page.locator('#de2-sec');
|
||||||
|
await expect(table).toBeHidden();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('Live View Tab', () => {
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await page.goto('network-analyzer/deep-packet-inspector', { waitUntil: 'networkidle' });
|
||||||
|
|
||||||
|
await page.click('#liveview-tab-dpi');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Toggle icon is Pause', async ({ page }) => {
|
||||||
|
const toggleIcon = await page.locator('#toggle-icon');
|
||||||
|
const classAttribute = await toggleIcon.getAttribute('class');
|
||||||
|
expect(classAttribute).toContain('mdi-pause');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Toggle icon is Play', async ({ page }) => {
|
||||||
|
await page.click('#toggle-icon');
|
||||||
|
const toggleIcon = await page.locator('#toggle-icon');
|
||||||
|
const classAttribute = await toggleIcon.getAttribute('class');
|
||||||
|
expect(classAttribute).toContain('mdi-play');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Live Code Check', async ({ page }) => {
|
||||||
|
const code = await page.locator('#liveview');
|
||||||
|
expect(code).toBeTruthy();
|
||||||
|
const codeData = await code.getAttribute('class');
|
||||||
|
expect(codeData).toContain('json');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('Settings', () => {
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await page.goto('network-analyzer/deep-packet-inspector', { waitUntil: 'networkidle' });
|
||||||
|
await page.click('#settings-tab-dpi');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Enable Label', async ({ page }) => {
|
||||||
|
expect(await page.$('label:has-text("Enable")')).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Enable Checkbox', async ({ page }) => {
|
||||||
|
const checkbox = await page.locator('input.cb-enable');
|
||||||
|
expect(checkbox).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Ignore Bittorrent Traffic', async ({ page }) => {
|
||||||
|
expect(await page.$('label:has-text("Ignore Bittorrent Traffic")')).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Ignore Bittorrent Traffic Checkbox', async ({ page }) => {
|
||||||
|
const checkbox = await page.locator('input.cb-ignorebtt');
|
||||||
|
expect(checkbox).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Maximum Storage', async ({ page }) => {
|
||||||
|
expect(await page.$('label:has-text("Maximum Storage")')).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Maximum Storage Input', async ({ page }) => {
|
||||||
|
const input = await page.locator('#max-storage');
|
||||||
|
expect(input).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Save Button', async ({ page }) => {
|
||||||
|
const button = await page.getByRole('button', { name: 'Save' });
|
||||||
|
const visible = await button.isVisible();
|
||||||
|
expect(visible).toBeTruthy();
|
||||||
|
|
||||||
|
const type = await button.getAttribute('type');
|
||||||
|
expect(type).toBe('submit');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,7 +6,6 @@ test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () =>
|
||||||
await page.goto('network-analyzer/traffic-monitor', {
|
await page.goto('network-analyzer/traffic-monitor', {
|
||||||
waitUntil: 'networkidle'
|
waitUntil: 'networkidle'
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Title', async ({ page }) => {
|
test('Title', async ({ page }) => {
|
||||||
|
|
Loading…
Reference in a new issue