Browse Source

test: add row using right click context menu

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3848/head
Raju Udava 2 years ago committed by Muhammed Mustafa
parent
commit
340f2c4ed3
  1. 10
      scripts/playwright/pages/Dashboard/Grid/index.ts
  2. 3
      scripts/playwright/tests/tableColumnOperation.spec.ts

10
scripts/playwright/pages/Dashboard/Grid/index.ts

@ -91,6 +91,16 @@ export class GridPage extends BasePage {
await this.rootPage.waitForTimeout(300);
}
async addRowRightClickMenu(index: number) {
const rowCount = await this.get().locator(".nc-grid-row").count();
await this.get().locator(`td[data-pw="cell-Title-${index}"]`).click({
button: "right",
});
// Click text=Insert New Row
await this.rootPage.locator("text=Insert New Row").click();
expect(await this.get().locator(".nc-grid-row").count()).toBe(rowCount + 1);
}
async openExpandedRow({ index }: { index: number }) {
await this.row(index).locator(`td[pw-data="cell-id-${index}"]`).hover();
await this.row(index).locator(`div[pw-data="nc-expand-${index}"]`).click();

3
scripts/playwright/tests/tableColumnOperation.spec.ts

@ -67,5 +67,8 @@ test.describe("Table Column Operations", () => {
columnHeader: "Title",
value: "value_a",
});
// add new row using right-click menu
await grid.addRowRightClickMenu(0);
});
});

Loading…
Cancel
Save