I know there's jira library for python: <JIRA 2.0> to search issues or get page content from Jira.
But is there any library I can use to get the content from plugin: Zephyr in Jira?
I tried to use requests library to analysis the contents from html, but login cookies is complicated and the contents in Test Details seems hidden or in somewhere instead of main page. So I wonder if there's any good method to grab the test cases? Thanks.
Now I've found another way to grab the test case content by ZAPI.
Before actions, you need to make sure you've installed ZAPI. Check that in:
https://<jira-server>/rest/zephyr/1.0/application.wadl
You can get html content by using format like this:
improt requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
"""
Replace your cookies. The reason why I don't like this method cause
it's complicated for me to get dynamic cookies in different users.
"""
header = {'Cookie': cookie,}
url = "https://<jira-server>/rest/zapi/latest/teststep/testid"
html = requests.get(url, verify=False, headers=header)
# You need to parse the content by yourself cause it's messy strings
You can find testID through API defined in JIRA library.
from jira import JIRA
jira = JIRA(basic_auth={username, password},
options={'server':%jira-server%, 'verify':False,})
cases = jira.search_issues('project=%your project% AND
type=Test ORDER BY created ASC',fields='', maxResults=100)
print(cases)
More detailed answers you can find in below path:
Hope ATLASSIAN will provide more APIs in JIRA library. If you've any better methods or ideas, please share with us, thanks :)
Hi, check this out - could be useful for you:
https://bitbucket.org/melectrification/python-zephyr/src/master/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.