Question

Using the play! framework (play2) - I am running tests via "play test".

This pretty prints the results - but I would also like the results to be put in the xunit "XML" format that all CI servers understand how to graphically report on.

Was it helpful?

Solution

Play 2.1.1 writes the test reports to target/test-reports.

For Java no further configuration is necessary, but for Scala adjust your project/Build.scala:

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "so-scala"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,
    anorm
  )


  val main = play.Project(appName, appVersion, appDependencies).settings(
    //write test reports and to console
    testOptions in Test += Tests.Argument("junitxml", "console")
  )

}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top