This document describes the configuration and customization changes which you may need to apply in order to integrate the program's output with your API environment.
-
Any content in those templates following a
REPLACE_xxxxxx_REPLACEpattern indicates content which will be replaced automatically by the program. Unless mentioned otherwise, you don't need to apply any changes here. -
Any content which does not follow this previous naming pattern but contains
CONFIGURE_THIS_...may need to get configured prior to using the program. -
Open the
src/templatesfolder. This folder contains:- two
template_jira_...template files - five
template_robot_..template files
- two
- Edit the
template_robot_..template files:- File
template_robot_generic_includes.robotcontains a placeholder for the API's base URL. Dependent on whether your OpenAPI file contains this information or not, the program will try to replace this value with the correct URL from the OpenAPI file. See functionwrite_robot_framework_includes_filein the program for further details. In addition, you can add generic include content to this file. - Files
template_robot_keyword_without_request_body.robotandtemplate_robot_keyword_with_request_body.robotcontain the code for sending REST requests to the API.- This is where the action happens - you may need to reconfigure the API call keyword, add some post-processing logic etc.
- The
Send API Requestcommand used in the program's template files is not present as a keyword and acts as a mere placeholder; you need to amend this section in the program's templates.
- File
template_robot_header.robotrepresents the future test's header content - read: declaration of the datadriver file, libraries etc. Normally, you don't need to apply any changes here. - File
template_robot_footer.robotcontains footer data which will be added to the generated test file at the bottom of the file. This file can contain e.g. additional keywords, declarations etc.
- File
With the exception of template_robot_footer.robot, all files are considered as mandatory content. The footer file is optional and there will be no error if the footer file cannot be found.
This section is optional if you don't intend to use the Jira ticket generator.
In order to configure the extended configuration for Jira, you need to retrieve configuration values which are specific to your JIRA installation. Please see this article for additional details. In addition, this program assumes that you have the Jira XRay plugin installed. You can still use the program without XRay support but might be required to apply small changes to both code and template files
Prerequisites for this configuration step:
- Determine your numeric Jira project ID
- Get the
customfield_...value for your Jira/XRay installation'sTest Environmentsfield. Dependent on your setup, you can use this field for e.g. passing environment variables from Jira/XRay to other connected system component. - In order to allow the program to create these tickets, you need to provide a Jira Access key to the program. Contact your administrator if necessary. The access key may look like this:
dGVu9Y3lfcm9ib3Q6M08lKADt9vTVhnchhaUnQ9
- Edit file
template_jira_test_case.json. Replace the placeholderCONFIGURE_THIS_SETTING_WITH_YOUR_JIRA_PROJECT_IDwith your numeric Jira project ID. Then save the file.
Example:
"project": {
"id": "123456"
},
- Edit file
template_jira_test_execution.json. Replace the placeholderCONFIGURE_THIS_SETTING_WITH_YOUR_JIRA_PROJECT_IDwith your numeric Jira project ID. Replace the placeholdercustomfield_CONFIGURE_THIS_WITH_THE_NUMERIC_CUSTOMFIELD_ID_OF_THE_XRAY_TEST_ENVIRONMENTS_FIELDwith yourcustomfieldvalue. Then save the file.
Example:
"project": {
"id": "123456"
},
...
"customfield_123456": ["ROBOT_ENVIRONMENT=TEST"],
As discussed earlier, the customfield value references to (external) Robot Framework environment variables which can be passed from Jira to other systems such as Jenkins.
Finally, edit the program and change the JIRA URL's base server URL:
JIRA_SERVER_URL = "https://jira.acme.com:443"
Note that this URL is used for both 'regular' Jira operations as well as for X-Ray operations. Dependent on your Jira setup, you may need to change some subsettings in the program.
There are two XRay dependencies which need to be amended:
- remove the
customfield_xxxxreference from the file - Amend the
create_jira_ticketsfunction in the code and disable the XRay API calls.
Have a look at the program's command line parameters and known issues
