Skip to content

Commit

Permalink
Add ScrollIntoView
Browse files Browse the repository at this point in the history
Signed-off-by: Dominika Zemanovicova <[email protected]>
  • Loading branch information
dzemanov committed Jan 8, 2025
1 parent dce6328 commit d9193a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions e2e-tests/playwright/utils/ui-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,12 @@ export class UIhelper {
}

async clickBtnInCard(cardText: string, btnText: string, exact = true) {
const card = this.page
const cardLocator = this.page
.locator(UI_HELPER_ELEMENTS.MuiCardRoot(cardText))
.first();
await card
await cardLocator.scrollIntoViewIfNeeded();
await expect(cardLocator).toBeVisible();
await cardLocator
.getByRole("button", { name: btnText, exact: exact })
.first()
.click();
Expand Down

0 comments on commit d9193a0

Please sign in to comment.