Skip to content

Serenity and HP ALM Integration Guide

Software teams often use Serenity to write automated acceptance tests and produce cool reports. Sometimes they also want to see results of acceptance tests in HP ALM and this can be easily done with Bumblebee.

Prerequisites

  • One of the popular CI server like Jenkins, Atlassian Bamboo or TeamCity with corresponding Bumblebee plugin/add-on installed
  • Bumblebee Server must be installed and be accessible via HTTP from the machine where CI server/agent runs.

Generate Serenity Cucumber report in JSON format

Bumblebee works best with Serenity/Cucumber report in JSON format because it contains information about test steps and can also contain embedded screenshots.
To generate such report when running Serenity tests together with JUnit, the one just need to add the following annotations to the test suite class:

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "src/test/resources/features/consult_dictionary.feature", plugin = { "json:target/test-report.json" })
Where target/test-report.json is the path to the report which will be produced.

e.g.:

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "src/test/resources/features/consult_dictionary.feature", plugin = { "json:target/test-report.json" })
public class DefinitionTestSuite {

}

Setting up CI job to send results to HP ALM

Check CI corresponding pages for your CI system for initial Bumblebee configuration:

In all following examples Jenkins CI and Maven build tool will be used, but it's more or less the same for other CI systems.

Building Maven project in Jenkins

Assuming you have a Maven project with Serenity test which are run with JUnit framework, all we need to build it in Jenkins is add "Invoke top-level Maven targets" build step with clean test goals:

Jenkins configuration

Adding new Bumblebee HP ALM Uploader post build action

To send generated cucumber reports to HP ALM Reports, a "Bumblebee HP ALM Uploader" post build action should be added:

Jenkins configuration

Note

Note, that "Format" field must have cucumber value and "Result File Pattern" must have path to a JSON report defined in Serenity test class.

Execution and results

During Jenkins build Bumblebee prints information about progress into Jenkins console output:

Jenkins console output

Results in HP ALM TestPlan

HP ALM Results

Automatic folder structure creation

Folder structure is being automatically created by Bumblebee during exporting results, so there is no need to create it upfront

Results in HP ALM TestLab

HP ALM Results

HP ALM Results