Browse Source

test(playwright): add test for hide field option

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4547/head
Pranav C 2 years ago
parent
commit
96af879d0d
  1. 7
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  2. 14
      tests/playwright/tests/columnMenuOperations.spec.ts

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

@ -256,6 +256,13 @@ export class ColumnPageObject extends BasePage {
await this.grid.get().locator(`th[data-title="${expectedTitle}"]`).isVisible();
}
async hideColumn({ title }: { title: string }) {
await this.grid.get().locator(`th[data-title="${title}"] .nc-ui-dt-dropdown`).click();
await this.rootPage.locator('li[role="menuitem"]:has-text("Hide Field"):visible').click();
await expect(this.grid.get().locator(`th[data-title="${title}"]`)).toHaveCount(0);
}
async save({ isUpdated }: { isUpdated?: boolean } = {}) {
await this.waitForResponse({
uiAction: this.get().locator('button:has-text("Save")').click(),

14
tests/playwright/tests/columnMenuOperations.spec.ts

@ -101,4 +101,18 @@ test.describe('Column menu operations', () => {
await dashboard.closeTab({ title: 'Film' });
});
test('Hide column', async () => {
await dashboard.treeView.openTable({ title: 'Film' });
await dashboard.grid.column.hideColumn({
title: 'Title',
});
await dashboard.grid.column.hideColumn({
title: 'Store List',
});
await dashboard.closeTab({ title: 'Film' });
});
});

Loading…
Cancel
Save