From 38e2e2a918554d2f9c01a4c4c888f922cc6734e9 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Mon, 3 Apr 2023 13:18:32 +0530 Subject: [PATCH] test: shortcuts, scroll cell into view for tests Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts | 1 + tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts | 1 + tests/playwright/pages/Dashboard/common/Cell/index.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts b/tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts index 9609ec193e..0ad8e737aa 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/AttachmentCell.ts @@ -25,6 +25,7 @@ export class AttachmentCellPageObject extends BasePage { const attachFileAction = this.get({ index, columnHeader }) .locator('[data-testid="attachment-cell-file-picker-button"]') .click(); + await this.get({ index, columnHeader }).scrollIntoViewIfNeeded(); return await this.attachFile({ filePickUIAction: attachFileAction, filePath }); } diff --git a/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts b/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts index 8514e4ea21..93de8be449 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts @@ -23,6 +23,7 @@ export class RatingCellPageObject extends BasePage { } async verify({ index, columnHeader, rating }: { index?: number; columnHeader: string; rating: number }) { + await this.get({ index, columnHeader }).scrollIntoViewIfNeeded(); await expect(await this.get({ index, columnHeader }).locator(`div[role="radio"][aria-checked="true"]`)).toHaveCount( rating ); diff --git a/tests/playwright/pages/Dashboard/common/Cell/index.ts b/tests/playwright/pages/Dashboard/common/Cell/index.ts index f747373021..bede598f4e 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/index.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/index.ts @@ -322,6 +322,7 @@ export class CellPageObject extends BasePage { } async copyToClipboard({ index, columnHeader }: CellProps, ...clickOptions: Parameters) { + await this.get({ index, columnHeader }).scrollIntoViewIfNeeded(); await this.get({ index, columnHeader }).click(...clickOptions); await (await this.get({ index, columnHeader }).elementHandle()).waitForElementState('stable');