Browse Source

fix: playwright test fail issue

pull/7218/head
Ramesh Mane 10 months ago
parent
commit
0ab961cbe1
  1. 11
      tests/playwright/pages/Dashboard/Grid/index.ts
  2. 3
      tests/playwright/tests/db/features/undo-redo.spec.ts

11
tests/playwright/pages/Dashboard/Grid/index.ts

@ -125,14 +125,19 @@ export class GridPage extends BasePage {
);
await this.get().locator('.nc-grid-add-new-cell').click();
// Wait for to add new row
await addNewRowResponse;
const rowCount = index + 1;
await expect(this.get().locator('.nc-grid-row')).toHaveCount(rowCount);
await this._fillRow({ index, columnHeader, value: rowValue });
// Start waiting for response before filling cell value
const updateCellResponse = this.rootPage.waitForResponse(
res => res.url().includes('api/v1/db/data/noco') && res.request().method() === 'PATCH' && res.status() === 200
);
// Wait for add new row api response
await addNewRowResponse;
await this._fillRow({ index, columnHeader, value: rowValue });
await updateCellResponse;
await this.rootPage.keyboard.press('Escape');
await this.rootPage.waitForTimeout(300);

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

@ -162,8 +162,11 @@ test.describe('Undo Redo', () => {
// Undo : Row.Create
await undo({ page, dashboard });
await verifyRecords([333, NaN]);
await undo({ page, dashboard });
await verifyRecords([333]);
await undo({ page, dashboard });
await undo({ page, dashboard });
await verifyRecords([]);
});

Loading…
Cancel
Save