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:

  • More usage examples
  • Tests, tests and tests for gods of testing
  • 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 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.1.1.tar.gz (29.1 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.1.1-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zephyr_test_management-0.1.1.tar.gz
  • Upload date:
  • Size: 29.1 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.1.1.tar.gz
Algorithm Hash digest
SHA256 9078d61e149fae6930d38cb5e9a8a872c683bf95770805e4267fedb4951b713e
MD5 14dafcca9f3ed0695b1f3cad384b0539
BLAKE2b-256 67e872b74e955b98fc16f73c8e1194225f704f991e5cd46a0419e0a45bd100fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zephyr_test_management-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53908504da3a67266190edab53efc36ddf94d7c612749a25f27ce1c1b63de12e
MD5 32083b087842eb0f7ba56fa09dcaf980
BLAKE2b-256 7ec365ccb5c597ff1a0b06674e49f1cf45896dc90081aef7a36743262d9c520d

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