|
|
@ -17,10 +17,8 @@ export class ToolbarFieldsPage extends BasePage { |
|
|
|
// todo: Click and toggle are similar method. Remove one of them
|
|
|
|
// todo: Click and toggle are similar method. Remove one of them
|
|
|
|
async toggle({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) { |
|
|
|
async toggle({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) { |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
const toggleColumn = this.get() |
|
|
|
const toggleColumn = () => |
|
|
|
.locator(`[data-testid="nc-fields-menu-${title}"]`) |
|
|
|
this.get().locator(`[data-testid="nc-fields-menu-${title}"]`).locator('input[type="checkbox"]').click(); |
|
|
|
.locator('input[type="checkbox"]') |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await this.waitForResponse({ |
|
|
|
await this.waitForResponse({ |
|
|
|
uiAction: toggleColumn, |
|
|
|
uiAction: toggleColumn, |
|
|
@ -43,7 +41,8 @@ export class ToolbarFieldsPage extends BasePage { |
|
|
|
|
|
|
|
|
|
|
|
async click({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) { |
|
|
|
async click({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) { |
|
|
|
await this.waitForResponse({ |
|
|
|
await this.waitForResponse({ |
|
|
|
uiAction: this.get().locator(`[data-testid="nc-fields-menu-${title}"]`).locator('input[type="checkbox"]').click(), |
|
|
|
uiAction: () => |
|
|
|
|
|
|
|
this.get().locator(`[data-testid="nc-fields-menu-${title}"]`).locator('input[type="checkbox"]').click(), |
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
}); |
|
|
|
}); |
|
|
@ -53,7 +52,7 @@ export class ToolbarFieldsPage extends BasePage { |
|
|
|
async hideAll({ isLocallySaved }: { isLocallySaved?: boolean } = {}) { |
|
|
|
async hideAll({ isLocallySaved }: { isLocallySaved?: boolean } = {}) { |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.waitForResponse({ |
|
|
|
await this.waitForResponse({ |
|
|
|
uiAction: this.get().locator(`button:has-text("Hide all")`).click(), |
|
|
|
uiAction: () => this.get().locator(`button:has-text("Hide all")`).click(), |
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
}); |
|
|
|
}); |
|
|
@ -63,7 +62,7 @@ export class ToolbarFieldsPage extends BasePage { |
|
|
|
async showAll({ isLocallySaved }: { isLocallySaved?: boolean } = {}) { |
|
|
|
async showAll({ isLocallySaved }: { isLocallySaved?: boolean } = {}) { |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.waitForResponse({ |
|
|
|
await this.waitForResponse({ |
|
|
|
uiAction: this.get().locator(`button:has-text("Show all")`).click(), |
|
|
|
uiAction: () => this.get().locator(`button:has-text("Show all")`).click(), |
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
}); |
|
|
|
}); |
|
|
@ -73,7 +72,7 @@ export class ToolbarFieldsPage extends BasePage { |
|
|
|
async toggleShowSystemFields({ isLocallySaved }: { isLocallySaved?: boolean } = {}) { |
|
|
|
async toggleShowSystemFields({ isLocallySaved }: { isLocallySaved?: boolean } = {}) { |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.waitForResponse({ |
|
|
|
await this.waitForResponse({ |
|
|
|
uiAction: this.get().locator(`.nc-fields-show-system-fields`).click(), |
|
|
|
uiAction: () => this.get().locator(`.nc-fields-show-system-fields`).click(), |
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
}); |
|
|
|
}); |
|
|
|