Browse Source

fix: Fixed flakyness with row height test

pull/6524/head
Muhammed Mustafa 11 months ago
parent
commit
b85961030c
  1. 4
      tests/playwright/pages/Dashboard/Grid/Row.ts
  2. 4
      tests/playwright/tests/db/features/undo-redo.spec.ts

4
tests/playwright/pages/Dashboard/Grid/Row.ts

@ -13,13 +13,13 @@ export class RowPageObject extends BasePage {
return this.rootPage.locator('tr.nc-grid-row'); return this.rootPage.locator('tr.nc-grid-row');
} }
async getRecord(index: number) { getRecord(index: number) {
return this.get().nth(index); return this.get().nth(index);
} }
// style="height: 3rem;" // style="height: 3rem;"
async getRecordHeight(index: number) { async getRecordHeight(index: number) {
const record = await this.getRecord(index); const record = this.getRecord(index);
const style = await record.getAttribute('style'); const style = await record.getAttribute('style');
return style.split(':')[1].split(';')[0].trim(); return style.split(':')[1].split(';')[0].trim();
} }

4
tests/playwright/tests/db/features/undo-redo.spec.ts

@ -294,9 +294,7 @@ test.describe('Undo Redo', () => {
test('Row height', async ({ page }) => { test('Row height', async ({ page }) => {
async function verifyRowHeight({ height }: { height: string }) { async function verifyRowHeight({ height }: { height: string }) {
await dashboard.grid.rowPage.getRecordHeight(0).then(readValue => { await expect(dashboard.grid.rowPage.getRecord(0)).toHaveAttribute('style', `height: ${height};`);
expect(readValue).toBe(height);
});
} }
// close 'Team & Auth' tab // close 'Team & Auth' tab

Loading…
Cancel
Save