Xray Exporter
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. |
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.
Xray Export Properties
The properties marked with bold are mandatory. |
General
Property | Required | Description |
---|---|---|
|
false |
The key of the configured JIRA instance, in case of missing value it will be evaluated automatically based on issue keys being exported |
|
true |
Path to directory with test execution JSON results. The path is managed by the Please make sure that the |
|
true |
Key of a Jira project where new test cases should be created |
|
false |
Username of Jira user that will be used as assignee for newly created test cases |
|
false |
Statuses of test cases allowed to update |
|
false |
The key of a |
|
false |
By default, the content of Test Cases that have associated IDs, is updated every export run, to disable this behavior set the value of this property to |
|
false |
Comma-separated list of file and folder paths that should be uploaded to test execution as attachments. Please note that regular files like images, texts are uploaded as is, whereas folders are archived before the upload. |
xray-exporter.project-key=ABBA
xray-exporter.json-results-directory=/Users/happytester/Repositories/app-tests/output/results/jbehave
Test Execution
Property | Required | Description |
---|---|---|
|
false |
The key of |
|
false |
The |
Test execution import varies depending on values in xray-exporter.test-execution-key
and xray-exporter.test-execution-summary
, the following matrix shows this behavior change:
Configuration | Result |
---|---|
Both |
Test execution summary and associated test cases will be updated, the update of test cases is performed according to following rules:
|
Only |
New test execution will be created |
Only |
Associated test cases will be updated according to following rules:
|
Neither |
Text execution import is skipped |
Jira Fields Mapping
The Xray is a Jira plugin that uses custom Jira fields for it’s data, one of the ways to find out custom field names for particular field used by Xray on Jira UI (if access to Jira configuration is prohibited) is to request description of some issue like https://jira.example.com/rest/api/latest/issue/DUMMY-1.
Manual Test Case Properties
Index | Property | Description |
---|---|---|
|
Key of a field containing test case type |
|
|
Key of a field containing collection of manual steps |
jira.<jira instance key placeholder>.fields-mapping.test-case-type=customfield_10001
jira.<jira instance key placeholder>.fields-mapping.manual-steps=customfield_10002
Cucumber Test Case Properties
Index | Property | Description |
---|---|---|
|
Key of a field containing test case type |
|
|
Key of a field containing type of cucumber scenario |
|
|
Key of a field containing body of cucumber scenario |
jira.<jira instance key placeholder>.fields-mapping.test-case-type=customfield_10003
jira.<jira instance key placeholder>.fields-mapping.cucumber-scenario-type=customfield_10004
jira.<jira instance key placeholder>.fields-mapping.cucumber-scenario=customfield_10005
Authentication
-
If the authentication through basic schema is available on your JIRA instance use
jira.<jira instance key placeholder>.http.auth.username
andjira.<jira instance key placeholder>.http.auth.password
properties, both properties must be set. It’s also advisible to turn thepreemptive 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, token authentication or any other complex authentication process it’s possible to use request headers like the following example shows:
Example 5. Authenticate using Bearer tokenjira.<jira instance key placeholder>.http.headers.Authorization=Bearer D5YY0qJDxFDOZjCEpINMTdcQQxNtATrMw/IAsyWI+CzE
Example 6. Authenticate using session cookiesjira.<jira instance key placeholder>.http.headers.Cookie=SESSIONID=298zf09hf012fh2
Both jira.<jira instance key placeholder>.http.auth.username
andjira.<jira instance key placeholder>.http.auth.password
properties must be empty in this case.
Scenario Meta Attributes
Name | Example | Description |
---|---|---|
|
|
Map scenario to Jira test case in 1 to 1 relation |
|
|
Link scenario to Jira issue with "Tests" link type in 1 to 1 relation |
|
|
Set labels to the exported test case |
|
|
Set components to the exported test case |
|
|
Skip test case while exporting |
Test Case Types
This separation of automated and manual test cases by using special keywords is specific to VIVIDUS.
Automated Test Cases
Any scenario that doesn’t correspond to the manual test case rules is considered as automated test case.
Scenario: Verify link
Meta: @testCaseId TEST-231
Given I am on page with URL `${vividus-test-site-url}/links.html`
When I wait until the page has the title 'Links'
Then number of elements found by `<locator>` is equal to `1`
Examples:
|locator |
|By.linkUrl(#ElementId) |
|By.linkUrlPart(Element) |
|By.linkText(Link to an element)|
Scenario: Verify link
Meta: @testCaseId TEST-566
!-- Step: Open main app page
!-- Step: Wait for page with title is loaded
!-- Step: Verify number of links
!-- Data: * link url is '#ElementId'
!-- * link url part is 'Element'
!-- * link text is 'Link to an element'
!-- Result: The number of links for all locators is equal to 1
Given I am on page with URL `${vividus-test-site-url}/links.html`
When I wait until the page has the title 'Links'
Then number of elements found by `<locator>` is equal to `1`
Examples:
|locator |
|By.linkUrl(#ElementId) |
|By.linkUrlPart(Element) |
|By.linkText(Link to an element)|
Manual Test Cases
-
Scenario is considered as
Manual Test Case
if all of its lines start with!--
prefix. -
The
Manual Test Case
step must start withStep:
used to specify action to perform and can optionally containData:
andResult:
for specifying action data and action expected result respectively. -
The
Manual Test Case
step parts are allowed to have multiple lines. -
The
JBehave Keywords
values (e.g.Given
,When
,Then
…) on new lines not prefixed withStep:
,Data:
orResult
must be escaped with-
sign.
Scenario: Buy an item
Meta: @testCaseId TEST-435
!-- Step: Go to the test item with the following id
!-- Data: 39914061
!-- Result: The current stock is 1
!-- Step: Add the item to the shopping cart
!-- Result: Shopping cart now displays one 39914061 item and no items in stock
!-- Step: In the backoffice app update the stock to 0 on item
!-- Step: Back in the browser, proceed to checkout.
!-- Go through all the steps and confirm the payment method.
!-- Result: Then you should get an error message mentioning that there are no more items in the stock.
!-- - Then payment method was not made
Export
-
Go to the corresponding GitHub Packages repository
-
Find the link with name
vividus-to-xray-exporter-0.6.2.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 extensionjava -jar <jar-file name> -Dspring.config.location=classpath:/application.properties,./application.properties