Skip to content

Commit 66f3ef7

Browse files
author
Luiko Czub
committed
getLastExecutionResult - new optional argument 'options' #27
1 parent bc9bcc2 commit 66f3ef7

7 files changed

+36
-7
lines changed

CHANGES.rst

+15-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,21 @@ Changes in TestLink-API-Python-client Source Distribution
33

44
TestLink-API-Python-client UNDER DEVELOP v0.5.1
55
-----------------------------------------------------------
6-
support for future TL 1.9.11 release
6+
support for future TL 1.9.11 release
7+
8+
implement 1.9.11 api changes - getLastExecutionResult #27
9+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
11+
TestlinkAPIGeneric and TestlinkAPIClient api method getLastExecutionResult()
12+
accepts now following additional optional arguments (usable with TL >= 1.9.10)
13+
14+
- options = {'getBugs' : True / False}
15+
16+
example:
17+
18+
>>> tls = testlink.TestLinkHelper().connect(testlink.TestlinkAPIClient)
19+
>>> tls.getLastExecutionResult(aTPlanID, aTCaseID, options={'getBugs' : True})
20+
[{ ... , 'tcversion_id': '8929', ... , 'bugs': [{'bug_id': '4711'}], ... }]
721

822
implement 1.9.11 new api method - assignTestCaseExecutionTask #26
923
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

example/TestLinkExample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@
616616
response = myTestLink.copyTCnewVersion(newTestCaseID_B,
617617
summary='new version of TC B', importance='1')
618618
print 'copyTCnewVersion', response
619-
print "copy TC B as TC BA into Test suite B"
619+
print "copy TC B as TC BA into Test suite A"
620620
response = myTestLink.copyTCnewTestCase(newTestCaseID_B,
621621
testsuiteid=newTestSuiteID_A, testcasename='%sA' % NEWTESTCASE_B)
622622
print 'copyTCnewTestCase', response

example/TestLinkExample_CF_KW.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,15 @@
164164
# new execution result with custom field data
165165
# TC_B passed, explicit build and some notes , TC identified with internal id
166166
newResult = myTestLink.reportTCResult(newTestCaseID_B, newTestPlanID_A,
167-
newBuildName_A, 'p', "custom try", platformname=NEWPLATFORM_B,
167+
newBuildName_A, 'p', "bugid 4711 is assigned",
168+
platformname=NEWPLATFORM_B, bugid='4711',
168169
customfields={'cf_tc_ex_string' : 'a custom exec value set via api',
169170
'cf_tc_sd_listen' : 'ernie'})
170171
print "reportTCResult", newResult
171172

172173
# get execution results
173-
lastResult = myTestLink.getLastExecutionResult(newTestPlanID_A, newTestCaseID_B)[0]
174+
lastResult = myTestLink.getLastExecutionResult(newTestPlanID_A, newTestCaseID_B,
175+
options={'getBugs' : True})[0]
174176
print "getLastExecutionResult", lastResult
175177

176178
# map of used ids

src/testlink/testlinkapigeneric.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,19 @@ def getLatestBuildForTestPlan(self):
100100
@decoMakerApiCallWithArgs(['testplanid'],
101101
['testcaseid', 'testcaseexternalid',
102102
'platformid', 'platformname',
103-
'buildid', 'buildname'])
103+
'buildid', 'buildname', 'options'])
104104
def getLastExecutionResult(self):
105105
""" Gets the result of LAST EXECUTION for a particular testcase on a test plan.
106106
If there are no filter criteria regarding platform and build,
107107
result will be get WITHOUT checking for a particular platform and build.
108108
109-
following optional arguments could only be used with TL version >= 1.9.9
109+
following optional arguments could only used with
110+
TL version >= 1.9.9
110111
- platformid, platformname, buildid, buildname
112+
113+
TL version >= 1.9.11
114+
- options : dictionary with key value pair
115+
'getBugs' : True / False
111116
"""
112117

113118
@decoApiCallWithoutArgs

src/testlink/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
# ------------------------------------------------------------------------
1919

2020
VERSION = '0.5.1-dev25'
21-
TL_RELEASE = 'DEV 1.9.11'
21+
TL_RELEASE = 'DEV 1.9.11 (gitorious ef1ca8b)'
2222

test/utest-offline/testlinkapi_offline_test.py

+4
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ def test_listKeywordsForTS_Multi(self):
566566
self.assertEqual({'8144' : ['KeyWord01', 'KeyWord03'],
567567
'8159' : ['KeyWord02'], '8169' : []}, response)
568568

569+
def test_whatArgs_getLastExecutionResult(self):
570+
argsDescription = self.api.whatArgs('getLastExecutionResult')
571+
self.assertIn('options=<options>', argsDescription)
572+
self.assertIn('getBugs', argsDescription)
569573

570574

571575
if __name__ == "__main__":

test/utest-offline/testlinkapigeneric_offline_test.py

+4
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,10 @@ def test_whatArgs_reportTCResult(self):
646646
argsDescription = self.api.whatArgs('reportTCResult')
647647
self.assertIn('user=<user>', argsDescription)
648648

649+
def test_whatArgs_getLastExecutionResult(self):
650+
argsDescription = self.api.whatArgs('getLastExecutionResult')
651+
self.assertIn('options=<options>', argsDescription)
652+
self.assertIn('getBugs', argsDescription)
649653

650654

651655
if __name__ == "__main__":

0 commit comments

Comments
 (0)