|
|
|
@ -52,33 +52,33 @@ export class ToolbarFilterPage extends BasePage {
|
|
|
|
|
|
|
|
|
|
await this.get().locator(`button:has-text("Add Filter")`).first().click(); |
|
|
|
|
|
|
|
|
|
const selectedColumnTitle = await this.rootPage.locator('.nc-filter-field-select').textContent(); |
|
|
|
|
await this.rootPage.locator(".nc-filter-field-select").last().click(); |
|
|
|
|
if(selectedColumnTitle !== columnTitle) { |
|
|
|
|
const selectColumn = this.rootPage |
|
|
|
|
.locator("div.ant-select-dropdown.nc-dropdown-toolbar-field-list") |
|
|
|
|
.locator(`div[label="${columnTitle}"][aria-selected="false"]:visible`) |
|
|
|
|
.click(); |
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: selectColumn, |
|
|
|
|
httpMethodsToMatch: isLocallySaved ? [ "GET" ] : ["POST", "PATCH" ], |
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? `/api/v1/db/public/` : `/filters`, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
const selectColumn = this.rootPage |
|
|
|
|
.locator("div.ant-select-dropdown.nc-dropdown-toolbar-field-list") |
|
|
|
|
.locator(`div[label="${columnTitle}"][aria-selected="false"]:visible`) |
|
|
|
|
.click(); |
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: selectColumn, |
|
|
|
|
httpMethodsToMatch: isLocallySaved ? [ "GET" ] : ["POST", "PATCH" ], |
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? `/api/v1/db/public/` : `/filters`, |
|
|
|
|
}); |
|
|
|
|
await this.toolbar.parent.dashboard.waitForLoaderToDisappear(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const selectedOpType = await this.rootPage.locator('.nc-filter-operation-select').textContent(); |
|
|
|
|
if(selectedOpType !== opType) { |
|
|
|
|
await this.rootPage.locator(".nc-filter-operation-select").last().click(); |
|
|
|
|
const selectOpType = this.rootPage |
|
|
|
|
.locator(".nc-dropdown-filter-comp-op") |
|
|
|
|
.locator(`.ant-select-item:has-text("${opType}")`) |
|
|
|
|
.click(); |
|
|
|
|
.locator(".nc-dropdown-filter-comp-op") |
|
|
|
|
.locator(`.ant-select-item:has-text("${opType}")`) |
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
await this.waitForResponse({ |
|
|
|
|
uiAction: selectOpType, |
|
|
|
|
httpMethodsToMatch: isLocallySaved ? [ "GET" ] : ["POST", "PATCH"], |
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? `/api/v1/db/public/` : `/filters`, |
|
|
|
|
}); |
|
|
|
|
await this.toolbar.parent.dashboard.waitForLoaderToDisappear(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const fillFilter = this.rootPage |
|
|
|
@ -90,6 +90,7 @@ export class ToolbarFilterPage extends BasePage {
|
|
|
|
|
httpMethodsToMatch: ["GET"], |
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? `/api/v1/db/public/` : `/api/v1/db/data/noco/`, |
|
|
|
|
}); |
|
|
|
|
await this.toolbar.parent.dashboard.waitForLoaderToDisappear(); |
|
|
|
|
|
|
|
|
|
await this.toolbar.clickFilter(); |
|
|
|
|
|
|
|
|
|