• Overview
  • Documentation
  • Version history

Description

Cucumber is a software testing tool that runs automated acceptance tests written in a behavior-driven development (BDD) style. BDD testing focuses on the behavior of the product. The Cucumber plug-in imports the test results data into HCL DevOps Velocity metrics.

Quick Info

Product icon

Product

HCL DevOps Velocity (HCL Accelerate)
Plugin type icon

Type

plugin
Compatibility icon

Compatibility

HCL DevOps Velocity version 2.0 or later
created by icon

Created by

HCL Software
Website icon

Website

Published Date

Last Updated

Summary

 

The Cucumber plug-in automates running Cucumber test scenarios. Test scenarios are based on Behavior Driven Development (BDD) written to test product features.

Cucumber test scenarios are written using the Gherkin syntax. Each scenario contains a set of steps that are verified, processed by the Cucumber tool. A report of success or failure is generated for each scenario. Scenarios are stored as Feature text files. Step Definitions, referred to as glue contains a Java method linking to one or more scenario steps.

Compatibility

This plug-in requires HCL DevOps Velocity version 2.0 or later.

Usage

 

Integration

To install the plug-in, perform the following steps:

  1. 1. In HCL DevOps Velocity, click Settings > Integrations > Available.
  2. 2. In the Action column for the Cucumber plug-in, click Install.

Integrating the plug-in by using user interface

To integrate the plug-in using the user interface, perform the following steps:

  1. 1. In HCL DevOps Velocity, click Settings > Integrations > Installed.
  2. 2. In the Action column for the Cucumber plug-in, click Add Integration.
  3. 3. On the Add Integration dialog, enter the values for the fields to configure the integration and define communication.
  4. 4. Click Add.

Integration type

The Cucumber plug-in parses Cucumber data sent in a XML file. The plug-in parses the *.xml file located in the target/surfire-reports directory generated by a Cucumber project.

Invoking the plug-in

To gather data from the Cucumber server, send an HTTP Post request with the data to parse. Whenever there is a hit to the endpoint, the data is parsed and displayed as metrics in HCL DevOps Velocity. You can use various methods such as Postman, REST calls, CURL, and CI/CD tools like Jenkins to invoke the plug-in endpoints.

Invoke using Jenkins plug-in

Install the Jenkin’s DevOps Velocity plugin into your Jenkins server. In your freestyle job or pipeline use the Upload Metrics File to HCL DevOps Velocity step and provide the required fields. This step allows your build job to upload results files to HCL DevOps Velocity.


pipeline {
   agent any
   stages {
      stage('cucumberMetrics') {
         steps {
            step([$class: 'UploadMetricsFile',  
                 appName: 'My Cucumber Test', 
                 dataFormat: 'cucumberXML', 
                 filePath: '', 
                 name: 'my-cucumber-test', 
                 pluginType: 'cucumber', 
                 tenantId: '', 
                 testSetName: 'cucumber', 
                 metricsRecordUrl: "${env.BUILD_URL}"
           ])
         }
      }
   }
}

Invoke using REST CALL

When using a REST call to invoke the plug-in, it must be a POST method and include the location of the HCL DevOps Velocity quality data endpoint.

The following request sample shows a REST call that you can copy and update as necessary. Key points about the snippet:

  • Update the server location of HCL DevOps Velocity in the URL.
  • The BODY of the call is a multipart/form data. It includes information about the payload.

METHOD: POST 
URL: https://<URL of HCL DevOps Velocity Server>/reporting-consumer/metrics
BODY (multipart/form-data):
 {
  payload: <JSON Object>
  testArtifact: <cucumber_xml_file>
 }

Example:

Invoke using Curl


curl --request POST \
  --url https://url_devopsvelocity_server>/reporting-consumer/metrics \
  --form 'payload={
    "tenant_id": "5ade13625558f2c6688d15ce",
    "application": {
    "name": "My Application"
  },
  "record": {
    "pluginType": "cucumber",
    "dataFormat": "cucumberXML"
  }
}
' \
  --form testArtifact=@test-result/cucumber.xml

Payload schema

The following shows the schema for the payload. Replace the angle brackets with your values for the parameters.


{
  "tenant_id": "",   
  "metricName": "", 
  "application": {
    "name": ""  
  },
  "record": {
    "recordName": "", 
    "executionDate": 1547983466015, 
    "pluginType": "cucumber",
    "dataFormat": "cucumberXML",  
    "metricsRecordUrl": "" 
  },
  "build": {  // One of the following fields must be included 
    "buildId": "",
    "jobExternalId": "",
    "url": "",
  },
  "commitId": "",  // optional
  "pullRequestId": "", // optional
  "environment": "" // optional
}
Name Description Required
tenant_id The name of the tenant. Yes
application_name The name of the application. Yes
metric_name The name of the recurring test set. Yes
commit_id   No
pull_request_id   No
environment_name   No
Record section    
record_name The name for this record No
execution_date The date that the test ran, specified in UNIX Epoch time. No
plugin_type This value must be cucumber. Yes
dataFormat xml file Yes
metricsRecordUrl To link the Jenkins build with test results No
Build section    
build_id   No
external_job_id   No
build_url   No

ucv-ext-cucumber:1.0.39.tar

Uploaded: 11-Jun-2024 09:09

ucv-ext-cucumber:1.0.34.tar

Uploaded: 31-May-2022 18:44

Pull Command

docker pull hclcr.io/accelerate/ucv-ext-cucumber:1.0.34
 

Release Notes

  • xml2json alternative added

ucv-ext-cucumber:1.0.33.tar

Uploaded: 31-May-2022 06:30

Pull Command

docker pull hclcr.io/accelerate/ucv-ext-cucumber:1.0.33
 

Release Notes

  • Reduced Vulnerabilities

ucv-ext-cucumber:1.0.8.tar

Uploaded: 08-Feb-2021 07:34

ucv-ext-cucumber:1.0.7.tar

Uploaded: 08-Feb-2021 07:33

Related Plugins