Search code examples
unit-testingscalasbtspecs2html-rendering

Specs2: Generate HTML report?


I am using specs2 to generate html test reports. But, I am getting one com.company.package.SomeSpec.html per spec. Is it possible to generate a single page html report for ALL my tests or atleast generate an index.html also which links to other tests?


Solution

  • This is described in the User Guide, "How to create an index"

    import org.specs2._
    import runner.SpecificationsFinder._
    
    class index extends Specification { def is =
    
      examplesLinks("Example specifications")
    
      // see the SpecificationsFinder trait for the parameters of the 'specifications' method
      def examplesLinks(t: String) = t.title ^ specifications().map(see)
    }