Browse Source

fix: Fixed flakyness with row height test

pull/6524/head
Muhammed Mustafa 1 year 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');
}
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();
}

4
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

Loading…
Cancel
Save