im.yagni.driveby.conditions.ValueEquals.scala Maven / Gradle / Ivy
The newest version!
package im.yagni.driveby.conditions
import im.yagni.driveby.browser.UnSafeBrowser
import im.yagni.driveby.{By, Condition, Describer}
object ValueEquals {
import Describer._
def apply(by: By, expected: String) = new Condition {
def expectation = expect("ValueEquals", List(by.toString, expected))
def isSatisfied(browser: UnSafeBrowser) = { browser.attribute(by, "value") == expected }
def describeFailure(browser: UnSafeBrowser) = { expectation + butWas(() => browser.attribute(by, "value")) }
}
}