Browse Source

test: treeview width fix

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5384/head
Raju Udava 2 years ago
parent
commit
efeb30f262
  1. 20
      tests/playwright/pages/Dashboard/TreeView.ts

20
tests/playwright/pages/Dashboard/TreeView.ts

@ -23,10 +23,24 @@ export class TreeViewPage extends BasePage {
} }
async verifyVisibility({ isVisible }: { isVisible: boolean }) { async verifyVisibility({ isVisible }: { isVisible: boolean }) {
if (isVisible) { await this.rootPage.waitForTimeout(1000);
await expect(this.get()).toBeVisible();
const domElement = await this.get();
// get width of treeview dom element
const width = (await domElement.boundingBox()).width;
// if (isVisible) {
// await expect(this.get()).toBeVisible();
// } else {
// await expect(this.get()).not.toBeVisible();
// }
// border for treeview is 1px
// if not-visible, width should be < 5;
if (!isVisible) {
expect(width).toBeLessThan(5);
} else { } else {
await expect(this.get()).not.toBeVisible(); expect(width).toBeGreaterThan(5);
} }
} }

Loading…
Cancel
Save