From e0a1d227ee4c13ecc210c128ac8a7767457a05be Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Thu, 4 Jan 2024 06:16:41 +0000 Subject: [PATCH] fix: playwright form view select field dblClick issue --- .../pages/Dashboard/common/Cell/SelectOptionCell.ts | 4 ++-- .../playwright/pages/Dashboard/common/Cell/UserOptionCell.ts | 4 ++-- tests/playwright/tests/db/views/viewForm.spec.ts | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts index a0ba68158b..44d1ee7ba6 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts @@ -47,11 +47,11 @@ export class SelectOptionCellPageObject extends BasePage { if (index === -1) { const selectOption = this.rootPage.getByTestId(`select-option-${columnHeader}-undefined`).getByText(option); - await selectOption.waitFor({ state: 'visible' }); + await selectOption.scrollIntoViewIfNeeded(); await selectOption.click(); } else { const selectOption = this.rootPage.getByTestId(`select-option-${columnHeader}-${index}`).getByText(option); - await selectOption.waitFor({ state: 'visible' }); + await selectOption.scrollIntoViewIfNeeded(); await selectOption.click(); } diff --git a/tests/playwright/pages/Dashboard/common/Cell/UserOptionCell.ts b/tests/playwright/pages/Dashboard/common/Cell/UserOptionCell.ts index d24ba322cd..56e84ab968 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/UserOptionCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/UserOptionCell.ts @@ -41,11 +41,11 @@ export class UserOptionCellPageObject extends BasePage { if (index === -1) { const selectOption = this.rootPage.getByTestId(`select-option-${columnHeader}-undefined`).getByText(option); - await selectOption.waitFor({ state: 'visible' }); + await selectOption.scrollIntoViewIfNeeded(); await selectOption.click(); } else { const selectOption = this.rootPage.getByTestId(`select-option-${columnHeader}-${index}`).getByText(option); - await selectOption.waitFor({ state: 'visible' }); + await selectOption.scrollIntoViewIfNeeded(); await selectOption.click(); } diff --git a/tests/playwright/tests/db/views/viewForm.spec.ts b/tests/playwright/tests/db/views/viewForm.spec.ts index 747613db70..82fc2db602 100644 --- a/tests/playwright/tests/db/views/viewForm.spec.ts +++ b/tests/playwright/tests/db/views/viewForm.spec.ts @@ -478,6 +478,7 @@ test.describe('Form view', () => { columnHeader: 'SingleSelect', option: 'jan', multiSelect: false, + ignoreDblClick: true, }); // Click on multi select options