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.1.tar.gz (31.8 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.1-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zephyr_test_management-0.2.1.tar.gz
  • Upload date:
  • Size: 31.8 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.1.tar.gz
Algorithm Hash digest
SHA256 6f346d883a0d6cc7d429e1e0555a26717f911da6360f4800b1616e19a8729151
MD5 4564a9d2e8cd90c2c54dc6c34ad8821d
BLAKE2b-256 d8cb7b4c98aba51b4717d2d1122d77f41c2ce5a63c845db38e30602b73a93c33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zephyr_test_management-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 25750c9f23ca22dcc90322fde11e80c70cbb3f1118388886e0a7c5338d2ec8d6
MD5 c08455263337d08cab7dd9f3b8b43d95
BLAKE2b-256 f8ec88c4a680767ebda6c5d7a3ef59195b64608b6b888cc860fbb5fc36242847

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