From 66eb4e0ed012c7a2d7fb41365b0a014b1031a5a6 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 14 Feb 2023 14:43:43 +0530 Subject: [PATCH] test: ignore network validation for reset Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../pages/Dashboard/common/Toolbar/Filter.ts | 16 ++++++++++------ tests/playwright/tests/filters.spec.ts | 12 ++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts b/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts index 608565c2d4..9e48388e57 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts +++ b/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(); } diff --git a/tests/playwright/tests/filters.spec.ts b/tests/playwright/tests/filters.spec.ts index b8be98450f..edd4728cbf 100644 --- a/tests/playwright/tests/filters.spec.ts +++ b/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();