From b85961030c722ab90fc21ad57483e8ffa620d4d6 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Sat, 30 Sep 2023 13:12:24 +0530 Subject: [PATCH] fix: Fixed flakyness with row height test --- tests/playwright/pages/Dashboard/Grid/Row.ts | 4 ++-- tests/playwright/tests/db/features/undo-redo.spec.ts | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/playwright/pages/Dashboard/Grid/Row.ts b/tests/playwright/pages/Dashboard/Grid/Row.ts index 664d51260f..3f0ff8cbd5 100644 --- a/tests/playwright/pages/Dashboard/Grid/Row.ts +++ b/tests/playwright/pages/Dashboard/Grid/Row.ts @@ -13,13 +13,13 @@ export class RowPageObject extends BasePage { return this.rootPage.locator('tr.nc-grid-row'); } - async getRecord(index: number) { + getRecord(index: number) { return this.get().nth(index); } // style="height: 3rem;" async getRecordHeight(index: number) { - const record = await this.getRecord(index); + const record = this.getRecord(index); const style = await record.getAttribute('style'); return style.split(':')[1].split(';')[0].trim(); } diff --git a/tests/playwright/tests/db/features/undo-redo.spec.ts b/tests/playwright/tests/db/features/undo-redo.spec.ts index 20939be061..b4102665e2 100644 --- a/tests/playwright/tests/db/features/undo-redo.spec.ts +++ b/tests/playwright/tests/db/features/undo-redo.spec.ts @@ -294,9 +294,7 @@ test.describe('Undo Redo', () => { test('Row height', async ({ page }) => { async function verifyRowHeight({ height }: { height: string }) { - await dashboard.grid.rowPage.getRecordHeight(0).then(readValue => { - expect(readValue).toBe(height); - }); + await expect(dashboard.grid.rowPage.getRecord(0)).toHaveAttribute('style', `height: ${height};`); } // close 'Team & Auth' tab