Browse Source

test: ignore network validation for reset

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5106/head
Raju Udava 2 years ago
parent
commit
66eb4e0ed0
  1. 16
      tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts
  2. 12
      tests/playwright/tests/filters.spec.ts

16
tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

@ -150,13 +150,17 @@ export class ToolbarFilterPage extends BasePage {
}
}
async reset() {
async reset({ networkValidation = true }: { networkValidation?: boolean } = {}) {
await this.toolbar.clickFilter();
await this.waitForResponse({
uiAction: this.get().locator('.nc-filter-item-remove-btn').click(),
httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '/api/v1/db/meta/filters/',
});
if (networkValidation) {
await this.waitForResponse({
uiAction: this.get().locator('.nc-filter-item-remove-btn').click(),
httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '/api/v1/db/meta/filters/',
});
} else {
await this.get().locator('.nc-filter-item-remove-btn').click();
}
await this.toolbar.clickFilter();
}

12
tests/playwright/tests/filters.spec.ts

@ -29,12 +29,12 @@ const skipList = {
};
async function verifyFilterOperatorList(param: { column: string; opType: string[] }) {
await toolbar.clickFilter();
await toolbar.clickFilter({ networkValidation: false });
const opList = await toolbar.filter.columnOperatorList({
columnTitle: param.column,
});
await toolbar.clickFilter();
await toolbar.filter.reset();
await toolbar.clickFilter({ networkValidation: false });
await toolbar.filter.reset({ networkValidation: false });
expect(opList).toEqual(param.opType);
}
@ -741,7 +741,7 @@ test.describe('Filter Tests: Toggle button', () => {
],
});
await toolbar.clickFilter();
await toolbar.clickFilter({ networkValidation: false });
await toolbar.filter.add({
columnTitle: 'Country',
opType: 'is null',
@ -749,7 +749,7 @@ test.describe('Filter Tests: Toggle button', () => {
isLocallySaved: false,
dataType: 'SingleLineText',
});
await toolbar.clickFilter();
await toolbar.clickFilter({ networkValidation: false });
// Disable NULL & EMPTY button
await dashboard.gotoSettings();
@ -758,7 +758,7 @@ test.describe('Filter Tests: Toggle button', () => {
await dashboard.verifyToast({ message: 'Null / Empty filters exist. Please remove them first.' });
// remove filter
await toolbar.filter.reset();
await toolbar.filter.reset({ networkValidation: false });
// Disable NULL & EMPTY button
await dashboard.gotoSettings();

Loading…
Cancel
Save