Skip to main content

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

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.

Metadata

Release files for qase-tavern 4.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qase-tavern 4.0.1
File Size Uploaded
qase_tavern-4.0.1.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qase-tavern 4.0.1
File Interpreter ABI Platform
qase_tavern-4.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.8 kB

Release files / qase_tavern-4.0.1.tar.gz

Download URL qase_tavern-4.0.1.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c5883dac4651b120b00d9fc8de40f080626487845e3bf966a23d581ea7c11517
BLAKE2b-256 checksum
How to use checksums
970ba28e7d2fc747f1ffebf01982fc3ace7000e8e4ecd98ac152c8a52a89452f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / qase_tavern-4.0.1-py3-none-any.whl

Download URL qase_tavern-4.0.1-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6277814f42b30e6070e86cfb2d7effd9baec10789245531e5d64dc11c90cf6fb
BLAKE2b-256 checksum
How to use checksums
f6de25691fcaf4b15148ef279545262aaeeba73bfc4de855affb64e629c27ebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

4.0.1 This release

2 release files

4.0.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page