Skip to content

Commit

Permalink
Added automated testing of issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
joescii committed Jul 5, 2014
1 parent 9cef85d commit 674692e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test-project/src/main/webapp/delay.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2>Snippet tests</h2>

<div ng-controller="EarlyEmitController">
<div data-lift="comet?type=EarlyEmitActor"></div>
Last message: {{earlyEmitOut[earlyEmitOut.length - 1]}}
Last message: <span id="last-msg">{{earlyEmitOut[earlyEmitOut.length - 1]}}</span>
<div ng-repeat="out in earlyEmitOut">
<span class="early-emit-out">{{out}}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package net.liftmodules.ng.test

import org.scalatest.time.{Millis, Seconds, Span}

class DelayedInitSpecs extends BaseSpec {
implicit override val patienceConfig =
PatienceConfig(timeout = scaled(Span(3, Seconds)), interval = scaled(Span(5, Millis)))

"The Delay page" should "load" in {
go to s"$index/delay"
eventually { pageTitle should be ("App: Delay") }
}

"The integers" should "load starting at 6" in {
eventually { id("last-msg").element.text should be ("6") }
eventually { id("last-msg").element.text should be ("7") }
eventually { id("last-msg").element.text should be ("8") }
eventually { id("last-msg").element.text should be ("9") }
eventually { id("last-msg").element.text should be ("10") }
}

"The final list" should "contain all integers in order" in {
val divs = findAll(className("early-emit-out"))
divs.drop(1).zipWithIndex.foreach { case (div, i) =>
div.text should be (i.toString)
}
}
}

0 comments on commit 674692e

Please sign in to comment.