Gradle plugin

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

Download Feature files - downloadFeatures

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 - submitReport

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

Example project

Refer to example project assertthat-bdd-gradle-example

build.gradle

buildscript { dependencies{ classpath group: 'com.assertthat.plugins', name: 'assertthat-bdd-gradle-tasks', version: '1.6' } } task downloadFeatures(type: FeaturesTask){ /*Jira project id e.g. 10001*/ projectId ="PROJECT_ID" /*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" /*Used for jira server integration only. If using cloud remove this option*/ jiraServerUrl = "http://mycompanyjira.com" /*Optional - default ./features*/ outputFolder = "src/test/resources" /*Optional - all features downloaded by default - should be a valid JQL*/ jql = "project = XX AND key in ('XXX-1')" /*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 - the value MUST be an instance of {@link String} or {@link java.net.URI}.*/ proxyURI = "myproxy:8080" /*Optional - user name which will be used for proxy authentication.*/ proxyUsername = "username" /*Optional - password which will be used for proxy authentication.*/ proxyPassword = "password" } task submitReport(type: ReportTask){ /*Jira project id e.g. 10001*/ projectId ="PROJECT_ID" /*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" /*Used for jira server integration only. If using cloud remove this option*/ jiraServerUrl = "http://mycompanyjira.com" /*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" /*Optional - the value MUST be an instance of {@link String} or {@link java.net.URI}.*/ proxyURI = "myproxy:8080" /*Optional - user name which will be used for proxy authentication.*/ proxyUsername = "username" /*Optional - password which will be used for proxy authentication.*/ proxyPassword = "password" /*Optional - default cucumber (can be one of: cucumber/karate)*/ type = "cucumber" /*-Optional - all Jira tickets will be updated with test results by default; when JQL is provided only filtered tickets will be updated*/ jql = "project = XX AND key in ('XXX-1')" }