Skip to main content

Qase Tavern Plugin for Qase TestOps and Qase Report

Project description

Qase TestOps Tavern Reporter

PyPI version PyPI downloads License

Qase Tavern Reporter enables seamless integration between your Tavern API tests and Qase TestOps, providing automatic test result reporting, test case management, and comprehensive test analytics.

Features

  • Link automated tests to Qase test cases by ID
  • Auto-create test cases from your test files
  • Report test results with test stages as steps
  • Multi-project reporting support
  • Flexible configuration (file, environment variables, CLI)

Installation

pip install qase-tavern

Quick Start

1. Create qase.config.json in your project root:

{
  "mode": "testops",
  "testops": {
    "project": "YOUR_PROJECT_CODE",
    "api": {
      "token": "YOUR_API_TOKEN"
    }
  }
}

2. Add Qase ID to your test:

---
test_name: QaseID=1 Get user by ID

stages:
  - name: Get user
    request:
      url: https://api.example.com/users/1
      method: GET
    response:
      status_code: 200

3. Run your tests:

pytest

Configuration

The reporter is configured via (in order of priority):

  1. CLI options (--qase-*, highest priority)
  2. Environment variables (QASE_*)
  3. Config file (qase.config.json)

Minimal Configuration

Option Environment Variable CLI Option Description
mode QASE_MODE --qase-mode Set to testops to enable reporting
testops.project QASE_TESTOPS_PROJECT --qase-testops-project Your Qase project code
testops.api.token QASE_TESTOPS_API_TOKEN --qase-testops-api-token Your Qase API token

Example qase.config.json

{
  "mode": "testops",
  "fallback": "report",
  "testops": {
    "project": "YOUR_PROJECT_CODE",
    "api": {
      "token": "YOUR_API_TOKEN"
    },
    "run": {
      "title": "Tavern API Tests"
    },
    "batch": {
      "size": 100
    }
  },
  "report": {
    "driver": "local",
    "connection": {
      "local": {
        "path": "./build/qase-report",
        "format": "json"
      }
    }
  }
}

Full configuration reference: See qase-python-commons for all available options including logging, status mapping, execution plans, and more.

Usage

Link Tests with Test Cases

Associate your tests with Qase test cases by adding QaseID={ID} to the test name:

---
test_name: QaseID=1 Get user profile

stages:
  - name: Get user profile
    request:
      url: https://api.example.com/profile
      method: GET
    response:
      status_code: 200
      json:
        id: 1
        name: "John Doe"

Multiple Qase IDs

Link one test to multiple test cases:

---
test_name: QaseID=1,2,3 User authentication flow

stages:
  - name: Login
    request:
      url: https://api.example.com/auth/login
      method: POST
      json:
        username: testuser
        password: testpass
    response:
      status_code: 200

Test Result Statuses

Tavern Result Qase Status
Passed passed
Failed (assertion) failed
Failed (other) invalid
Skipped skipped

Stages as Steps

Each Tavern stage is automatically reported as a test step in Qase:

---
test_name: QaseID=1 Complete order flow

stages:
  - name: Add item to cart          # Step 1
    request:
      url: https://api.example.com/cart
      method: POST
    response:
      status_code: 201

  - name: Proceed to checkout       # Step 2
    request:
      url: https://api.example.com/checkout
      method: POST
    response:
      status_code: 200

  - name: Complete payment          # Step 3
    request:
      url: https://api.example.com/payment
      method: POST
    response:
      status_code: 200

For detailed usage examples, see the Usage Guide.

Running Tests

Basic Execution

pytest

With CLI Options

pytest \
    --qase-mode=testops \
    --qase-testops-project=PROJ \
    --qase-testops-api-token=your_token

With Environment Variables

export QASE_MODE=testops
export QASE_TESTOPS_PROJECT=PROJ
export QASE_TESTOPS_API_TOKEN=your_token
pytest

Run Specific Test File

pytest test_api.tavern.yaml

Requirements

  • Python >= 3.9
  • tavern >= 2.11.0

Documentation

Guide Description
Usage Guide Complete usage reference with all options
Multi-Project Support Reporting to multiple Qase projects

Examples

See the examples directory for complete working examples.

License

Apache License 2.0. See LICENSE for details.

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

qase_tavern-3.1.1.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

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

qase_tavern-3.1.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file qase_tavern-3.1.1.tar.gz.

File metadata

  • Download URL: qase_tavern-3.1.1.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qase_tavern-3.1.1.tar.gz
Algorithm Hash digest
SHA256 124fd1d66af49aa69e26caa55567ffcf48f6ed2a9212210a19c4c25cb5cc92a0
MD5 c32b67055bda05c572c7889b168fb61b
BLAKE2b-256 a7054bfdb7dd2abd0e9288bbdedd76c85af664e6608c2eee3b976e718f0abf31

See more details on using hashes here.

File details

Details for the file qase_tavern-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: qase_tavern-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qase_tavern-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ef53b6534b565c8520f1fe9cdd7259d4cfa44f4c5e595fb621c00fb49da70ad
MD5 9d3cd9b62423d263c58971fac42d182a
BLAKE2b-256 ee815888f193654602e2f7ef074115414e12a1058be4f75ae2480517a24d4390

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