From 570a244a98277a42079a6121472a8b53b71bd9bb Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Fri, 19 May 2023 22:35:02 +0530 Subject: [PATCH 1/2] test/kludge for undo redo test failure Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/tests/db/undo-redo.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/playwright/tests/db/undo-redo.spec.ts b/tests/playwright/tests/db/undo-redo.spec.ts index c798910d7a..0665df93c4 100644 --- a/tests/playwright/tests/db/undo-redo.spec.ts +++ b/tests/playwright/tests/db/undo-redo.spec.ts @@ -178,6 +178,10 @@ test.describe('Undo Redo', () => { await dashboard.closeTab({ title: 'Team & Auth' }); await dashboard.treeView.openTable({ title: 'numberBased' }); + // hack: wait for grid to load + // https://github.com/nocodb/nocodb/actions/runs/5025773509/jobs/9013176970 + await page.waitForTimeout(1000); + await verifyFieldsOrder(['Number', 'Decimal', 'Currency']); // Hide Decimal From 47ccb69dc5bb8479d8163aec5fd80939f12fc48b Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Sat, 20 May 2023 13:10:06 +0530 Subject: [PATCH 2/2] fix: select option- wait for json response, fields menu- wait for popup --- .../Dashboard/common/Cell/SelectOptionCell.ts | 14 +++++++++++--- .../pages/Dashboard/common/Toolbar/index.ts | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts index 219d03ba2c..924060afcc 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts @@ -118,7 +118,7 @@ export class SelectOptionCellPageObject extends BasePage { index, columnHeader, option, - multiSelect, + multiSelect = false, }: { index: number; columnHeader: string; @@ -134,10 +134,18 @@ export class SelectOptionCellPageObject extends BasePage { await selectCell.locator('.ant-select-selection-search-input').type(option); - await selectCell.locator('.ant-select-selection-search-input').press('Enter'); + // await selectCell.locator('.ant-select-selection-search-input').press('Enter'); + + // Wait for update api call + const saveRowAction = () => selectCell.locator('.ant-select-selection-search-input').press('Enter'); + await this.waitForResponse({ + uiAction: saveRowAction, + requestUrlPathToMatch: 'api/v1/db/data/noco/', + httpMethodsToMatch: ['PATCH'], + responseJsonMatcher: resJson => String(resJson?.[columnHeader]).includes(String(option)), + }); if (multiSelect) await selectCell.locator('.ant-select-selection-search-input').press('Escape'); - // todo: wait for update api call } async verifySelectedOptions({ diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/index.ts b/tests/playwright/pages/Dashboard/common/Toolbar/index.ts index 6f756f21f1..afcaa3e824 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/index.ts +++ b/tests/playwright/pages/Dashboard/common/Toolbar/index.ts @@ -66,6 +66,7 @@ export class ToolbarPage extends BasePage { // Wait for the menu to close if (menuOpen) await this.fields.get().waitFor({ state: 'hidden' }); + else await this.fields.get().waitFor({ state: 'visible' }); } async clickFindRowByScanButton() {