AssertThat - BDD & Cucumber for Jira provides a Node.js to enable integration with your automated test framework:
The plugin performs 2 main functions:
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 2 optional fields:
JIRA JQL - JQL filters can be developed using the JIRA's advanced searching functionality e.g. “Sprint = 5”.
mode - This field is set for each scenario in AssertThat and is set as default to Automated - Automated and Manual tests.
tags - tag expression filter for scenarios e.g. tags = "(@smoke or @ui) and (not @slow)". More on tag expressions https://cucumber.io/docs/cucumber/api/#tag-expressions
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.
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.
npm install @assertthat/assertthat-bdd --save |
For downloading feature files:
var assertThat = require('assertthat-bdd'); assertThat.downloadFeatures({ "projectId": PROJECT_ID, "accessKey": "ASSERTTHAT_ACCESS_KEY", "secretKey": "ASSERTTHAT_SECRET_KEY", "jiraServerUrl": "Jira server URL." //Omit if using Jira Cloud }, function() { // some optional callback code }); |
For uploading reports:
var assertThat = require('assertthat-bdd'); assertThat.uploadReports({ "projectId": PROJECT_ID, "accessKey": "ASSERTTHAT_ACCESS_KEY", "secretKey": "ASSERTTHAT_SECRET_KEY", "jiraServerUrl": "Jira server URL." //Omit if using Jira Cloud }, function() { // some optional callback code }); |
npm install @assertthat/assertthat-bdd |
For downloading features refer to usage below (one required parameter is projectId)
assertthat-bdd -i PROJECT_ID -a ASSERTTHAT_ACCESS_KEY -s ASSERTTHAT_SECRET_KEY -f Available parameters: -a, --accessKey [ASSERTTHAT_ACCESS_KEY] Access key -s, --secretKey [ASSERTTHAT_SECRET_KEY] Secret key -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, --proxyURI [URI] Proxy URI |
assertthat-bdd -i PROJECT_ID -a ASSERTTHAT_ACCESS_KEY -s ASSERTTHAT_SECRET_KEY -r Available parameters: -a, --accessKey [ASSERTTHAT_ACCESS_KEY] Access key -s, --secretKey [ASSERTTHAT_SECRET_KEY] Secret key -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, --proxyURI [URI] Proxy URI -d, --metadata [FILE PATH] Metadata json file path |
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.
Example of the file can be:
{ "environment": "UAT-1", "build": "XX-1-YY" } |
Refer to example project for running using Rake assertthat-testcafe-demo