Network - wifi : 5Ghz tab test completed
This commit is contained in:
parent
530701b1be
commit
ad88794018
1 changed files with 190 additions and 0 deletions
|
@ -213,4 +213,194 @@ test.describe('Network & Services - Network - WiFi', () => {
|
|||
expect(await hasToastQRcode(page, 'Difuse 2.4Ghz Guest - QR Code')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('5Ghz WiFi Tab', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/network/wifi', { waitUntil: 'networkidle' });
|
||||
await page.waitForTimeout(2000);
|
||||
const fiveGHzTab = await page.$("a:has-text('5Ghz WiFi')");
|
||||
await fiveGHzTab.click();
|
||||
});
|
||||
|
||||
test('5Ghz Primary AP & Radio', async ({ page }) => {
|
||||
const primaryAPandRadio = await page.locator("span:has-text('Primary AP & Radio')");
|
||||
expect(await primaryAPandRadio).toBeTruthy();
|
||||
});
|
||||
|
||||
test('5Ghz SSID Validation', async ({ page }) => {
|
||||
const ssid = await page.locator('#ssid-5');
|
||||
const value = await ssid.inputValue();
|
||||
if (value) {
|
||||
const length = value.length;
|
||||
expect(length).toBeGreaterThanOrEqual(1);
|
||||
expect(length).toBeLessThanOrEqual(32);
|
||||
}
|
||||
});
|
||||
|
||||
test('5Ghz Bad SSID Validation', async ({ page }) => {
|
||||
const ssid = await page.locator('#ssid-5');
|
||||
await ssid.fill('qwertyuiopasdfghjklzxcvbnmlkjhgfdsaqw');
|
||||
const saveButton = page.locator('#\\35-form button.button.green:has-text("Save")');
|
||||
await saveButton.click();
|
||||
|
||||
expect(await hasToastText(page, 'Invalid SSID')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('5Ghz Encryption Type Fields Validation', async ({ page }) => {
|
||||
const selectElement = await page.locator('label:has-text("Encryption Type ") + .field-body select.encryption5');
|
||||
|
||||
const optionDatas = await selectElement.evaluate(select => {
|
||||
const options = Array.from(select.querySelectorAll('option'));
|
||||
return options.map(option => {
|
||||
return {
|
||||
label: option.textContent.trim(),
|
||||
value: option.value.trim()
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
for (const optionData of optionDatas) {
|
||||
if (optionData.label === 'WPA2-PSK (Strong Security)') {
|
||||
expect(optionData.value).toBe('psk2');
|
||||
} else if (optionData.label === 'WPA3-SAE (Strong Security)') {
|
||||
expect(optionData.value).toBe('sae');
|
||||
} else if (optionData.label === 'WPA2-PSK/WPA3-SAE Mixed (Strong Security)') {
|
||||
expect(optionData.value).toBe('sae-mixed');
|
||||
} else if (optionData.label === 'WPA-PSK/WPA2-PSK Mixed (Medium Security)') {
|
||||
expect(optionData.value).toBe('psk-mixed');
|
||||
} else if (optionData.label === 'WPA-PSK (Weak Security)') {
|
||||
expect(optionData.value).toBe('psk');
|
||||
} else if (optionData.label === 'OWE (Open Network)') {
|
||||
expect(optionData.value).toBe('owe');
|
||||
} else if (optionData.label === 'No Encryption (Open Network)') {
|
||||
expect(optionData.value).toBe('none');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('5Ghz Password Validation', async ({ page }) => {
|
||||
const password = await page.locator('#password5');
|
||||
const value = await password.inputValue();
|
||||
if (value) {
|
||||
const length = value.length;
|
||||
expect(length).toBeGreaterThanOrEqual(8);
|
||||
}
|
||||
});
|
||||
|
||||
test('5Ghz Bad Password Validation', async ({ page }) => {
|
||||
const password = await page.locator('#password5');
|
||||
|
||||
await password.fill('qwerty');
|
||||
await page.click('#\\35-form button.button.green:has-text("Save")');
|
||||
|
||||
expect(await hasToastText(page, 'Password must be at least 8 characters')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('5Ghz Save Button', async ({ page }) => {
|
||||
const saveButton = await page.locator('#\\35-form button.button.green:has-text("Save")');
|
||||
const visible = await saveButton.isVisible();
|
||||
expect(visible).toBeTruthy();
|
||||
});
|
||||
|
||||
test('5Ghz Apply Button', async ({ page }) => {
|
||||
const applyButton = await page.locator('button#apply5');
|
||||
const visible = await applyButton.isVisible();
|
||||
expect(visible).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Click on 5Ghz QR Code Button', async ({ page }) => {
|
||||
await page.click('#\\35-form button.button.purple.showQR');
|
||||
expect(await hasToastQRcode(page, 'Difuse 5G - QR Code')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Guest 5Ghz', async ({ page }) => {
|
||||
const guest = await page.locator("span:has-text('Guest')");
|
||||
expect(await guest).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Guest 5Ghz SSID Validation', async ({ page }) => {
|
||||
const guestSsid = await page.locator('#g-ssid-5');
|
||||
const value = await guestSsid.inputValue();
|
||||
if (value) {
|
||||
const length = value.length;
|
||||
expect(length).toBeGreaterThanOrEqual(1);
|
||||
expect(length).toBeLessThanOrEqual(32);
|
||||
}
|
||||
});
|
||||
|
||||
test('Guest 5Ghz Bad SSID Validation', async ({ page }) => {
|
||||
const guestSsid = await page.locator('#g-ssid-5');
|
||||
await guestSsid.fill('qwertyuiopasdfghjklzxcvbnmlkjhgfdsaqw');
|
||||
await page.click('#g-5-form button.button.green:has-text("Save")');
|
||||
|
||||
expect(await hasToastText(page, 'Invalid SSID')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Guest 5Ghz Encryption Type Fields Validation', async ({ page }) => {
|
||||
const selectElement = await page.locator('label:has-text("Encryption Type ") + .field-body select.g-encryption5');
|
||||
|
||||
const optionDatas = await selectElement.evaluate(select => {
|
||||
const options = Array.from(select.querySelectorAll('option'));
|
||||
return options.map(option => {
|
||||
return {
|
||||
label: option.textContent.trim(),
|
||||
value: option.value.trim()
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
for (const optionData of optionDatas) {
|
||||
if (optionData.label === 'WPA2-PSK (Strong Security)') {
|
||||
expect(optionData.value).toBe('psk2');
|
||||
} else if (optionData.label === 'WPA3-SAE (Strong Security)') {
|
||||
expect(optionData.value).toBe('sae');
|
||||
} else if (optionData.label === 'WPA2-PSK/WPA3-SAE Mixed (Strong Security)') {
|
||||
expect(optionData.value).toBe('sae-mixed');
|
||||
} else if (optionData.label === 'WPA-PSK/WPA2-PSK Mixed (Medium Security)') {
|
||||
expect(optionData.value).toBe('psk-mixed');
|
||||
} else if (optionData.label === 'WPA-PSK (Weak Security)') {
|
||||
expect(optionData.value).toBe('psk');
|
||||
} else if (optionData.label === 'OWE (Open Network)') {
|
||||
expect(optionData.value).toBe('owe');
|
||||
} else if (optionData.label === 'No Encryption (Open Network)') {
|
||||
expect(optionData.value).toBe('none');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('Guest 5Ghz Password Validation', async ({ page }) => {
|
||||
const password = await page.locator('#g-password5');
|
||||
const value = await password.inputValue();
|
||||
if (value) {
|
||||
const length = value.length;
|
||||
expect(length).toBeGreaterThanOrEqual(8);
|
||||
}
|
||||
});
|
||||
|
||||
test('Guest 5Ghz Bad Password Validation', async ({ page }) => {
|
||||
const password = await page.locator('#g-password5');
|
||||
|
||||
await password.fill('qwerty');
|
||||
await page.click('#g-5-form button.button.green:has-text("Save")');
|
||||
|
||||
expect(await hasToastText(page, 'Password must be at least 8 characters long')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Guest 5Ghz Save Button', async ({ page }) => {
|
||||
const saveButton = await page.locator('#g-5-form button.button.green:has-text("Save")');
|
||||
const visible = await saveButton.isVisible();
|
||||
expect(visible).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Guest 5Ghz Apply Button', async ({ page }) => {
|
||||
const applyButton = await page.locator('button#apply5-g');
|
||||
const visible = await applyButton.isVisible();
|
||||
expect(visible).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Guest Click on 5Ghz QR Code Button', async ({ page }) => {
|
||||
await page.click('#g-5-form button.button.purple.showQR');
|
||||
expect(await hasToastQRcode(page, 'Difuse 5Ghz Guest - QR Code')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue