-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
execute navigateTo automatically for every test #11 -
added test for enforceNavigateTo
- Loading branch information
Daniel.Rey
committed
Oct 24, 2016
1 parent
363a618
commit 1ffecbe
Showing
3 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...gration_test/src/it/scala/org/scalawebtest/integration/navigation/EnforceNavigateTo.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.scalawebtest.integration.navigation | ||
|
||
import org.scalatest.time.SpanSugar._ | ||
import org.scalawebtest.integration.ScalaWebTestBaseSpec | ||
|
||
class EnforceNavigateTo extends ScalaWebTestBaseSpec{ | ||
path = "/simpleAjax.jsp" | ||
config.enableJavaScript(throwOnError = true) | ||
config.enforceNavigateTo() | ||
|
||
"A simple webpage loading content with JS" should "be correctly interpreted by HtmlUnit" in { | ||
eventually(timeout(1 second)) { | ||
container.text should include("Text loaded with JavaScript") | ||
} | ||
} | ||
it should "not be immediately available, if page was reloaded" in { | ||
container.text should not include "Text loaded with JavaScript" | ||
} | ||
|
||
def container = { | ||
find(cssSelector("div#container")).get | ||
} | ||
} |