Browse Source

test: multi select filter fix

pull/8894/head
Raju Udava 6 months ago
parent
commit
aa2be0cd8f
  1. 58
      tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

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

@ -312,10 +312,22 @@ export class ToolbarFilterPage extends BasePage {
// eslint-disable-next-line no-case-declarations
const v = value.split(',');
for (let i = 0; i < v.length; i++) {
await this.rootPage
.locator(`.nc-dropdown-multi-select-cell`)
.locator(`[data-testid="select-option-MultiSelect-filter"].nc-select-option-MultiSelect-${v[i]}`)
.click();
if (skipWaitingResponse) {
await this.rootPage
.locator(`.nc-dropdown-multi-select-cell`)
.locator(`[data-testid="select-option-MultiSelect-filter"].nc-select-option-MultiSelect-${v[i]}`)
.click();
} else {
await this.waitForResponse({
uiAction: async () =>
await this.rootPage
.locator(`.nc-dropdown-multi-select-cell`)
.locator(`[data-testid="select-option-MultiSelect-filter"].nc-select-option-MultiSelect-${v[i]}`)
.click(),
httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/db/data/noco/`,
});
}
}
break;
case UITypes.SingleSelect:
@ -330,16 +342,40 @@ export class ToolbarFilterPage extends BasePage {
const val = value.split(',');
if (val.length > 1) {
for (let i = 0; i < val.length; i++) {
if (skipWaitingResponse) {
await this.rootPage
.locator(`.nc-dropdown-multi-select-cell`)
.locator(`.nc-select-option-SingleSelect-${val[i]}`)
.click();
} else {
await this.waitForResponse({
uiAction: async () =>
await this.rootPage
.locator(`.nc-dropdown-multi-select-cell`)
.locator(`.nc-select-option-SingleSelect-${val[i]}`)
.click(),
httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/db/data/noco/`,
});
}
}
} else {
if (skipWaitingResponse) {
await this.rootPage
.locator(`.nc-dropdown-multi-select-cell`)
.locator(`.nc-select-option-SingleSelect-${val[i]}`)
.locator(`.nc-dropdown-single-select-cell`)
.locator(`.nc-select-option-${title}-${value}`)
.click();
} else {
await this.waitForResponse({
uiAction: async () =>
await this.rootPage
.locator(`.nc-dropdown-single-select-cell`)
.locator(`.nc-select-option-${title}-${value}`)
.click(),
httpMethodsToMatch: ['GET'],
requestUrlPathToMatch: `/api/v1/db/data/noco/`,
});
}
} else {
await this.rootPage
.locator(`.nc-dropdown-single-select-cell`)
.locator(`.nc-select-option-${title}-${value}`)
.click();
}
break;
case UITypes.User:

Loading…
Cancel
Save