pytest plugin to integrate tests with JIRA XRAY
Project description
pytest-jira-xray is a plugin for pytest that uploads test results to JIRA XRAY.
Installation
pip install pytest-jira-xray
or
python setup.py install
Usage
Mark a test with JIRA XRAY test ID
# -- FILE: test_example.py
import pytest
@pytest.mark.xray('JIRA-1')
def test_one():
assert True
Jira Xray configuration can be provided via Environment Variables:
Jira base URL:
$ export XRAY_API_BASE_URL=<Jira base URL>
Basic authentication:
$ export XRAY_API_USER=<jria username>
$ export XRAY_API_PASSWORD=<user password>
SSL Client Certificate
To disable SSL certificate verification, at the client side (no case-sensitive), default is True:
$ export XRAY_API_VERIFY_SSL=False
Or you can provide path to certificate file
$ export XRAY_API_VERIFY_SSL=</path/to/PEM file>
Cloud authentication:
$ export XRAY_CLIENT_ID=<client id>
$ export XRAY_CLIENT_SECRET=<client secret>
Test Execution parameters:
$ export XRAY_EXECUTION_TEST_ENVIRONMENTS="Env1 Env2 Env3"
$ export XRAY_EXECUTION_FIX_VERSION="1.0"
$ export XRAY_EXECUTION_REVISION=`git rev-parse HEAD`
$ export XRAY_EXECUTION_SUMMARY="Smoke tests" # New execution only
$ export XRAY_EXECUTION_DESC="This is an automated test execution of the smoke tests" # New execution only
Upload results
Upload results to new test execution:
$ pytest --jira-xray
Upload results to existing test execution:
$ pytest --jira-xray --execution TestExecutionId
Upload results to existing test plan (new test execution will be created):
$ pytest --jira-xray --testplan TestPlanId
Use with Jira cloud:
$ pytest --jira-xray --cloud
Store results in a file instead of exporting directly to a XRAY server
$ pytest --jira-xray --xraypath=xray.json
IntelliJ integration
When you want to synchronize your test results via. Pytest integration in IntelliJ, you need to configure the following:
Use the pytest test configuration template and add –jira-xray -o log_cli=true to Additional Arguments
Disable –no-summary in Settings
Troubleshooting
This section holds information about common issues.
The Test XXX is in a non-executable status
Problem: The test is not executable by the user.
Solution: Make sure, that your test is not deactivated, approved and ready to use in Jira.
Error message from server: fixVersions: fixVersions
Problem: The version is malformed or doesn’t exist.
Solution: Make sure the version exists and the name matches the existing version and that only one version is used.
References
XRay import execution endpoint: https://docs.getxray.app/display/XRAY/Import+Execution+Results
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 Distributions
Built Distribution
Hashes for pytest_jira_xray-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e215385a40e388fe15abe6798591c67fa6f3805cb6d4074b4b2236086933620 |
|
MD5 | 4c0bd2ed769af6ebbfe83415fd211169 |
|
BLAKE2b-256 | ad21613f11620f16284a327598f72f637beb269218b937b146e8acad65a8c0af |