Skip to content

Commit

Permalink
feat: add getBytext, containsText
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhikharevAl committed Aug 15, 2024
1 parent 1f3e10e commit 4586183
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/kotlin/src/demoqa/pages/BasePage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,12 @@ abstract class BasePage(private val page: Page) {
protected fun getElementsTexts(locator: String): List<String> {
return page.locator(locator).allInnerTexts()
}

protected fun getByText(text: String): Locator {
return page.getByText(text)
}

protected fun containsText(text: String): Boolean {
return page.content().contains(text)
}
}

0 comments on commit 4586183

Please sign in to comment.