Qase Tavern Plugin for Qase TestOps and Qase Report
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qase_tavern-3.1.0.tar.gz.
File metadata
- Download URL: qase_tavern-3.1.0.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f6ed3db3a2877e4e4a01078d7ceb79e668d26c35f17049b04c1d567601f1723
|
|
| MD5 |
71dff645cc48ae48439d9834d240e26f
|
|
| BLAKE2b-256 |
d178fc1ae125824e2ab073dc54f1f6e92e01cdcd94b92d17015ec578784e172d
|
File details
Details for the file qase_tavern-3.1.0-py3-none-any.whl.
File metadata
- Download URL: qase_tavern-3.1.0-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
271222cdb228346ec4533f738cde4d278aa68ba54bd65057029165e617ee384c
|
|
| MD5 |
3e0888465af19a85c32ccd1a0ace7819
|
|
| BLAKE2b-256 |
0308cea6f120bdef8ad2a3e354d04c9aec5d280c27195941e74affb45b39d31b
|