Browse Source

test: ltar, column ops

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5363/head
Raju Udava 2 years ago
parent
commit
c32bed09bb
  1. 18
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  2. 5
      tests/playwright/tests/columnLinkToAnotherRecord.spec.ts

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

@ -3,6 +3,7 @@ import { GridPage } from '..';
import BasePage from '../../../Base'; import BasePage from '../../../Base';
import { SelectOptionColumnPageObject } from './SelectOptionColumn'; import { SelectOptionColumnPageObject } from './SelectOptionColumn';
import { AttachmentColumnPageObject } from './Attachment'; import { AttachmentColumnPageObject } from './Attachment';
import { getTextExcludeIconText } from '../../../../tests/utils/general';
export class ColumnPageObject extends BasePage { export class ColumnPageObject extends BasePage {
readonly grid: GridPage; readonly grid: GridPage;
@ -183,14 +184,15 @@ export class ColumnPageObject extends BasePage {
// verify column inserted after the target column // verify column inserted after the target column
if (insertAfterColumnTitle) { if (insertAfterColumnTitle) {
const headersText = await this.grid.get().locator(`th`).allTextContents(); const headersText = [];
const locator = this.grid.get().locator(`th`);
await expect( const count = await locator.count();
this.grid for (let i = 0; i < count; i++) {
.get() const header = locator.nth(i);
.locator(`th`) const text = await getTextExcludeIconText(header);
.nth(headersText.findIndex(title => title.startsWith(insertAfterColumnTitle)) + 1) headersText.push(text);
).toHaveText(title); }
expect(headersText[headersText.findIndex(title => title.startsWith(insertAfterColumnTitle)) + 1]).toBe(title);
} }
// verify column inserted before the target column // verify column inserted before the target column

5
tests/playwright/tests/columnLinkToAnotherRecord.spec.ts

@ -43,7 +43,7 @@ test.describe('LTAR create & update', () => {
}); });
await dashboard.closeTab({ title: 'Sheet1' }); await dashboard.closeTab({ title: 'Sheet1' });
await dashboard.treeView.openTable({ title: 'Sheet2' }); await dashboard.treeView.openTable({ title: 'Sheet2', networkResponse: false });
await dashboard.grid.column.create({ await dashboard.grid.column.create({
title: 'Link2-1hm', title: 'Link2-1hm',
type: 'LinkToAnotherRecord', type: 'LinkToAnotherRecord',
@ -116,6 +116,9 @@ test.describe('LTAR create & update', () => {
value: '2c', value: '2c',
type: 'text', type: 'text',
}); });
await dashboard.rootPage.waitForTimeout(1000);
await dashboard.expandedForm.save(); await dashboard.expandedForm.save();
const expected = [ const expected = [

Loading…
Cancel
Save