From 5c4a2f8331a3f36534606c6dcdb34a67f95aea6d Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Mon, 3 Apr 2023 13:28:23 +0530 Subject: [PATCH] test: kanban stack, cell - scroll if needed Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/pages/Dashboard/Kanban/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/playwright/pages/Dashboard/Kanban/index.ts b/tests/playwright/pages/Dashboard/Kanban/index.ts index c6a06339a4..a48984c4f2 100644 --- a/tests/playwright/pages/Dashboard/Kanban/index.ts +++ b/tests/playwright/pages/Dashboard/Kanban/index.ts @@ -65,6 +65,7 @@ export class KanbanPage extends BasePage { const stacks = await this.get().locator(`.nc-kanban-stack`).count(); for (let i = 0; i < stacks; i++) { const stack = await this.get().locator(`.nc-kanban-stack`).nth(i); + await stack.scrollIntoViewIfNeeded(); // Since otherwise stack title will be repeated as title is in two divs, with one having hidden class const stackTitle = await stack.locator(`.nc-kanban-stack-head >> [data-testid="truncate-label"]`); await expect(stackTitle).toHaveText(order[i], { ignoreCase: true }); @@ -76,6 +77,7 @@ export class KanbanPage extends BasePage { const stacks = await this.get().locator(`.nc-kanban-stack`).count(); for (let i = 0; i < stacks; i++) { const stack = await this.get().locator(`.nc-kanban-stack`).nth(i); + await stack.scrollIntoViewIfNeeded(); const stackFooter = await stack.locator(`.nc-kanban-data-count`).innerText(); await expect(stackFooter).toContain(`${count[i]} record${count[i] !== 1 ? 's' : ''}`); } @@ -86,6 +88,7 @@ export class KanbanPage extends BasePage { const stacks = await this.get().locator(`.nc-kanban-stack`).count(); for (let i = 0; i < stacks; i++) { const stack = await this.get().locator(`.nc-kanban-stack`).nth(i); + await stack.scrollIntoViewIfNeeded(); const stackCards = stack.locator(`.nc-kanban-item`); await expect(stackCards).toHaveCount(count[i]); } @@ -96,6 +99,7 @@ export class KanbanPage extends BasePage { const stack = await this.get().locator(`.nc-kanban-stack`).nth(stackIndex); for (let i = 0; i < order.length; i++) { const card = await stack.locator(`.nc-kanban-item`).nth(i); + await card.scrollIntoViewIfNeeded(); const cardTitle = await card.locator(`.nc-cell`); await expect(cardTitle).toHaveText(order[i]); }