Traffic Monitor: Period Date test changed to yyyy-mm-dd format validation
This commit is contained in:
parent
fe9ce1d8c9
commit
254dede49b
1 changed files with 8 additions and 12 deletions
|
@ -1,4 +1,5 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { isValidDate } from '../../../utils/utils.js';
|
||||
|
||||
test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () => {
|
||||
test.describe('Traffic Distribution', () => {
|
||||
|
@ -22,20 +23,15 @@ test.describe('General - Dashboard - Network Analyzer - Traffic Monitor', () =>
|
|||
test('Traffic Monitor select Date', async ({ page }) => {
|
||||
const selectElement = page.locator('select.period-select');
|
||||
|
||||
const options = await selectElement.locator('option');
|
||||
await expect(selectElement).toBeVisible();
|
||||
|
||||
const optionCount = await options.count();
|
||||
const date = [];
|
||||
for (let i = 0; i < optionCount; i++) {
|
||||
const option = options.nth(i);
|
||||
const value = await option.getAttribute('value');
|
||||
date.push(value);
|
||||
const currentValue = await selectElement.inputValue();
|
||||
|
||||
if (currentValue === 'Period') {
|
||||
expect(currentValue).toBe('Period');
|
||||
} else {
|
||||
expect(isValidDate(currentValue)).toBeTruthy();
|
||||
}
|
||||
|
||||
await selectElement.selectOption(date[1]);
|
||||
|
||||
const selectedValue = await selectElement.inputValue();
|
||||
expect(selectedValue).toBe(date[1]);
|
||||
});
|
||||
|
||||
test('Tabs', async ({ page }) => {
|
||||
|
|
Loading…
Reference in a new issue