Running PlaySpec tests with Scalatest from packaged binary

I have a Play project with functional tests. I can run tests using SBT. They test the browser using a deployed application, i.e. with OneServerPerSuite with OneBrowserPerSuite ...

Instead of running tests with SBT / from the source code, I would like to compile and pack them and run from a binary file. However, if I pack test classes (with test: package in SBT) and run them, tests fail, for example. if I copy all the dependencies to libs including scala, ScalaTest, etc .:

 $ java -cp target/scala-2.10/myproject-acceptance_2.10-1.0-tests.jar:libs/* org.scalatest.tools.Runner -o -u results Discovery starting. Discovery completed in 20 milliseconds. Run starting. Expected test count is: 0 DiscoverySuite: Run completed in 57 milliseconds. Total number of tests run: 0 Suites: completed 1, aborted 0 Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0 

I can not run any tests. I tried the switches -s , -m , -w , -q for the scala test runner. The closest I can get to run the test is to specify a suffix (for example, for "MyWebappLogin")

 $ ... Runner -o -u results -q Login Suites: completed 1, aborted 0 Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0 

The tests themselves are based on Play recommendations . Scala Functional testing

Here is the Login test I tried ( MyWebappLogin.scala ):

 class MyWebappLogin extends PlaySpec with OneServerPerSuite with OneBrowserPerSuite with PhantomJSFactory with MustMatchers { val loginPage = new WebappLoginPage() //extends org.scalatest.selenium.Page with WebBrowser "The Login Page" must { "Render with title" in { go to (loginPage) pageTitle mustEqual "Please Log In" } } } 

How can I run tests for ScalaTest runners?

+7
scalatest
source share

No one has answered this question yet.

See related questions:

5
scalacheck / scalatest not found: how to add it to sbt / scala?
4
Scatter does not work in intuitive 13.1
3
Scala Test: Auto-skip tests that exceed the timeout
3
Scalatrasuite tests always fail in sbt, succeed when running a test in the IDE
2
how to run package level scalatest in eclipse
one
How to write an async Scala.js test (e.g. using ScalaTest)?
one
Increased Productivity with Scala Test Cycle
one
how to run scanned tests in class SAME using PARALLEL
one
Can I run tests from a dependency ban in SBT?
0
java.lang.NoClassDefFoundError in scalatest

All Articles