im.yagni.driveby.conditions.AttributeEquals.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 AttributeEquals {
import Describer._
def apply(by: By, attributeName: String, expected: String) = new Condition {
def expectation = expect("AttributeEquals", List(by.toString, attributeName, expected))
def isSatisfied(browser: UnSafeBrowser) = { browser.attribute(by, attributeName) == expected }
def describeFailure(browser: UnSafeBrowser) = { expectation + butWas(() => browser.attribute(by, attributeName)) }
}
}