Skip to content

Commit

Permalink
add missing example
Browse files Browse the repository at this point in the history
  • Loading branch information
alltonp committed Aug 13, 2015
1 parent eb254d7 commit a55f66a
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
package im.mange.acceptance.driveby.scalatest.condition

import im.mange.acceptance.driveby.scalatest.WebSpecification
import im.mange.common.ConditionNotMetException
import im.mange.driveby.Id
import im.mange.driveby.conditions._
import org.scalatest.Matchers

class ElementHiddenSpec extends WebSpecification with Matchers {
def `work for id` {
val id = Id("hidden")
given.page(<b id={id.id} style="display:none">hidden</b>)
.assert(ElementHidden(id))
val id = "ElementHidden"
given.page(<b id={id} style="display:none">{id}</b>)
.assert(ElementHidden(Id(id)))
}

def `fail for id not hidden` {
val id = "ElementHiddenWhenNotHidden"
val b = given.page(<b id={id} style="">{id}</b>)

val thrown = the [ConditionNotMetException] thrownBy { b.assert(ElementHidden(Id(id))) }
thrown.getMessage should equal("""> FAILED: Assert ElementHidden("Id(ElementHiddenWhenNotHidden)", "true") but was "true" (not met within 2000 millis)""")
}

}

0 comments on commit a55f66a

Please sign in to comment.