Behave Pro can export the created Feature and Scenarios to any gherkin compatible test automation tool. For Pyhton based projects we have a library that will export the features directly from JIRA from any python script.

Installation

We host our Python client PyPi, and it is available through pip or by direct download. Assuming you have Python and pip installed on your system, run:

$ pip install hindsight

You will have installed the behave python client and all its dependencies. Depending on your system, you may have to prefix the command with “sudo”.

Using from the command line

Installing the package will have placed a binary on your path named “behave-cli”. The output of “behave-cli –help” is as follows:

$ behave-cli HOST KEY [-u USERNAME] [-p PASSWORD] [-d DIR] [-m]

An example usage would be:

$ behave-cli https://behave.pro 10100 \
  -u "Cloud userId OR JIRA Server Username" \
  -p "Cloud API key OR JIRA Server Password" \
  -d features \
  -m

Note: For Behave Pro Cloud the above host should be used, but for JIRA Server, enter your full JIRA instance URL. This article has more information on finding these configuration items

This example uses your API key user name and value to download features from project ID 10100 into the features directory, including all manual scenarios.

Using from within a script

You can use the JIRA connector within your own scripts to download features from Behave

#!/usr/bin/env python

from hindsight.behave import JiraConnector

jc = JiraConnector()
jc.fetch(
  host='https://behave.pro',
  username='Cloud userId OR JIRA Server Username',
  password='Cloud API key OR JIRA Server Password',
  key='10100',
  dir='features',
  manual=True
)

The task has four required parameters, host , Key , username  and password . These 4 parameters are different depending on if you are using JIRA Cloud or Server. You can retrieve the correct details the JIRA project's admin area; 'Project Settings' > 'Behave Pro' > 'Generate config'. This article has more information on finding these configuration items

Did this answer your question?