Configuring Jenkins

This guide walks you through the initial steps for using Jenkins with Zephyr Scale.

Create a feature file

  1. In Zephyr Scale, open a test case and switch to the Test Script tab.

  2. Select BDD - Gherkin from the Type list.

    The Gherkin editor appears.

  3. Write your test case.

    Remember not to include Feature or Scenario.

    Creating test case

    Click the image to enlarge it.

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

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

    Exporting feature files

    Click the image to enlarge it.

    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.

Install the Zephyr Scale plugin for Jenkins

  1. On the Jenkins home page, click Manage Jenkins.

  2. Click Manage Plugins.

  3. Switch to the Available tab.

  4. Search for Zephyr and select the Zephyr Scale plugin.

    Installing the Zephyr Scale plugin

    Click the image to enlarge it.

  5. Click Install without restart.

You can also download the Zephyr Scale Jenkins plugin from here:

go.gifhttps://plugins.jenkins.io/tm4j-automation/

Configure the plugin

  1. On the Jenkins home page, click Manage Jenkins.

  2. Click Configure System.

  3. Scroll to the Zephyr Scale section, click Add, and select Zephyr Scale Server.

  4. Enter your Jira Server URL and credentials. Click Test Configuration to validate the details, then click Save.

    Zephyr Scale plugin settings

    Click the image to enlarge it.

Setting Up the Zephyr Scale Plugin for Jenkins using Jenkins Configuration as Code

  1. Go to the Jenkins home page.

  2. Click Manage Jenkins.

  3. Choose Configuration as Code.

    Configuraton as Code

    Click the image to enlarge it.

  4. Select Download Configuration to get a pre-made configuration file or create a custom YAML file.

    Download Configuration

    Click the image to enlarge it.

  5. Open the downloaded file and scroll down to the Zephyr Scale section at the bottom.

    Click the image to enlarge it.

  6. In the configuration file, specify the type of instance you want to configure: Cloud or Server.

    1. If Cloud, provide 2 attributes as below.

      Zephyr Scale 2 attributes

      Click the image to enlarge it.

    2. If Server, specify 4 attributes as below.

      Zephyr Scale 4 attributes

      Click the image to enlarge it.

    3. If using a custom configuration file, ensure to include following attributes:

      Zephyr Scale other attributes

      Click the image to enlarge it.

  7. When the configuration file is completed, specify the path to the file on your local machine and click Apply new configuration.

    Zephyr Scale Apply-new-config

    Click the image to enlarge it.

    Note

    If the YAML file is configured incorrectly (wrong user data or missing attributes), no instances would be configured.

Publish 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. Select your Jenkins project, then click Configure.

    Configure project

    Click the image to enlarge it.

  2. Scroll to the Build section.

  3. Click Add build step and select Zephyr Scale: Download Feature Files from the list.

  4. Specify the following information:

    • Jira instance - One of the preconfigured Jira instances. If you do not have any, please go to Manage Jenkins > Configure System to set up and configure Jira instances.

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

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

    Build section

    Click the image to enlarge it.

  5. Click Apply.

  6. Scroll to the Post-Build Actions section.

  7. Click Add Post-Build Action and select Zephyr Scale: Publish Test Results from the list.

  8. Specify the following information:

    • Jira instance - One of the preconfigured Jira instances. Go to Manage Jenkins > Configure System to set up and configure Jira instances.

    • Project key - The 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.

    • (Optional) Select Automatically create non-existing test cases to automatically create a new case for a test when a test case key is not provided.

    Post-build actions section

    Click the image to enlarge it.

  9. Click Save.

See Also

Publication date: