Skip to content

Commit 2187b6e

Browse files
author
Luiko Czub
committed
new api - getExecutionSet #76
1 parent 7657a9d commit 2187b6e

File tree

7 files changed

+113
-14
lines changed

7 files changed

+113
-14
lines changed

CHANGES.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
Changes in TestLink-API-Python-client Source Distribution
22
=========================================================
33

4+
TestLink-API-Python-client v0.6.5 (under develop)
5+
-------------------------------------------------
6+
support for TL 1.9.17 future release and py27, py34, py35 and py36
7+
8+
implement 1.9.17 new api interfaces - #76
9+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
11+
- getExecutionSet(<testplanid>, [testcaseid=<testcaseid>], [testcaseexternalid=<testcaseexternalid>],
12+
[buildid=<buildid>], [buildname=<buildname>], [platformid=<platformid>],
13+
[platformname=<platformname>], [options=<options>], [devKey=<devKey>])
14+
15+
known TL 1.9.17-DEV issues:
16+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
17+
18+
API-XMLRPC - getExecutionSet raise database error
19+
20+
- see `TL Mantis Ticket 7900 <http://mantis.testlink.org/view.php?id=7900>`_
21+
422
TestLink-API-Python-client release notes v0.6.4 (Mar. 2017)
523
-----------------------------------------------------------
624
support for TL 1.9.16 release and py27, py34, py35 and py36

example/TestLinkExample.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -646,14 +646,20 @@
646646
response = myTestLink.getLastExecutionResult(newTestPlanID_A, None,
647647
testcaseexternalid=tc_aa_full_ext_id)
648648
print("getLastExecutionResult", response)
649+
response = myTestLink.getExecutionSet(newTestPlanID_A,
650+
testcaseexternalid=tc_aa_full_ext_id)
651+
print("getExecutionSet", response)
649652
response = myTestLink.getLastExecutionResult(newTestPlanID_A, newTestCaseID_B)
650653
print("getLastExecutionResult", response)
651-
if not myTLVersion == '<= 1.9.8':
652-
# new optional arguments platformid , buildid with TL 1.9.9
653-
response = myTestLink.getLastExecutionResult(
654-
newTestPlanID_A, newTestCaseID_AA,
655-
platformid=newPlatFormID_A)
656-
print("getLastExecutionResult", response)
654+
response = myTestLink.getExecutionSet(newTestPlanID_A,
655+
testcaseid=newTestCaseID_B)
656+
print("getExecutionSet", response)
657+
response = myTestLink.getLastExecutionResult(newTestPlanID_A, newTestCaseID_AA,
658+
platformid=newPlatFormID_A)
659+
print("getLastExecutionResult", response)
660+
response = myTestLink.getExecutionSet(newTestPlanID_A,
661+
testcaseid=newTestCaseID_AA, platformid=newPlatFormID_A)
662+
print("getExecutionSet", response)
657663

658664
response = myTestLink.getExecCountersByBuild(newTestPlanID_A)
659665
print("getExecCountersByBuild", response)

example/TestLinkExampleGenericApi.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,15 +651,21 @@
651651
response = myTestLink.getLastExecutionResult(newTestPlanID_A,
652652
testcaseexternalid=tc_aa_full_ext_id)
653653
print("getLastExecutionResult", response)
654+
response = myTestLink.getExecutionSet(newTestPlanID_A,
655+
testcaseexternalid=tc_aa_full_ext_id)
656+
print("getExecutionSet", response)
654657
response = myTestLink.getLastExecutionResult(newTestPlanID_A,
655658
testcaseid=newTestCaseID_B)
656659
print("getLastExecutionResult", response)
657-
if not myTLVersion == '<= 1.9.8':
658-
# new optional arguments platformid , buildid with TL 1.9.9
659-
response = myTestLink.getLastExecutionResult(
660-
newTestPlanID_A, testcaseid=newTestCaseID_AA,
661-
platformid=newPlatFormID_A)
662-
print("getLastExecutionResult", response)
660+
response = myTestLink.getExecutionSet(newTestPlanID_A,
661+
testcaseid=newTestCaseID_B)
662+
print("getExecutionSet", response)
663+
response = myTestLink.getLastExecutionResult(newTestPlanID_A,
664+
testcaseid=newTestCaseID_AA, platformid=newPlatFormID_A)
665+
print("getLastExecutionResult", response)
666+
response = myTestLink.getExecutionSet(newTestPlanID_A,
667+
testcaseid=newTestCaseID_AA, platformid=newPlatFormID_A)
668+
print("getExecutionSet", response)
663669

664670
response = myTestLink.getExecCountersByBuild(newTestPlanID_A)
665671
print("getExecCountersByBuild", response)

src/testlink/testlinkapigeneric.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,6 +1751,66 @@ def updateBuildCustomFieldsValues(self):
17511751
customfields : dictionary with customfields names + values
17521752
VERY IMPORTANT: value must be formatted in the way it's written to db
17531753
"""
1754+
1755+
# /**
1756+
# * Gets a set of EXECUTIONS for a particular testcase on a test plan.
1757+
# * If there are no filter criteria regarding platform and build,
1758+
# * result will be get WITHOUT checking for a particular platform and build.
1759+
# *
1760+
# * @param struct $args
1761+
# * @param string $args["devKey"]
1762+
# * @param int $args["tplanid"]
1763+
# * @param int $args["testcaseid"]: Pseudo optional.
1764+
# * if is not present then testcaseexternalid MUST BE present
1765+
# *
1766+
# * @param int $args["testcaseexternalid"]: Pseudo optional.
1767+
# * if is not present then testcaseid MUST BE present
1768+
# *
1769+
# * @param string $args["platformid"]: optional.
1770+
# * ONLY if not present, then $args["platformname"]
1771+
# * will be analized (if exists)
1772+
# *
1773+
# * @param string $args["platformname"]: optional (see $args["platformid"])
1774+
# * @param int $args["buildid"]: optional
1775+
# * ONLY if not present, $args["buildname"] will be analized (if exists)
1776+
# *
1777+
# * @param int $args["buildname"] - optional (see $args["buildid"])
1778+
# * @param int $args["options"] - optional
1779+
# * options['getOrderDescending']
1780+
# * false(=ascending,default)
1781+
# * @return mixed $resultInfo
1782+
# * if execution found
1783+
# * array that contains a map with these keys:
1784+
# * id (execution id),build_id,tester_id,execution_ts,
1785+
# * status,testplan_id,tcversion_id,tcversion_number,
1786+
# * execution_type,notes.
1787+
# *
1788+
# * if test case has not been executed,
1789+
# * array('id' => -1)
1790+
# * @access public
1791+
# */
1792+
# public function getExecutionSet($args)
1793+
1794+
@decoApiCallAddDevKey
1795+
@decoMakerApiCallWithArgs(['testplanid'],
1796+
['testcaseid', 'testcaseexternalid',
1797+
'buildid', 'buildname', 'platformid', 'platformname',
1798+
'options'])
1799+
def getExecutionSet(self):
1800+
""" Gets a set of EXECUTIONS for a particular testcase on a test plan.
1801+
If there are no filter criteria regarding platform and build, result
1802+
will be get WITHOUT checking for a particular platform and build.
1803+
1804+
testplanid test plan id
1805+
1806+
args variations: testcaseid - testcaseexternalid
1807+
buildid - buildname
1808+
platformid - platformname
1809+
testcase information is general mandatory
1810+
1811+
options : dictionary with key 'getOrderDescending' and
1812+
values 0 (false = default) or 1 (true)
1813+
"""
17541814

17551815
#
17561816
# internal methods for general server calls

src/testlink/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
#
1818
# ------------------------------------------------------------------------
1919

20-
VERSION = '0.6.4'
21-
TL_RELEASE = '1.9.16'
20+
VERSION = '0.6.5-dev076'
21+
TL_RELEASE = 'DEV 1.9.17 (github 1ee5f78)'
2222

test/utest-online/testlinkapi_generic_online_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,11 @@ def test_updateBuildCustomFieldsValues_unknownID(self):
468468
'40000712 project', '40000713 plan', '40000714 build',
469469
{'cf_b_ex_string' : 'a custom exec value',
470470
'cf_b_ex_numeric' : 111} )
471+
472+
def test_getExecutionSet_unknownID(self):
473+
with self.assertRaisesRegex(TLResponseError, '3000.*40000713'):
474+
self.client.getExecutionSet(
475+
'40000713 plan', testcaseexternalid = 'TC-40000712')
471476

472477

473478
if __name__ == "__main__":

test/utest-online/testlinkapi_online_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,10 @@ def test_updateBuildCustomFieldsValues_unknownID(self):
455455
{'cf_b_ex_string' : 'a custom exec value',
456456
'cf_b_ex_numeric' : 111} )
457457

458+
def test_getExecutionSet_unknownID(self):
459+
with self.assertRaisesRegex(TLResponseError, '3000.*40000713'):
460+
self.client.getExecutionSet(
461+
'40000713 plan', testcaseexternalid = 'TC-40000712')
458462

459463
if __name__ == "__main__":
460464
#import sys;sys.argv = ['', 'Test.testName']

0 commit comments

Comments
 (0)