0
votes

I am running my test class from sbt file using task

scalaTaskRun := {
  val test = (runMain in Compile).fullInput(" org.scalatest.tools.Runner -s package.tests.TestClass1 -h ReportOutput").evaluated
}

to get a html report output for single test class. But I don't want to add -s TestClass2 again for running one more tests and so on...

If I want to run many test classes from sbt file just like running testNG suite xml which contains more than one test classes. How can the same thing be achieved in sbt scalatest??

I tried running with the runpath command...

Runner -R target\\folder\\classes -w package.testcases -h reportFolder

But it's not running the compiled test classes from classes folder.

Kindly help in fixing it.

1

1 Answers

1
votes

You can tell sbt which tests you want to run:

testOnly package.testcases.* -- -h reportFolder

everything after -- gets passed through to the test framework (e.g. ScalaTest).