From 6f60d1236448057504e8ea8db843bd15b6dcf5f8 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 14 Nov 2022 18:28:52 +0530 Subject: [PATCH] test(cypress): select cell if not active Signed-off-by: Pranav C --- .../pages/Dashboard/common/Cell/SelectOptionCell.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts index 8c1566717e..7837a313c1 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts @@ -25,7 +25,14 @@ export class SelectOptionCellPageObject extends BasePage { option: string; multiSelect?: boolean; }) { - await this.get({ index, columnHeader }).click(); + const selectCell = this.get({ index, columnHeader }); + + // check if cell active + if (!(await selectCell.getAttribute('class')).includes('active')) { + await selectCell.click(); + } + + await selectCell.click(); await this.rootPage.getByTestId(`select-option-${columnHeader}-${index}`).getByText(option).click();