All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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)) }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy