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

im.yagni.driveby.conditions.AttributeContains.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 AttributeContains {
  import Describer._

  def apply(by: By, attributeName: String, expected: String) = new Condition {
    def expectation = expect("AttributeContains", List(by.toString, attributeName, expected))
    def isSatisfied(browser: UnSafeBrowser) = { browser.attribute(by, attributeName) contains expected }
    def describeFailure(browser: UnSafeBrowser) = { expectation + butWas(() => browser.attribute(by, attributeName)) }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy