From 387217374f91c310e5c6527e7a44fd720493c09f Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Thu, 4 Jan 2024 06:16:40 +0000 Subject: [PATCH] fix: multiselect type fields playwright test fail issue --- .../pages/Dashboard/common/Cell/SelectOptionCell.ts | 6 ++++-- .../pages/Dashboard/common/Cell/UserOptionCell.ts | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts index d8f6a2e6c7..74be504902 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts @@ -49,8 +49,10 @@ export class SelectOptionCellPageObject extends BasePage { await selectOption.click(); } - if (multiSelect) await this.get({ index, columnHeader }).click(); - + if (multiSelect) { + // Press `Escape` to close the dropdown + await this.rootPage.keyboard.press('Escape'); + } await this.rootPage .getByTestId(`select-option-${columnHeader}-${index}`) .getByText(option) diff --git a/tests/playwright/pages/Dashboard/common/Cell/UserOptionCell.ts b/tests/playwright/pages/Dashboard/common/Cell/UserOptionCell.ts index 8b6398f5c6..8fe005492c 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/UserOptionCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/UserOptionCell.ts @@ -47,7 +47,10 @@ export class UserOptionCellPageObject extends BasePage { await selectOption.click(); } - if (multiSelect) await this.get({ index, columnHeader }).click(); + if (multiSelect) { + // Press `Escape` to close the dropdown + await this.rootPage.keyboard.press('Escape'); + } await this.rootPage .getByTestId(`select-option-${columnHeader}-${index}`)