Test Management for Jira Server

Configuring Jenkins

The two tasks in this topic guide you through the initial steps for using Jenkins with TM4J.

Creating a Feature File

  1. Open a test case, then click the Test Script tab.

  2. Select BDD - Gherkin from the Type dropdown.
    The Gherkin editor appears.

  3. Write your test case.
    Remember not to include Feature or Scenario.

    jenkins-02

  4. Click Save when you are finished, and close the test case.

  5. Select Export Feature Files (BDD - Gherkin) from the More to download the feature file for your new test case (or the selected test cases).

    jenkins-03

    The zip file downloads to your computer. Developers using your company’s supported BDD tool can reference this information when writing automated tests related to the test case.

Installing the TM4J Plugin for Jenkins

  1. Navigate to the Manage Plugins page, and install the Test Management for Jira plugin on your Jenkins instance. You can also download the Jenkins plugin here: https://plugins.jenkins.io/tm4j-automation.

    jenkins-04

  2. Click Manage Jenkins, and scroll to the Test Management for Jira section.

  3. Enter the details for your Jira instance, test the connection, then click Add.

    jenkins-05

  4. Select your Jenkins project, then click Configure.

    jenkins-06

  5. Scroll to the Build section, select Test Management for Jira: Export BDD test cases from the Add Build Step dropdown, then fill out the following details and click Apply:

    • Jira Instance - One of the preconfigured Jira instances. If you do not have any, please go to General Configuration and set up a new Jira instance.

    • Project Key - Jira project key used to filter test cases.

    • Target Path - The path where the exported feature files are to be placed.

      jenkins-07

  6. Scroll to the Post-Build Actions section, select Test Management for Jira: Publish Test Results from the Add Post-Build Action dropdown, then fill out the following details:

    • Jira Instance - One of the preconfigured Jira instances. If you do not have any, please go to General Configuration and set up a new Jira instance.

    • Project Key - Jira project key used to filter test cases.

    • Test Framework - The test framework where the test results are to be generated from.

    • File Path - The path where the build places generated test result files. You can also use Ant-style patterns, such as */test-reports/.json.

      jenkins-08

  7. Optional: Check Automatically Create Non-Existing Test Cases if you want to create a test case for a test where a test case key is not provided.

    jenkins-09

  8. Click Apply, and then click Save.