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. 25
      tests/playwright/pages/Dashboard/common/Cell/index.ts
  2. 2
      tests/playwright/tests/db/columnLinkToAnotherRecord.spec.ts

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

@ -329,13 +329,24 @@ 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 });
await cell.locator('.nc-datatype-link').click(); const isLink = await cell.locator('.nc-datatype-link').count();
await this.waitForResponse({
uiAction: () => this.rootPage.locator(`[data-testid="nc-child-list-icon-unlink"]`).first().click(), // Count will be 0 for BT columns
requestUrlPathToMatch: '/api/v1/db/data/noco/', if (!isLink) {
httpMethodsToMatch: ['GET'], await cell.click();
}); await cell.locator('.nc-icon.unlink-icon').click();
await this.rootPage.keyboard.press('Escape'); }
// For HM/MM columns
else {
await cell.locator('.nc-datatype-link').click();
await this.waitForResponse({
uiAction: () => this.rootPage.locator(`[data-testid="nc-child-list-icon-unlink"]`).first().click(),
requestUrlPathToMatch: '/api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
});
await this.rootPage.keyboard.press('Escape');
}
} }
async verifyRoleAccess(param: { role: string }) { async verifyRoleAccess(param: { role: string }) {

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