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, count,
value, value,
verifyChildList = false, verifyChildList = false,
options,
}: CellProps & { }: CellProps & {
count?: number; count?: number;
type?: 'hm' | 'bt' | 'mm'; type?: 'hm' | 'bt' | 'mm';
value: string[]; value: string[];
verifyChildList?: boolean; verifyChildList?: boolean;
options?: { singular?: string; plural?: string };
}) { }) {
const cell = await this.get({ index, columnHeader }); const cell = await this.get({ index, columnHeader });
const linkText = await cell.locator('.nc-datatype-link'); const linkText = await cell.locator('.nc-datatype-link');
console.log(index, columnHeader);
await cell.scrollIntoViewIfNeeded(); await cell.scrollIntoViewIfNeeded();
if (type === 'bt') { if (type === 'bt') {
@ -298,7 +301,7 @@ export class CellPageObject extends BasePage {
// verify chip count & contents // verify chip count & contents
if (count) { 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) { if (verifyChildList) {

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

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

Loading…
Cancel
Save