org.xpathqs.driver.extensions.SelectorExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xpathqs-driver Show documentation
Show all versions of xpathqs-driver Show documentation
Framework for the interaction with drivers for the xpathqs-core
package org.xpathqs.driver.extensions
import org.xpathqs.core.selector.base.BaseSelector
import org.xpathqs.driver.actions.*
import org.xpathqs.driver.const.Global
import java.time.Duration
val T.isVisible: Boolean
get() = Global.executor.isPresent(this)
val T.isHidden: Boolean
get() = !isVisible
fun T.waitForVisible(duration: Duration = Global.WAIT_FOR_ELEMENT_TIMEOUT) {
Global.executor.execute(WaitForSelectorAction(this, duration))
}
fun T.waitForDisappear(duration: Duration = Global.WAIT_FOR_ELEMENT_TIMEOUT) {
Global.executor.execute(WaitForSelectorDisappearAction(this, duration))
}
fun T.click(): T {
Global.executor.execute(ClickAction(this))
return this
}
fun T.input(value: String): T {
Global.executor.execute(InputAction(value, this))
return this
}
fun T.clear(): T {
Global.executor.execute(ClearAction(this))
return this
}
val T.text: String
get() = getAttr(Global.TEXT_ARG)
fun T.getAttr(name: String) =
Global.executor.getAttr(this, name)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy