Browse Source

test: insert before

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

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

@ -182,8 +182,6 @@ export class ColumnPageObject extends BasePage {
await this.save();
// verify column inserted after the target column
if (insertAfterColumnTitle) {
const headersText = [];
const locator = this.grid.get().locator(`th`);
const count = await locator.count();
@ -192,19 +190,15 @@ export class ColumnPageObject extends BasePage {
const text = await getTextExcludeIconText(header);
headersText.push(text);
}
// verify column inserted after the target column
if (insertAfterColumnTitle) {
expect(headersText[headersText.findIndex(title => title.startsWith(insertAfterColumnTitle)) + 1]).toBe(title);
}
// verify column inserted before the target column
if (insertBeforeColumnTitle) {
const headersText = await this.grid.get().locator(`th`).allTextContents();
await expect(
this.grid
.get()
.locator(`th`)
.nth(headersText.findIndex(title => title.startsWith(insertBeforeColumnTitle)) - 1)
).toHaveText(title);
expect(headersText[headersText.findIndex(title => title.startsWith(insertBeforeColumnTitle)) - 1]).toBe(title);
}
}

1
tests/playwright/tests/columnMenuOperations.spec.ts

@ -66,6 +66,7 @@ test.describe('Column menu operations', () => {
}
await dashboard.closeTab({ title: 'Film' });
});
test('Insert after', async () => {
await dashboard.treeView.openTable({ title: 'Film' });

Loading…
Cancel
Save