Browse Source

test: unlink handling for bt

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5848/head
Raju Udava 1 year ago committed by Pranav C
parent
commit
d571f65df2
  1. 11
      tests/playwright/pages/Dashboard/common/Cell/index.ts
  2. 2
      tests/playwright/tests/db/columnLinkToAnotherRecord.spec.ts

11
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -329,6 +329,16 @@ export class CellPageObject extends BasePage {
async unlinkVirtualCell({ index, columnHeader }: CellProps) { async unlinkVirtualCell({ index, columnHeader }: CellProps) {
const cell = this.get({ index, columnHeader }); const cell = this.get({ index, columnHeader });
const isLink = await cell.locator('.nc-datatype-link').count();
// Count will be 0 for BT columns
if (!isLink) {
await cell.click();
await cell.locator('.nc-icon.unlink-icon').click();
}
// For HM/MM columns
else {
await cell.locator('.nc-datatype-link').click(); await cell.locator('.nc-datatype-link').click();
await this.waitForResponse({ await this.waitForResponse({
uiAction: () => this.rootPage.locator(`[data-testid="nc-child-list-icon-unlink"]`).first().click(), uiAction: () => this.rootPage.locator(`[data-testid="nc-child-list-icon-unlink"]`).first().click(),
@ -337,6 +347,7 @@ export class CellPageObject extends BasePage {
}); });
await this.rootPage.keyboard.press('Escape'); await this.rootPage.keyboard.press('Escape');
} }
}
async verifyRoleAccess(param: { role: string }) { async verifyRoleAccess(param: { role: string }) {
// normal text cell // normal text cell

2
tests/playwright/tests/db/columnLinkToAnotherRecord.spec.ts

@ -166,7 +166,7 @@ test.describe('LTAR create & update', () => {
} }
} }
// verify LTAR cell values // Unlink LTAR cells
for (let i = 0; i < expected2.length; i++) { for (let i = 0; i < expected2.length; i++) {
for (let j = 0; j < expected2[i].length; j++) { for (let j = 0; j < expected2[i].length; j++) {
await dashboard.grid.cell.unlinkVirtualCell({ await dashboard.grid.cell.unlinkVirtualCell({

Loading…
Cancel
Save