Skip to main content

Wrappers for both Zephyr Scale and Zephyr Squad (TM4J) REST APIs

Project description

Zephyr Test Management

PyPI - Python Version PyPI PyPI - License

Project description

This is a set of wrappers for both Zephyr Scale and Zephyr Squad (TM4J) REST APIs. This means you can interact with Zephyr without GUI, access it with python code and create automation scripts for your every day interactions.

This project is a fork of nassauwinter's zephyr-python-api.

For more detailed information please see the project's documentation.

To be done:

  • Zephyr Squad Cloud support
  • More usage examples for cloud versions
  • Increase the tests coverage
  • Convenient docs
  • Implementing higher level wrappers representing Test Case, Test Cycle, etc.

Installation

pip install zephyr-test-management

Example usage

Zephyr Scale

Zephyr Scale Cloud auth:

from zephyr import ZephyrScale

zscale = ZephyrScale(token="<your_token>")

Zephyr Scale Server (TM4J) auth:

from zephyr import ZephyrScale

# Auth can be made with Jira token
auth = {"token": "<your_jira_token>"}

# or with login and password (suggest using get_pass)
auth = {"username": "<your_login>", "password": "<your_password>"}

# or even session cookie dict
auth = {"cookies": "<session_cookie_dict>"}

zscale = ZephyrScale.server_api(base_url="<your_base_url>", **auth)

Then it is possible to interact with api wrappers:

zapi = zscale.api

# Get all test cases
all_test_cases = zapi.test_cases.get_test_cases()

# Get a single test case by its id
test_case = zapi.test_cases.get_test_case("<test_case_id>")

# Create a test case
creation_result = zapi.test_cases.create_test_case("<project_key>", "test_case_name")

Zephyr Squad

Zephyr Squad Server (TM4J) auth:

from zephyr import ZephyrSquad

# Auth can be made with Jira token
auth = {"token": "<your_jira_token>"}

# or with login and password (suggest using get_pass)
auth = {"username": "<your_login>", "password": "<your_password>"}

# or even session cookie dict
auth = {"cookies": "<session_cookie_dict>"}

zsquad = ZephyrSquad(base_url=base_url, **auth)

Then it is possible to interact with api wrappers:

# Obtain a project's information
project_info = zsquad.actions.project.get_project_info("<project_key>")

# Obtain a project's versions/releases
project_versions = zsquad.api.util_resource.get_all_versions("<project_id>")

# Get a single test case by its id
test_case = zsquad.actions.test_cases.get_test_case("<case_key>", fields="id")

# Create a new test case for a project
data = {
    "fields": {
        "assignee": {
            "name": "<jira_username>"
        },
        "description": "<case_description>"
    }
}
creation_result = zsquad.actions.test_cases.create_test_case(projectId="<project_id>", summary="<case_summary>", data=data)

Troubleshooting

For troubleshooting see TROUBLESHOOTING.md

License

This library is licensed under the Apache 2.0 License.

Links

Zephyr Scale Cloud API docs

Zephyr Scale Server API docs

Zephyr Squad Cloud API docs

Zephyr Squad Server API docs

Zephyr Squad Server How to API docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zephyr_test_management-0.2.0.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zephyr_test_management-0.2.0-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file zephyr_test_management-0.2.0.tar.gz.

File metadata

  • Download URL: zephyr_test_management-0.2.0.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.18

File hashes

Hashes for zephyr_test_management-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2033ad91a0019873f49b01cef37e7d59a1b2e2efb39064cdff739a6150c64807
MD5 1706d79a08b9e1736649cbee6b09c628
BLAKE2b-256 faed6a61ac9f5d8cfc261c799de6a0716834cacbc2e0bef02f6a8942584bda0f

See more details on using hashes here.

File details

Details for the file zephyr_test_management-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zephyr_test_management-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7ce16c919c6450b07e50585c2b6399e0c9cbca0932413b2cf6df50c85cc1bd2
MD5 de35a9d71d75251e8e88358569881a46
BLAKE2b-256 a81dda4293acc458d05fd6b86d7f895e6980ae5cd5b50ab3a7fd5078c66b5f64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page