Skip to content

Commit

Permalink
feat: add the behavior of the page when filling in the date of birth
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhikharevAl committed Aug 15, 2024
1 parent e35e7a8 commit 8eacc8f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/kotlin/src/demoqa/pages/RegistrationFormPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ object RegistrationFormLocators {
const val STATE_INPUT = "#react-select-3-input"
const val CITY = "Select City"
const val CITY_INPUT = "#react-select-4-input"
const val DATE_OF_BIRTH = "#dateOfBirthInput"
}

class RegistrationFormPage(page: Page) : BasePage(page) {
Expand Down Expand Up @@ -209,4 +210,18 @@ class RegistrationFormPage(page: Page) : BasePage(page) {
fun verifyCity(city: String): Boolean {
return containsText(city)
}

@Step("Выбор даты рождения")
@Description("Метод для выбора даты рождения")
fun selectDateOfBirth(date: String) {
click(RegistrationFormLocators.DATE_OF_BIRTH)
fill(RegistrationFormLocators.DATE_OF_BIRTH, date)
pressEnter()
}

@Step("Проверка выбора даты рождения")
@Description("Метод для проверки выбора даты рождения")
fun verifyDateOfBirth(date: String): Boolean {
return containsText(date)
}
}

0 comments on commit 8eacc8f

Please sign in to comment.