|
|
@ -14,12 +14,17 @@ export class ToolbarFieldsPage extends BasePage { |
|
|
|
return this.rootPage.locator(`[pw-data="nc-fields-menu"]`); |
|
|
|
return this.rootPage.locator(`[pw-data="nc-fields-menu"]`); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async toggle({ title }: { title: string }) { |
|
|
|
// todo: Click and toggle are similar method. Remove one of them
|
|
|
|
|
|
|
|
async toggle({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) { |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.get() |
|
|
|
await this.waitForResponse({ |
|
|
|
.locator(`[pw-data="nc-fields-menu-${title}"]`) |
|
|
|
uiAction: this.get() |
|
|
|
.locator('input[type="checkbox"]') |
|
|
|
.locator(`[pw-data="nc-fields-menu-${title}"]`) |
|
|
|
.click(); |
|
|
|
.locator('input[type="checkbox"]') |
|
|
|
|
|
|
|
.click(), |
|
|
|
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
|
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
|
|
|
|
}); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -35,29 +40,45 @@ export class ToolbarFieldsPage extends BasePage { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async click({ title }: { title: string }) { |
|
|
|
async click({ title, isLocallySaved }: { title: string; isLocallySaved?: boolean }) { |
|
|
|
await this.get() |
|
|
|
await this.waitForResponse({ |
|
|
|
.locator(`[pw-data="nc-fields-menu-${title}"]`) |
|
|
|
uiAction: this.get() |
|
|
|
.locator('input[type="checkbox"]') |
|
|
|
.locator(`[pw-data="nc-fields-menu-${title}"]`) |
|
|
|
.click(); |
|
|
|
.locator('input[type="checkbox"]') |
|
|
|
|
|
|
|
.click(), |
|
|
|
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
|
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
|
|
|
|
}); |
|
|
|
await this.toolbar.parent.waitLoading(); |
|
|
|
await this.toolbar.parent.waitLoading(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async hideAll() { |
|
|
|
async hideAll({ isLocallySaved }: { isLocallySaved?: boolean } = {}) { |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.get().locator(`button:has-text("Hide all")`).click(); |
|
|
|
await this.waitForResponse({ |
|
|
|
|
|
|
|
uiAction: this.get().locator(`button:has-text("Hide all")`).click(), |
|
|
|
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
|
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
|
|
|
|
}); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async showAll() { |
|
|
|
async showAll({ isLocallySaved }: { isLocallySaved? : boolean } = {}) { |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.get().locator(`button:has-text("Show all")`).click(); |
|
|
|
await this.waitForResponse({ |
|
|
|
|
|
|
|
uiAction: this.get().locator(`button:has-text("Show all")`).click(), |
|
|
|
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
|
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
|
|
|
|
}); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async toggleShowSystemFields() { |
|
|
|
async toggleShowSystemFields({ isLocallySaved }: { isLocallySaved?: boolean } = {}) { |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.get().locator(`.nc-fields-show-system-fields`).click(); |
|
|
|
await this.waitForResponse({ |
|
|
|
|
|
|
|
uiAction: this.get().locator(`.nc-fields-show-system-fields`).click(), |
|
|
|
|
|
|
|
requestUrlPathToMatch: isLocallySaved ? '/api/v1/db/public/' : '/api/v1/db/data/noco/', |
|
|
|
|
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
|
|
|
|
}); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
await this.toolbar.clickFields(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|