clairvoyance.scalatest.export.ClairvoyanceHtmlPrinter.scala Maven / Gradle / Ivy
package clairvoyance.scalatest.export
import clairvoyance.export.ClairvoyanceHtml
trait ClairvoyanceHtmlPrinter {
def print(suiteResult: SuiteResult): ClairvoyanceHtml = {
val suiteFileName = asFileName(suiteResult)
ClairvoyanceHtml(s"$suiteFileName.html", printHtml(suiteFileName, suiteResult).xml)
// printTeamCityLog(executed)
}
private def asFileName(suiteResult: SuiteResult) = suiteResult.suiteClassName match {
case Some(suiteClassName) => suiteClassName
case None => suiteResult.suiteName
}
private def printHtml(specificationTitle: String, suiteResult: SuiteResult): ScalaTestHtmlFormat = {
clairvoyanceFormat.printHtml(
clairvoyanceFormat
.printHead(specificationTitle)
.printSidebar(allSuiteResults)
.printBody(suiteResult.suiteName, suiteResult)
.xml
)
}
protected def allSuiteResults: Seq[SuiteResult]
private def clairvoyanceFormat = new ScalaTestHtmlFormat()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy