Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

AssertThat - BDD & Cucumber for Jira provides a Node.js NPM package to enable integration with your automated test framework:

...

The plugin performs 2 main functions:

Download Feature files - download_features

The scenarios and feature files can be downloaded from the plugin into your automation test framework using the plugin provided. In addition to using tags to filter the scenarios for execution, the plugin provides 3 optional fields:

Upload test results (cucumber json file) into AssertThat - upload_report

The AssertThat - BDD Test Automation in Jira will parse the results of the cucumber json file and load them so that the results can be viewed in Jira alongside the user stories - Test Execution status for User Stories. The automated test results will automatically be linked to existing defects and the results loaded into the reporting tool. The failed tests can then be easily reviewed and assigned for further analysis - Automated Test Report Analysis.

Mandatory fields

The only mandatory field required is the projectId. The following parameters are also required however can be passed as environment variables - ASSERTTHAT_ACCESS_KEY and the ASSERTTHAT_SECRET_KEY or ASSERTTHAT_API_TOKEN.

...

In case of using Jira API access token more info on token generation and maintenace can be found here https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

Usage - within a script

Installation

Code Block
languageruby
npm install @assertthat/assertthat-bdd --save

...

Code Block
var assertThat = require('assertthat-bdd');

assertThat.uploadReports({
  "projectId": PROJECT_ID,
  "accessKey": "ASSERTTHAT_ACCESS_KEY",
  "token": "ASSERTTHAT_API_TOKEN",
  "jiraServerUrl": "Jira server URL." //Omit if using Jira Cloud
}, function() {
   // some optional callback code
});

Usage - Command line

Command line installation

Code Block
npm install @assertthat/assertthat-bdd
  • For downloading features refer to usage below (one required parameter is projectId)
    accessKey and secretKey are also required however can be passed as environment variables - ASSERTTHAT_ACCESS_KEY and the ASSERTTHAT_SECRET_KEY or ASSERTTHAT_API_TOKEN.

Download feature files

Code Block
 assertthat-bdd -i-projectId PROJECT_ID -a-accessKey ASSERTTHAT_ACCESS_KEY --ssecretKey ASSERTTHAT_SECRET_KEY -f 
 
 Available parameters:
  -a,--projectId <ID>                      Jira project id
  --accessKey [ASSERTTHAT_ACCESS_KEY]   Access key
  -s, --secretKey [ASSERTTHAT_SECRET_KEY]   Secret key
  -t, --token [ASSERTTHAT_API_TOKEN]        Jira API token (Server and DC only)
  -u, --jiraServerUrl [URL]                 Jira server URL e.g https://mycompanyjira.com
  -i, --projectId <ID>                      Jira project id

 -m, --mode <mode>                         Features to download (default: "automated")

 -l, --tags <tag-expression>               Cucucmber tag expression for scenarios filtering
  -o, --outputFolder [FOLDER PATH]          Jira project id
  -q, --jql [JQL]                           JQL filter for features
  -x,--proxyHost [Host]                    Proxy Host
  --proxyURIproxyPort [URIPort]                      Proxy URIPort

Upload test results

Code Block
 assertthat-bdd -i-projectId PROJECT_ID --aaccessKey ASSERTTHAT_ACCESS_KEY -s-secretKey ASSERTTHAT_SECRET_KEY -r

 Available parameters:
  -a,-projectId <ID>                      Jira project id
  --accessKey [ASSERTTHAT_ACCESS_KEY]   Access key
  -s, --secretKey [ASSERTTHAT_SECRET_KEY]   Secret key

 -t, --token [ASSERTTHAT_API_TOKEN]        Jira API token (Server and DC only)
  -u, --jiraServerUrl [URL]                 Jira server URL e.g https://mycompanyjira.com
  -i, --projectId <ID>                      Jira project id
  -j, --jsonReportFolder [FOLDER PATH]      Cucumber json files folder
  -n, --runName [NAME]                      Test run name
  -t, --jsonReportIncludePattern [PATTERN]  Pattern for json file names
  -x,-metadata [FILE PATH]                Metadata json file path
  --proxyURIproxyHost [URIHost]                      Proxy URIHost
  -d, --metadataproxyPort [FILEPort]  PATH]                Metadata json fileProxy pathPort
  • Metadata file path is the path to a simple json file (no nesting) with some additional data about the run that can be optionally supplied.

...

Code Block
{
  "environment": "UAT-1",
  "build": "XX-1-YY"
}

Example project

Refer to example project for running using Rake assertthat-testcafe-demo