Qase TestOps Tavern Reporter
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):
- CLI options (
--qase-*, highest priority) - Environment variables (
QASE_*) - 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.
Metadata
Release files for qase-tavern 4.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qase_tavern-4.0.0.tar.gz | 20.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qase_tavern-4.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.8 kB
Release files / qase_tavern-4.0.0.tar.gz
| Download URL | qase_tavern-4.0.0.tar.gz |
|---|---|
| Size | 20.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73af25f477defb8ddbaaa3d4cb203726d8b39d7d131b9fff9d28efe143f0cb7c
|
|
BLAKE2b-256 checksum How to use checksums |
3cc0578ddb10a183dbb672ca9b098c1ca4ebc308020acca313624c12044ea650
|
| 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.0-py3-none-any.whl
| Download URL | qase_tavern-4.0.0-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dbe70bcbec92689f6ca032331b2a5ae9adaa1f2e2cb528aad4dcf2bc2e3a8272
|
|
BLAKE2b-256 checksum How to use checksums |
50c64767789b8b3be83f01876b44168db7acc14d2c23ac5ec63562dd835e95d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|