Zephyr Exporter

Zephyr Exporter is a tool used for exporting test execution results into Jira Zephyr Plugin.

Zephyr Scale Features:

  • Create test executions

  • Set test execution statuses

  • Update statuses for existent execution

Zephyr Squad Features:

  • Create test executions

  • Set test execution statuses

JIRA Configuration

The exporter requires configuration of JIRA instance to work with.

To configure connector to JIRA instance use jira. prefix followed by arbitrary sequence of alphanumerical characters that determine unique JIRA instance key and followed by the properties listed in the following table:

The properties marked with bold are mandatory.
Property Name Description

project-key-regex

The regular expression to match JIRA project keys.

endpoint

The JIRA Endpoint.

any of general, authentication or SSL handshake properties

The HTTP properties.

fields-mapping

The mapping between human-readable fields used by VIVIDUS and fields used by JIRA.

Example 1. jira.properties
jira.vividus.project-key-regex=(VIVIDUS|VSCODE|REACTAPP)
jira.vividus.endpoint=https://vividusframework.atlassian.net/
jira.vividus.http.auth.username=admin
jira.vividus.http.auth.password=5401a7d27b291c5d
jira.vividus.http.socket-timeout=10000
jira.vividus.fields-mapping.test-case-type=customfield_10002

In the example above the vividus is a key that can be used to refer this JIRA instance.

Zephyr Export Properties

Property Required Description

zephyr.exporter.api-type

false

The type of Jira API (SCALE, SQUAD). The SCALE type is selected by default.

Zephyr Squad (formerly "Zephyr for Jira") provides base functionality for test case management easy to start, easy to use. More info

Zephyr Scale (formerly "Test Management for Jira") provides advanced test case management capabilities, such as cross-project test management solution with advanced test planning, reporting, and reusability features. More info

zephyr.exporter.jira-instance-key

false

The key of the configured JIRA instance, in case of missing value it will be evaluated automatically based on issue keys being exported

zephyr.exporter.source-directory

true

Path to directory with test execution JSON results.

zephyr.project-key

true

Key of a Jira project where new test executions should be created

zephyr.version-name

true

Version/release name where new test executions should be created

zephyr.cycle-name

true

Cycle/sprint name where new test executions should be created

zephyr.folder-name

false

Folder name where new test executions should be created

The following properties are applicable only for Squad

zephyr.exporter.statuses-of-test-cases-to-add-to-execution

false

List of test case statuses for adding to execution.

zephyr.exporter.update-execution-statuses-only

false

Property for update existing executions statuses only.

Zephyr Execution Status Mapping

The Zephyr plugin for Jira has own configurable execution statuses. testExecutionStatus endpoint is used to get the detailed information about the statuses, like: https://jira.example.com/rest/zapi/latest/util/testExecutionStatus. The following properties are used to setup a mapping between Vividus and Zephyr execution statuses.

This approach is similar for both API types (Scale and Squad), the major differences are Zephyr Scale has fewer test case statuses by default and the status representation during import (for Scale status transmitted in text format, like: Failed (Fail), but for Squad it transmitted in number format (status code), like: 7).

Vividus execution status property name Zephyr Squad execution status value (by default) Zephyr Scale execution status value

zephyr.statuses.FAILED

FAILED

Fail

zephyr.statuses.BROKEN

TEST NEEDS REWORK

Fail

zephyr.statuses.PENDING

TEST NEEDS REWORK

In Progress

zephyr.statuses.UNKNOWN

PASSED WITH REMARKS

Pass

zephyr.statuses.SKIPPED

SCHEDULED

Not Executed

zephyr.statuses.PASSED

PASSED

Pass

Authentication

  • If the authentication through basic schema is available on your JIRA instance use jira.<jira instance key placeholder>.http.auth.username and jira.<jira instance key placeholder>.http.auth.password properties, both properties must be set. It’s also advisible to turn the preemptive authentication on.

    jira.<jira instance key placeholder>.http.auth.username=admin
    jira.<jira instance key placeholder>.http.auth.password=5401a7d27b291c5d
    jira.<jira instance key placeholder>.http.auth.preemptive-auth-enabled=true
  • In case of two-factor authentication or any other complex authentication process it’s possible to set session cookies into request headers like the following example shows (jira.<jira instance key placeholder>.http.auth.username and jira.<jira instance key placeholder>.http.auth.password properties must be empty in this case).

    jira.<jira instance key placeholder>.http.headers.Cookie=SESSIONID=298zf09hf012fh2

Scenario Meta Attributes

Name Example Description

testCaseId

@testCaseId TEST-1

Add test execution to Jira test case

Example of scenario for export

Example 2. Test.story
Scenario: Buy an item
Meta:
    @layout desktop chrome_phone
    @testCaseId TEST-1; TEST-2; TEST-3

Given I am on page with URL `${vividus-test-site-url}/delayedScroll.html`
When I click on element located by `id(anchor)`
When I wait until scroll is finished
Then page is scrolled to element located by `id(toClick)`

Export

  • Go to the corresponding GitHub Packages repository

  • Find the link with name vividus-to-zephyr-exporter-0.5.12.jar

  • Click the link and download the exporter JAR-file

  • Create a new file with name application.properties in the same directory with the downloaded JAR-file

  • Put all custom properties to the created file

  • Run the following command from the directory where the JAR-file has been downloaded, make sure to replace <jar-file name> placeholder with the actual name (not path) of the JAR-file including its extension

    java -jar <jar-file name> -Dspring.config.location=classpath:/application.properties,./application.properties