From c32bed09bbaec1b1138c4c36ccfd7b2850cc1f47 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Sun, 26 Mar 2023 07:16:26 +0530 Subject: [PATCH] test: ltar, column ops Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../pages/Dashboard/Grid/Column/index.ts | 18 ++++++++++-------- .../tests/columnLinkToAnotherRecord.spec.ts | 5 ++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/playwright/pages/Dashboard/Grid/Column/index.ts b/tests/playwright/pages/Dashboard/Grid/Column/index.ts index 7efb67d398..cba1868a70 100644 --- a/tests/playwright/pages/Dashboard/Grid/Column/index.ts +++ b/tests/playwright/pages/Dashboard/Grid/Column/index.ts @@ -3,6 +3,7 @@ import { GridPage } from '..'; import BasePage from '../../../Base'; import { SelectOptionColumnPageObject } from './SelectOptionColumn'; import { AttachmentColumnPageObject } from './Attachment'; +import { getTextExcludeIconText } from '../../../../tests/utils/general'; export class ColumnPageObject extends BasePage { readonly grid: GridPage; @@ -183,14 +184,15 @@ export class ColumnPageObject extends BasePage { // verify column inserted after the target column if (insertAfterColumnTitle) { - const headersText = await this.grid.get().locator(`th`).allTextContents(); - - await expect( - this.grid - .get() - .locator(`th`) - .nth(headersText.findIndex(title => title.startsWith(insertAfterColumnTitle)) + 1) - ).toHaveText(title); + const headersText = []; + const locator = this.grid.get().locator(`th`); + const count = await locator.count(); + for (let i = 0; i < count; i++) { + const header = locator.nth(i); + const text = await getTextExcludeIconText(header); + headersText.push(text); + } + expect(headersText[headersText.findIndex(title => title.startsWith(insertAfterColumnTitle)) + 1]).toBe(title); } // verify column inserted before the target column diff --git a/tests/playwright/tests/columnLinkToAnotherRecord.spec.ts b/tests/playwright/tests/columnLinkToAnotherRecord.spec.ts index 1b7f53c999..dd74bf0fd4 100644 --- a/tests/playwright/tests/columnLinkToAnotherRecord.spec.ts +++ b/tests/playwright/tests/columnLinkToAnotherRecord.spec.ts @@ -43,7 +43,7 @@ test.describe('LTAR create & update', () => { }); await dashboard.closeTab({ title: 'Sheet1' }); - await dashboard.treeView.openTable({ title: 'Sheet2' }); + await dashboard.treeView.openTable({ title: 'Sheet2', networkResponse: false }); await dashboard.grid.column.create({ title: 'Link2-1hm', type: 'LinkToAnotherRecord', @@ -116,6 +116,9 @@ test.describe('LTAR create & update', () => { value: '2c', type: 'text', }); + + await dashboard.rootPage.waitForTimeout(1000); + await dashboard.expandedForm.save(); const expected = [