Skip to content

Commit

Permalink
feat: add BasePage
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhikharevAl committed Aug 9, 2024
1 parent 497cd7d commit 230c0fa
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/kotlin/src/demoqa/pages/BasePage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package src.demoqa.pages

import com.microsoft.playwright.Locator
import com.microsoft.playwright.Page

abstract class BasePage(private val page: Page) {
private fun findElement(locator: String): Locator {
return page.locator(locator)
}

protected fun fill(
locator: String,
value: String,
) {
findElement(locator).fill(value)
}

protected fun inputValue(locator: String): String {
return findElement(locator).inputValue()
}
}

0 comments on commit 230c0fa

Please sign in to comment.