|
|
@ -44,6 +44,7 @@ export class ColumnPageObject extends BasePage { |
|
|
|
timeFormat = '', |
|
|
|
timeFormat = '', |
|
|
|
insertAfterColumnTitle, |
|
|
|
insertAfterColumnTitle, |
|
|
|
insertBeforeColumnTitle, |
|
|
|
insertBeforeColumnTitle, |
|
|
|
|
|
|
|
isPrimaryValue = false, |
|
|
|
}: { |
|
|
|
}: { |
|
|
|
title: string; |
|
|
|
title: string; |
|
|
|
type?: string; |
|
|
|
type?: string; |
|
|
@ -60,9 +61,16 @@ export class ColumnPageObject extends BasePage { |
|
|
|
timeFormat?: string; |
|
|
|
timeFormat?: string; |
|
|
|
insertBeforeColumnTitle?: string; |
|
|
|
insertBeforeColumnTitle?: string; |
|
|
|
insertAfterColumnTitle?: string; |
|
|
|
insertAfterColumnTitle?: string; |
|
|
|
|
|
|
|
isPrimaryValue?: boolean; |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
if (insertBeforeColumnTitle) { |
|
|
|
if (insertBeforeColumnTitle) { |
|
|
|
await this.grid.get().locator(`th[data-title="${insertBeforeColumnTitle}"] .nc-ui-dt-dropdown`).click(); |
|
|
|
await this.grid.get().locator(`th[data-title="${insertBeforeColumnTitle}"] .nc-ui-dt-dropdown`).click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isPrimaryValue) { |
|
|
|
|
|
|
|
await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Insert Before")')).toHaveCount(0); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await this.rootPage.locator('li[role="menuitem"]:has-text("Insert Before"):visible').click(); |
|
|
|
await this.rootPage.locator('li[role="menuitem"]:has-text("Insert Before"):visible').click(); |
|
|
|
} else if (insertAfterColumnTitle) { |
|
|
|
} else if (insertAfterColumnTitle) { |
|
|
|
await this.grid.get().locator(`th[data-title="${insertAfterColumnTitle}"] .nc-ui-dt-dropdown`).click(); |
|
|
|
await this.grid.get().locator(`th[data-title="${insertAfterColumnTitle}"] .nc-ui-dt-dropdown`).click(); |
|
|
@ -313,9 +321,14 @@ export class ColumnPageObject extends BasePage { |
|
|
|
await this.grid.get().locator(`th[data-title="${expectedTitle}"]`).isVisible(); |
|
|
|
await this.grid.get().locator(`th[data-title="${expectedTitle}"]`).isVisible(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async hideColumn({ title }: { title: string }) { |
|
|
|
async hideColumn({ title, isPrimaryValue = false }: { title: string; isPrimaryValue?: boolean }) { |
|
|
|
await this.grid.get().locator(`th[data-title="${title}"] .nc-ui-dt-dropdown`).click(); |
|
|
|
await this.grid.get().locator(`th[data-title="${title}"] .nc-ui-dt-dropdown`).click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isPrimaryValue) { |
|
|
|
|
|
|
|
await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field")')).toHaveCount(0); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await this.waitForResponse({ |
|
|
|
await this.waitForResponse({ |
|
|
|
uiAction: this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field"):visible').click(), |
|
|
|
uiAction: this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field"):visible').click(), |
|
|
|
requestUrlPathToMatch: 'api/v1/db/meta/views', |
|
|
|
requestUrlPathToMatch: 'api/v1/db/meta/views', |
|
|
|