P
Size: a a a
P
NK
𝕆
OT
private fun selector(selector: String) =
Selenide.element(byCssSelector("mat-select[formcontrolname='$selector']"))
fun select(selectorName: String, index: Int) {
selector(selectorName).click()
selector(selectorName).options()[index-1].click()
}
fun select(selectorName: String, value: String) {
selector(selectorName).click()
selector(selectorName).options().findBy(){it.text() == value}.click()
}
fun SelenideElement.options(): ElementsCollection {
Selenide.sleep(500)
return Selenide.elements(byCssSelector("mat-option"))
}fun ElementsCollection.findBy(predicate: (SelenideElement) -> Boolean): SelenideElement {
return this.findBy(matching(predicate))
}OT
AV
private fun selector(selector: String) =
Selenide.element(byCssSelector("mat-select[formcontrolname='$selector']"))
fun select(selectorName: String, index: Int) {
selector(selectorName).click()
selector(selectorName).options()[index-1].click()
}
fun select(selectorName: String, value: String) {
selector(selectorName).click()
selector(selectorName).options().findBy(){it.text() == value}.click()
}
fun SelenideElement.options(): ElementsCollection {
Selenide.sleep(500)
return Selenide.elements(byCssSelector("mat-option"))
}fun ElementsCollection.findBy(predicate: (SelenideElement) -> Boolean): SelenideElement {
return this.findBy(matching(predicate))
}AS
private fun selector(selector: String) =
Selenide.element(byCssSelector("mat-select[formcontrolname='$selector']"))
fun select(selectorName: String, index: Int) {
selector(selectorName).click()
selector(selectorName).options()[index-1].click()
}
fun select(selectorName: String, value: String) {
selector(selectorName).click()
selector(selectorName).options().findBy(){it.text() == value}.click()
}
fun SelenideElement.options(): ElementsCollection {
Selenide.sleep(500)
return Selenide.elements(byCssSelector("mat-option"))
}fun ElementsCollection.findBy(predicate: (SelenideElement) -> Boolean): SelenideElement {
return this.findBy(matching(predicate))
}AS
AS
IZ