QualityForward provides a cloud service for test management. We also provide a web API, but running the web API directly is tedious. So we are developing a library for Python (unofficial).
goofmint / qualityforward-py: QualityForward Python library
This time, I will explain the code that aggregates the test results on a daily basis using the Python library.
Initialize as follows.
from qualityforward.QualityForward import QualityForward
q = QualityForward("0aa...340") #API key
In order to get the test results, you need to drill down from the test phase to get the data.
#Get test phase
for test_phase in q.get_test_phases():
#Get test suite assignments for each test phase
for test_suite_assignment in test_phase.test_suite_assignments:
#Get a test cycle
for test_cycle in test_suite_assignment.get_cycles():
#Get a test cycle
test_cycle.get_results()
Let's output this aggregation result as follows.
for date in results:
print(date)
for result in results[date]:
print(f' {result}: {results[date][result]}')
When executed, the output will be as follows.
$ python3 test.py
2019-08-16
pass: 2
fail: 1
2019-11-26
pass: 4
fail: 1
skip: 1
cut: 1
block: 1
qa: 1
2019-12-25
pass: 3
fail: 2
skip: 1
cut: 2
block: 1
na: 2
qa: 2
2019-07-08
pass: 38
fail: 3
block: 2
2019-07-09
pass: 7
2019-08-15
pass: 24
fail: 1
You can sort by day, or use the argument to display only data for a specific range of dates.
The QualityForward Python library makes it easy to use the QualityForward web API from Python. It can be used in various ways, such as processing data on the cloud, linking it with your own system, and sending an email. Please, try it.
goofmint / qualityforward-py: QualityForward Python library
Recommended Posts