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() {