Browse Source

test: LTAR verification

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
6e3da1903b
  1. 5
      tests/playwright/pages/Dashboard/common/Cell/index.ts
  2. 12
      tests/playwright/tests/db/columnLinkToAnotherRecord.spec.ts

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

@ -272,15 +272,18 @@ export class CellPageObject extends BasePage {
count,
value,
verifyChildList = false,
options,
}: CellProps & {
count?: number;
type?: 'hm' | 'bt' | 'mm';
value: string[];
verifyChildList?: boolean;
options?: { singular?: string; plural?: string };
}) {
const cell = await this.get({ index, columnHeader });
const linkText = await cell.locator('.nc-datatype-link');
console.log(index, columnHeader);
await cell.scrollIntoViewIfNeeded();
if (type === 'bt') {
@ -298,7 +301,7 @@ export class CellPageObject extends BasePage {
// verify chip count & contents
if (count) {
await expect(await cell.innerText()).toContain(`${count} ${count === 1 ? 'Link' : 'Links'}`);
await expect(await cell.innerText()).toContain(`${count} ${count === 1 ? options.singular : options.plural}`);
}
if (verifyChildList) {

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

@ -123,8 +123,8 @@ test.describe('LTAR create & update', () => {
const expected = [
[['1a'], ['1b'], ['1c']],
[['1a'], ['1b'], ['1c']],
[['1a'], ['1b'], ['1c']],
[['1 Sheet1'], ['1 Sheet1'], ['1 Sheet1']],
[['1 Sheet1'], ['1 Sheet1'], ['1 Sheet1']],
];
const colHeaders = ['Sheet1', 'Sheet1 List', 'Link2-1hm'];
@ -136,6 +136,8 @@ test.describe('LTAR create & update', () => {
columnHeader: colHeaders[i],
count: 1,
value: expected[i][j],
type: i === 0 ? 'bt' : undefined,
options: { singular: 'Sheet1', plural: 'Sheet1s' },
});
}
}
@ -144,8 +146,8 @@ test.describe('LTAR create & update', () => {
await dashboard.treeView.openTable({ title: 'Sheet1' });
const expected2 = [
[['2a'], ['2b'], ['2c']],
[['2a'], ['2b'], ['2c']],
[['1 Sheet2'], ['1 Sheet2'], ['1 Sheet2']],
[['1 Sheet2'], ['1 Sheet2'], ['1 Sheet2']],
[['2a'], ['2b'], ['2c']],
];
const colHeaders2 = ['Link1-2hm', 'Link1-2mm', 'Sheet2'];
@ -158,6 +160,8 @@ test.describe('LTAR create & update', () => {
columnHeader: colHeaders2[i],
count: 1,
value: expected2[i][j],
type: i === 2 ? 'bt' : undefined,
options: { singular: 'Sheet2', plural: 'Sheet2s' },
});
}
}

Loading…
Cancel
Save