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?