mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 04:16:05 +00:00
test: dont wait for filter rsp for first filter
This commit is contained in:
@@ -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}")`)
|
||||
|
||||
Reference in New Issue
Block a user