Network - WAN : IPv4 Tab completed
This commit is contained in:
parent
948403697f
commit
3412a6d178
1 changed files with 94 additions and 46 deletions
|
@ -2,8 +2,10 @@ import { test, expect } from '@playwright/test';
|
||||||
import { isValidMacAddress, isValidPrivateIPV4 } from '../../utils/utils.js';
|
import { isValidMacAddress, isValidPrivateIPV4 } from '../../utils/utils.js';
|
||||||
|
|
||||||
test.describe('Network & Services - Network - WAN', () => {
|
test.describe('Network & Services - Network - WAN', () => {
|
||||||
|
test.describe('IPV4 Tab', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await page.goto('/network/wan', { waitUntil: 'networkidle' });
|
await page.goto('/network/wan', { waitUntil: 'networkidle' });
|
||||||
|
await page.waitForTimeout(3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Title', async ({ page }) => {
|
test('Title', async ({ page }) => {
|
||||||
|
@ -24,8 +26,6 @@ test.describe('Network & Services - Network - WAN', () => {
|
||||||
if (cells.length === 2) {
|
if (cells.length === 2) {
|
||||||
const label = await cells[0].textContent();
|
const label = await cells[0].textContent();
|
||||||
const value = await cells[1].textContent();
|
const value = await cells[1].textContent();
|
||||||
console.log(label + ' : ' + value);
|
|
||||||
|
|
||||||
if (label === 'Protocol') {
|
if (label === 'Protocol') {
|
||||||
expect(value).toBe('DHCPv4');
|
expect(value).toBe('DHCPv4');
|
||||||
} else if (label === 'Uptime') {
|
} else if (label === 'Uptime') {
|
||||||
|
@ -58,4 +58,52 @@ test.describe('Network & Services - Network - WAN', () => {
|
||||||
const visible = await disableWAN.isVisible();
|
const visible = await disableWAN.isVisible();
|
||||||
expect(visible).toBeTruthy();
|
expect(visible).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('IPv4 Protocol Static IP', async ({ page }) => {
|
||||||
|
const label = await page.locator('label:has-text("Protocol")');
|
||||||
|
expect(label).toBeTruthy();
|
||||||
|
|
||||||
|
const selectElement = await page.locator('select.proto-select');
|
||||||
|
|
||||||
|
await selectElement.selectOption({ label: 'Static IP' });
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
|
||||||
|
const isVisible = await page.isVisible('#staticip-sub-div');
|
||||||
|
expect(isVisible).toBe(true);
|
||||||
|
|
||||||
|
const ipv4Address = await page.locator('label:has-text("IPv4 Address")');
|
||||||
|
const ipv4AddressField = await page.locator('#static-ip');
|
||||||
|
expect(ipv4Address && ipv4AddressField).toBeTruthy();
|
||||||
|
|
||||||
|
const networkMask = await page.locator('label:has-text("Network Mask")');
|
||||||
|
const networkMaskField = await page.locator('select.static-netmask-select');
|
||||||
|
expect(networkMask && networkMaskField).toBeTruthy();
|
||||||
|
|
||||||
|
const ipv4Gateway = await page.locator('label:has-text("IPv4 Gateway")');
|
||||||
|
const ipv4GatewayField = await page.locator('#static-gateway');
|
||||||
|
expect(ipv4Gateway && ipv4GatewayField).toBeTruthy();
|
||||||
|
|
||||||
|
const ipv4Broadcast = await page.locator('label:has-text("IPv4 Broadcast")');
|
||||||
|
const ipv4BroadcastField = await page.locator('#static-broadcast');
|
||||||
|
expect(ipv4Broadcast && ipv4BroadcastField).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('IPv4 Protocol PPPoE', async ({ page }) => {
|
||||||
|
const selectElement = await page.locator('select.proto-select');
|
||||||
|
|
||||||
|
await selectElement.selectOption({ label: 'PPPoE' });
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
|
||||||
|
const isVisible = await page.isVisible('#pppoe-sub-div');
|
||||||
|
expect(isVisible).toBe(true);
|
||||||
|
|
||||||
|
const pppoeUsername = await page.locator('label:has-text("PAP/CHAP Username")');
|
||||||
|
const pppoeUsernameField = await page.locator('#pppoe-username');
|
||||||
|
expect(pppoeUsername && pppoeUsernameField).toBeTruthy();
|
||||||
|
|
||||||
|
const pppoePassword = await page.locator('label:has-text("PAP/CHAP Password")');
|
||||||
|
const pppoePasswordField = await page.locator('#pppoe-password');
|
||||||
|
expect(pppoePassword && pppoePasswordField).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue