Applies to Zephyr Scale Cloud, last modified on November 18, 2020.

Jenkins is a continuous integration tool that helps with the deployment of software projects. Through this, you can run automated tests while building a project, and monitor the results. 

The TM4J Jenkins plugin enables a task that reports on Zephyr Scale automated test results. 

The plugin supports Jenkins: 2.138.4 and above.

Workflow: Zephyr Scale and Jenkins 

Here's how the components work together:

Installing the Plugin  

  1. In Jenkins, go to settings.
  2. Click Manage Plugins.
  3. Switch to the Available tab.
  4. Scroll to and select the  Test Management for Jira  plugin.
  5. Click Install.

Setting Up the Plugin for Jenkins

Once you've installed the plugin, follow these steps to set it up:

  1. Go to the Jenkins home page. 
  2. Click Manage Jenkins.
  3. Click Configure System.
  4. Scroll to the Test Management for Jira section, select Test Management for Jira Cloud and enter your Zephyr Scale Cloud API Key.
    Check out Generating Access Keys if you need a refresher.
  5. Click Test Configuration to ensure that the connection is valid.
  6. Once valid, click Save.

Publishing Jenkins Test Results to Zephyr Scale  

The post-build task explained here helps you configure the publishing of Jenkins automated-test results to Jira once a project build completes. 

  1. Click on your project in Jenkins.
  2. Click Configure on the sidebar. 
  3. Scroll to the Post-Build Action section.
  4. Click Add Post-Build Action, then click Test Management for Jira: Publish Test Results in the drop-down menu:
    A new section appears and includes configuration fields.
  5. Complete the configuration fields:
    • Jira Instance - The URL of your Jira instance. 
    • Project Key - The Jira project key where the results will be sent.
    • Test Framework - Select Cucumber or JUnit. 
    • File Path - The file path for the results file that is generated from the automated tests.
    • Automatically Create Non-Existing Test Cases (optional) - This creates a relationship with the test case key used to annotate a test within a development project.

  6. Click Save.

Running BDD Test Cases in Jira 

This build task pulls existing BDD test cases from Zephyr Scale. When you execute these tests within Jenkins, the results are then sent back to Zephyr Scale

To enable this task to run before a build takes place, complete the following steps:

  1. Click on your project in Jenkins.
  2. Click Configure on the sidebar. 
  3. Scroll down to the Build section, and click Add Build Step.
  4. Click Test Management for Jira: Export Feature Files in the drop-down menu:
    A new section appears and includes configuration fields.
  5. Complete the configuration fields:
    • Jira Instance - The URL of your Jira instance.
    • Project Key - The Jira project key where the results will be sent.
    • Target Path - The file path for the results file that is generated from the automated tests.

  6. Click Save.
Highlight search results