test: dont wait for filter rsp for first filter

This commit is contained in:
Raju Udava
2024-06-29 05:17:21 +00:00
parent 00e5fe9b81
commit a2883f8125

View File

@@ -131,19 +131,18 @@ export class ToolbarFilterPage extends BasePage {
openModal?: boolean;
skipWaitingResponse?: boolean;
}) {
if (!openModal) await this.get().locator(`button:has-text("Add Filter")`).first().click();
const filterCount = await this.get().locator('.nc-filter-wrapper').count();
// TODO: Integrated the draft filter logic here as well, since when we add a filter its not saved till all
// its values are filled
// skipWaitingResponse = true;
if (!openModal) await this.get().locator(`button:has-text("Add Filter")`).first().click();
const selectedField = await getTextExcludeIconText(
this.rootPage.locator('.nc-filter-field-select .ant-select-selection-item').first()
);
if (selectedField !== title) {
await this.rootPage.locator('.nc-filter-field-select').last().click();
if (skipWaitingResponse) {
if (skipWaitingResponse || filterCount === 0) {
await this.rootPage
.locator('div.ant-select-dropdown.nc-dropdown-toolbar-field-list')
.locator(`div[label="${title}"]:visible`)
@@ -168,7 +167,7 @@ export class ToolbarFilterPage extends BasePage {
await this.rootPage.locator('.nc-filter-operation-select').click();
// first() : filter list has >, >=
if (skipWaitingResponse) {
if (skipWaitingResponse || filterCount === 0) {
await this.rootPage
.locator('.nc-dropdown-filter-comp-op')
.locator(`.ant-select-item:has-text("${operation}")`)
@@ -197,7 +196,7 @@ export class ToolbarFilterPage extends BasePage {
await this.rootPage.locator('.nc-filter-sub_operation-select').click();
// first() : filter list has >, >=
if (skipWaitingResponse) {
if (skipWaitingResponse || filterCount === 0) {
await this.rootPage
.locator('.nc-dropdown-filter-comp-sub-op')
.locator(`.ant-select-item:has-text("${subOperation}")`)