Skip to content

Commit 6d9836e

Browse files
author
Luiko Czub
committed
api change - platform_id as new filter for getTestCasesForTestPlan
1 parent 5effe56 commit 6d9836e

File tree

6 files changed

+64
-27
lines changed

6 files changed

+64
-27
lines changed

CHANGES.rst

+17-23
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,39 @@ pull request `#36 <https://github.com/lczub/TestLink-API-Python-client/pull/36>`
1515
- Adds a new --proxy option in command line.
1616
- Recognizes "http_proxy" environment variable.
1717

18-
implement 1.9.13 new api - unassignTestCaseExecutionTask #32
18+
implement 1.9.13 new api methods #32 #41 #42 #44
1919
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020

21-
new TestlinkAPIGeneric and TestlinkAPIClient api method
21+
new TestlinkAPIGeneric and TestlinkAPIClient api methods
2222

2323
- unassignTestCaseExecutionTask(<testplanid>, <testcaseexternalid>,
2424
[buildid=<buildid>], [buildname=<buildname>], [platformid=<platformid>],
2525
[platformname=<platformname>], [user=<loginname>],
2626
[action='unassignAll'|'unassignOne'], [devKey=<devKey>])
2727
28-
examples see `<example/TestLinkExample.py>`_
29-
30-
implement 1.9.13 new api - getProjectKeywords #41
31-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32-
33-
new TestlinkAPIGeneric and TestlinkAPIClient api method
34-
35-
- getProjectKeywords(<testprojectid>)
36-
37-
examples see `<example/TestLinkExample_CF_KW.py>`_
38-
39-
implement 1.9.13 new api - getTestCaseKeywords #42
40-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41-
42-
new TestlinkAPIGeneric and TestlinkAPIClient api method
28+
- getProjectKeywords(<testprojectid>)
4329

4430
- getTestCaseKeywords([testcaseid=<testcaseid>],
4531
[testcaseexternalid=<testcaseexternalid>])
4632

47-
examples see `<example/TestLinkExample_CF_KW.py>`_
48-
49-
implement 1.9.13 new api - deleteTestPlan #44
33+
- deleteTestPlan(<testplanid>)
34+
35+
examples see `<example/TestLinkExample.py>`_ and `<example/TestLinkExample_CF_KW.py>`_
36+
37+
implement 1.9.13 api change - getTestCasesForTestPlan #41
5038
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5139

52-
new TestlinkAPIGeneric and TestlinkAPIClient api method
40+
TestlinkAPIGeneric and TestlinkAPIClient api method getTestCasesForTestPlan()
41+
accepts now the additional optional argument platformid=<platformid>
42+
43+
example:
5344

54-
- deleteTestPlan(<testplanid>)
45+
>>> tls = testlink.TestLinkHelper().connect(testlink.TestlinkAPIClient)
46+
>>> tls.getTestCasesForTestPlan(aTPlanID, platformid=aPlatFormID)
47+
{'12996': {'949': {'platform_name': 'Small Bird', ... }}
48+
49+
Also the optional argument buildid=<buildid> could now be used
5550

56-
examples see `<example/TestLinkExample.py>`_
5751

5852
TestLink-API-Python-client release notes v0.6.0 (Dec. 2014)
5953
------------------------------------------------------------

example/TestLinkExample.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,10 @@
652652
#response = myTestLink.getTestCasesForTestPlan(newTestPlanID_A, 'executestatus=f')
653653
response = myTestLink.getTestCasesForTestPlan(newTestPlanID_A, executestatus='f')
654654
# -- END CHANGE v0.4.5 --
655-
print("getTestCasesForTestPlan", response)
655+
print("getTestCasesForTestPlan A failed ", response)
656+
# get Testcases for Plattform SmallBird
657+
response = myTestLink.getTestCasesForTestPlan(newTestPlanID_A, platformid=newPlatFormID_B)
658+
print("getTestCasesForTestPlan A SmallBirds", response)
656659

657660
# get information - TestSuite
658661
response = myTestLink.getTestSuiteByID(newTestSuiteID_B)

example/TestLinkExampleGenericApi.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,10 @@
569569
print("getTestSuitesForTestPlan", response)
570570
# get failed Testcases
571571
response = myTestLink.getTestCasesForTestPlan(newTestPlanID_A, executestatus='f')
572-
print("getTestCasesForTestPlan", response)
572+
print("getTestCasesForTestPlan A failed ", response)
573+
# get Testcases for Plattform SmallBird
574+
response = myTestLink.getTestCasesForTestPlan(newTestPlanID_A, platformid=newPlatFormID_B)
575+
print("getTestCasesForTestPlan A SmallBirds", response)
573576

574577
# get information - TestSuite
575578
response = myTestLink.getTestSuiteByID(newTestSuiteID_B)

src/testlink/testlinkapigeneric.py

+33-1
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,49 @@ def reportTCResult(self):
285285
# This method is meant primarily for testing and debugging during development
286286
# """
287287

288+
# /**
289+
# * getTestCasesForTestPlan
290+
# * List test cases linked to a test plan
291+
# *
292+
# * @param struct $args
293+
# * @param string $args["devKey"]
294+
# * @param int $args["testplanid"]
295+
# * @param int $args["buildid"] - optional
296+
# * @param int $args["platformid"] - optional
297+
# * @param int $args["testcaseid"] - optional
298+
# * @param int $args["keywordid"] - optional mutual exclusive with $args["keywords"]
299+
# * @param int $args["keywords"] - optional mutual exclusive with $args["keywordid"]
300+
# *
301+
# * @param boolean $args["executed"] - optional
302+
# * @param int $args["$assignedto"] - optional
303+
# * @param string $args["executestatus"] - optional
304+
# * @param array $args["executiontype"] - optional
305+
# * @param array $args["getstepinfo"] - optional - default false
306+
# * @param string $args["details"] - optional
307+
# * 'full': (default) get summary,steps,expected_results,test suite name
308+
# * 'simple':
309+
# * 'details':
310+
# * @return mixed $resultInfo
311+
# *
312+
# * @internal revisions
313+
# * @since 1.9.13
314+
# * 20141230 - franciscom - TICKET 6805: platform parameter
315+
# */
316+
# public function getTestCasesForTestPlan($args)
288317

289318
@decoMakerApiCallReplaceTLResponseError()
290319
@decoApiCallAddDevKey
291320
@decoMakerApiCallWithArgs(['testplanid'],
292-
['testcaseid', 'keywordid', 'keywords', 'executed', 'assignedto',
321+
['buildid', 'platformid',
322+
'testcaseid', 'keywordid', 'keywords', 'executed', 'assignedto',
293323
'executestatus', 'executiontype', 'getstepinfo', 'details'])
294324
def getTestCasesForTestPlan(self):
295325
""" List test cases linked to a test plan
296326
297327
details - default is 'full',
298328
'simple', 'details' ??
329+
330+
args variations: keywordid - keywords
299331
300332
returns an empty list, if no build is assigned """
301333

src/testlink/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
#
1818
# ------------------------------------------------------------------------
1919

20-
VERSION = '0.6.1-dev44'
20+
VERSION = '0.6.1-dev43'
2121
TL_RELEASE = 'DEV 1.9.13 (gitorious 0be4cb9)'
2222

test/utest-offline/testlinkapigeneric_offline_test.py

+5
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,11 @@ def test_getProjectKeywords_twoKeywords(self):
738738
self.assertEqual('KeyWord01', response['25'])
739739
self.assertEqual('KeyWord02', response['26'])
740740

741+
def test_whatArgs_getTestCasesForTestPlan(self):
742+
argsDescription = self.api.whatArgs('getTestCasesForTestPlan')
743+
self.assertIn('buildid=<buildid>', argsDescription)
744+
self.assertIn('platformid=<platformid>', argsDescription)
745+
self.assertIn('keywordid - keywords', argsDescription)
741746

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

0 commit comments

Comments
 (0)