Browse Source

chore(playwright): rename primary value to display value

pull/5117/head
Wing-Kam Wong 2 years ago
parent
commit
f806ed93f5
  1. 10
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  2. 4
      tests/playwright/tests/columnMenuOperations.spec.ts

10
tests/playwright/pages/Dashboard/Grid/Column/index.ts

@ -44,7 +44,7 @@ export class ColumnPageObject extends BasePage {
timeFormat = '', timeFormat = '',
insertAfterColumnTitle, insertAfterColumnTitle,
insertBeforeColumnTitle, insertBeforeColumnTitle,
isPrimaryValue = false, isDisplayValue = false,
}: { }: {
title: string; title: string;
type?: string; type?: string;
@ -61,12 +61,12 @@ export class ColumnPageObject extends BasePage {
timeFormat?: string; timeFormat?: string;
insertBeforeColumnTitle?: string; insertBeforeColumnTitle?: string;
insertAfterColumnTitle?: string; insertAfterColumnTitle?: string;
isPrimaryValue?: boolean; isDisplayValue?: 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) { if (isDisplayValue) {
await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Insert Before")')).toHaveCount(0); await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Insert Before")')).toHaveCount(0);
return; return;
} }
@ -321,10 +321,10 @@ 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, isPrimaryValue = false }: { title: string; isPrimaryValue?: boolean }) { async hideColumn({ title, isDisplayValue = false }: { title: string; isDisplayValue?: 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) { if (isDisplayValue) {
await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field")')).toHaveCount(0); await expect(this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field")')).toHaveCount(0);
return; return;
} }

4
tests/playwright/tests/columnMenuOperations.spec.ts

@ -91,7 +91,7 @@ test.describe('Column menu operations', () => {
title: 'InsertBeforeColumn', title: 'InsertBeforeColumn',
type: 'SingleLineText', type: 'SingleLineText',
insertBeforeColumnTitle: 'Title', insertBeforeColumnTitle: 'Title',
isPrimaryValue: true, isDisplayValue: true,
}); });
await dashboard.grid.column.create({ await dashboard.grid.column.create({
@ -108,7 +108,7 @@ test.describe('Column menu operations', () => {
await dashboard.grid.column.hideColumn({ await dashboard.grid.column.hideColumn({
title: 'Title', title: 'Title',
isPrimaryValue: true, isDisplayValue: true,
}); });
await dashboard.grid.column.hideColumn({ await dashboard.grid.column.hideColumn({

Loading…
Cancel
Save