Skip to content

Latest commit

 

History

History
87 lines (72 loc) · 3.45 KB

2.1.2.md

File metadata and controls

87 lines (72 loc) · 3.45 KB

Serenity BDD 2.1.2

This release includes a new extended report, a machine-readable JSON summary report, improved support for multi-module Gradle projects, and a number of bug fixes.

Machine-readable JSON and single-page HTML

You can now produce a summary of test executions in JSON format using the json-summary extended report. This report uses the custom reports feature of Serenity BDD, and was contributed by Paul Ireland.

The emailable report has also changed names: it is now called single-page-html , and the corresponding dependency is called serenity-single-page-report.

Both of these reports are easy to generate.

Configuring extended reports in Maven

You can generate them in Maven by adding the corresponding dependencies to your serenity-maven-plugin configuration and listing the reports in the reports section:

<plugin>
    <groupId>net.serenity-bdd.maven.plugins</groupId>
    <artifactId>serenity-maven-plugin</artifactId>
    <version>${serenity.maven.version}</version>
    <configuration>
        <tags>${tags}</tags>
        <reports>single-page-html,json-summary</reports>
    </configuration>
    <executions>
        <execution>
            <id>serenity-reports</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>aggregate</goal>
                <goal>reports</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-single-page-report</artifactId>
            <version>2.1.2</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-json-summary-report</artifactId>
            <version>2.1.2</version>
        </dependency>
    </dependencies>
</plugin>

This configuration will generate both reports when you run mvn verify. If you want to run the reports without running the full test suite, you can run mvn serenity:reports.

Configuring extended reports in Gradle

In Gradle, you need to add the dependencies to buildscript dependencies, as shown below:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath("net.serenity-bdd:serenity-gradle-plugin:2.1.2")
        classpath("net.serenity-bdd:serenity-single-page-report:2.1.2")
        classpath("net.serenity-bdd:serenity-json-summary-report:2.1.2")
    }
}

Next, you need to list the reports in your serenity task. You do this as shown here:

serenity {
    reports = ['single-page-html','json-summary']
}

Now, you can generate these reports (once your test results have been generated) by calling the reports task:

$ gradle reports

> Task :filters-acceptance-tests:reports
Generating Serenity Reports for filters-acceptance-tests to directory /Users/john/Projects/Serenity/serenity-filters-demo/filters-acceptance-tests/target/site/serenity
  - Single Page HTML Summary: file:///Users/john/Projects/Serenity/serenity-filters-demo/filters-acceptance-tests/target/site/serenity/serenity-summary.html
  - JSON Summary: file:///Users/john/Projects/Serenity/serenity-filters-demo/filters-acceptance-tests/target/site/serenity/serenity-summary.json

Maven multi-module reports

This release also fixes an issue where reports where not generated in the correct directory for multi-module projects.