Donut

Donut is an open-source framework by the teams at MagenTys & Mechanical Rock and is designed to produce clear and concise test execution reports of your unit, integration and acceptance tests. Donut currently supports any tool that produces cucumber JSON (i.e. cucumber-jvm etc.). For other frameworks like SpecFlow, JUnit, NUnit, RSpec you can use the adapters listed below to generate cucumber JSON, which can then be processed by donut.

Examples

quickstart

You can either use Donut directly or check out the available plugins:

download

wget http://repo1.maven.org/maven2/report/donut/donut/1.2.1/donut-1.2.1-one-jar.jar
          

or download the latest release from: here

run from command line

java -jar donut-<Version>.jar -s /source/dir
          

options

-n or --projectName is a mandatory parameter, and it should be the name of the project.

-s or --resultSources is a mandatory parameter, and it should be a comma separated list of the paths to the directories that hold the result files optionally prefixed with a format. The format defaults to cucumber.

Other parameters can also be specified as bellow:

Donut help
          Usage: MagenTys Donut reports [options]

            -s <value> | --resultSources <value>
                  Use --resultSources /my/path/cucumber-reports -> Required
            -o <value> | --outputPath <value>
                  Use --outputPath /my/path/output/donut
            -p <value> | --prefix <value>
                  Use --prefix fileNamePrefix
            -d <value> | --datetime <value>
                  Use --datetime yyyy-MM-dd-HHmm
            -t <value> | --template <value>
                  Use --template default/light
            --skippedFails <value>
                  Use --skippedFails true/false
            --pendingFails <value>
                  Use --pendingFails true/false
            --undefinedFails <value>
                  Use --undefinedFails true/false
            --missingFails <value>
                  Use --missingFails true/false
            -n <value> | --projectName <value>
                  Use --projectName myProject -> Required
            -v <value> | --projectVersion <value>
                  Use --projectVersion 1.0
            -c <value> | --customAttributes <value>
                  Use --customAttributes k1=v1,k2=v2...
          

default values:

use as a dependency


  <dependency>
    <groupId>io.magentys</groupId>
    <artifactId>donut</artifactId>
    <version>1.2.1</version>
  </dependency>
          
libraryDependencies += "io.magentys" % "donut" % "1.2.1"
          
compile 'report.donut:donut:1.2.1'
          

Example usage of the Generator

ReportConsole report =
    Generator.apply(sourceDirectory, outputDirectory, filePrefix, timestamp,
    template, countSkippedAsFailure, countPendingAsFailure,
    countUndefinedAsFailure, countMissingAsFailure, projectName, projectVersion);
          

This will create an html report at the outputDirectory and will return a ReportConsole output object:


          allFeatures: List[Feature]
          allTags: List[ReportTag]
          totalFeatures: Int
          numberOfPassedFeatures: Int
          numberOfFailedFeatures: Int
          totalScenarios: Int
          numberOfPassedScenarios: Int
          numberOfFailedScenarios: Int
          totalSteps: Int
          numberOfPassedSteps: Int
          numberOfFailedSteps: Int
          numberOfSkippedSteps: Int
          numberOfPendingSteps: Int
          numberOfUndefinedSteps: Int
          duration: String
          buildFailed: Boolean
          

build from source

prerequisites

run from sbt

sbt "run-main io.magentys.donut.Boot -s /my/jsons/dir"

credits

Road map

We currently have plans to support:

License

This project is under an MIT license

Powered by: MagenTys & Mechanical Rock