Skip to content

Commit

Permalink
add another missing example
Browse files Browse the repository at this point in the history
  • Loading branch information
alltonp committed Aug 13, 2015
1 parent a55f66a commit 43ad263
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ class ElementHiddenSpec extends WebSpecification with Matchers {
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)""")
}

}
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 ElementVisibleSpec extends WebSpecification with Matchers {
def `work for id` {
val id = Id("visible")
given.page(<b id={id.id} style="display:block">visible</b>)
.assert(ElementVisible(id))
val id = "ElementVisible"
given.page(<b id={id} style="display:block">{id}</b>)
.assert(ElementVisible(Id(id)))
}

def `fail for id not visible` {
val id = "ElementVisibleWhenHidden"
val b = given.page(<b id={id} style="display:none">{id}</b>)

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

}

0 comments on commit 43ad263

Please sign in to comment.