Browse Source

fix: select option- wait for json response, fields menu- wait for popup

pull/5674/head
Raju Udava 2 years ago
parent
commit
47ccb69dc5
  1. 14
      tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts
  2. 1
      tests/playwright/pages/Dashboard/common/Toolbar/index.ts

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

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

Loading…
Cancel
Save