im.yagni.driveby.driver.webdriver.WebDriverElement.scala Maven / Gradle / Ivy
The newest version!
package im.yagni.driveby.driver.webdriver
import im.yagni.driveby.driver.NakedElement
import org.openqa.selenium.{By, WebElement}
import collection.JavaConversions._
case class WebDriverElement(element: WebElement) extends NakedElement {
def attribute(name: String) = element.getAttribute(name)
def click() { element.click() }
def enter(value: String) { element.sendKeys(value) }
def isDisplayed = element.isDisplayed
def option(value: String) = element.findElements(By.tagName("option")).find(_.getText == value).map(WebDriverElement(_))
def text = element.getText
def yAxisLocation = element.getLocation.getY
}