Skip to content

Ruby gem

AssertThat - BDD & Cucumber for Jira provides a Ruby plugin to enable integration with your automated test framework:

The plugin performs 2 main functions:

Download Feature files - download_features

Section titled “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

Section titled “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 - https://assertthat.atlassian.net/wiki/spaces/ABTM/pages/728203292. 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.

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. All 3 parameters are available from the AssertThat Configuration page - AssertThat Configuration.

To add to the Gemfile

gem 'assertthat-bdd', '~> 1.0', '>= 1.6.4'
require 'assertthat-bdd'
task :download_features do
AssertThatBDD::Features.download(
#Optional can be supplied as environment variable ASSERTTHAT_ACCESS_KEY
accessKey:'ASSERTTHAT_ACCESS_KEY',
#Optional can be supplied as environment variable ASSERTTHAT_SECRET_KEY
secretKey:'ASSERTTHAT_SECRET_KEY',
#Required for Jira Server only. Omit if using Jira Cloud version
jiraServerUrl: 'https://mycompanyjira.com'
#Required Jira project id e.g. 10001
projectId: 'PROJECT_ID',
#Optional - default ./features
outputFolder: './features/',
#Optional proxy url to connect to Jira
proxy: 'PROXY_URL',
#Optional - default automated (can be one of: manual/automated/both)
mode: 'automated',
#Optional - tag expression filter for scenarios. More on tag expressions https://cucumber.io/docs/cucumber/api/#tag-expressions
tags: '(@smoke or @ui) and (not @slow)',
#Optional - all features downloaded by default - should be a valid JQL
jql: 'project = XX AND key in (\'XXX-1\')'
)
end
task :upload_report do
AssertThatBDD::Report.upload(
#Optional can be supplied as environment variable ASSERTTHAT_ACCESS_KEY
accessKey:'ASSERTTHAT_ACCESS_KEY',
#Optional can be supplied as environment variable ASSERTTHAT_SECRET_KEY
secretKey:'ASSERTTHAT_SECRET_KEY',
#Required for Jira Server only. Omit if using Jira Cloud version
jiraServerUrl: 'https://mycompanyjira.com'
#Jira project id e.g. 10001
projectId: 'PROJECT_ID',
#The name of the run - default 'Test run dd MMM yyyy HH:mm:ss'
runName: "Dry Tests Run",
#Json report folder - default ./reports
jsonReportFolder: "reports",
#Regex to search for cucumber reports - default .*.json
jsonReportIncludePattern: ".*/cucumber.json"
)
end
gem install assertthat-bdd
  • For downloading features refer to usage below (one required parameter is projectId)
assertthat-bdd-features -h
Usage: assertthat-bdd-features [options]
--accessKey ACCESS_KEY Access key same as env variable ASSERTTHAT_ACCESS_KEY
--secretKey SECRET_KEY Secret key same as env variable ASSERTTHAT_SECRET_KEY
--projectId PROJECT_ID Jira project id
--outputFolder OUTPUT_FOLDER Featured output folder - default ./features
--mode MODE Mode one of automated,manual,both - deafult automated
--tags <tag-expression> Cucucmber tag expression for scenarios filtering
--jql JQL_FILTER Jql issues filter
--proxy PROXY_URL proxy url to connect to Jira
--help Show help
--version Show version
assertthat-bdd-report -h
Usage: assertthat-bdd-report [options]
--accessKey ACCESS_KEY Access key same as env variable ASSERTTHAT_ACCESS_KEY
--secretKey SECRET_KEY Secret key same as env variable ASSERTTHAT_SECRET_KEY
--projectId PROJECT_ID Jira project id
--runName RUN_NAME The name of the run - default 'Test run dd MMM yyyy HH:mm:ss'
--jsonReportFolder JSON_FOLDER_PATH, Json report folder - default ./reports
--jsonReportIncludePattern INCLUDE_REGEX, Regex to search for cucumber reports - default .*.json
--proxy PROXY_URL proxy url to connect to Jira
--help Show help
--version Show version
--jql [JQL] JQL filter for Jira issues to update with test results

Refer to example project for running using Rake assertthat-bdd-ruby-example