Skip to content

Commit bc0083b

Browse files
author
Luiko Czub
committed
changed api getTestCasesForTestPlan - optional arg customfields (TL 1.9.20) #122
1 parent e68e0ae commit bc0083b

File tree

6 files changed

+50
-16
lines changed

6 files changed

+50
-16
lines changed

CHANGES.rst

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,34 @@ Changes in TestLink-API-Python-client Source Distribution
33

44
TestLink-API-Python-client v0.8.1 - Under Develop
55
------------------------------------------------------------
6-
support for TL 1.9.19 and TL 1.9.20 (dev) api changes related to test case
7-
attachments, which will be stored since TL 1.9.19 with a reference to the
8-
test case version instead the test case id .
6+
main topic is to support TL 1.9.19 and TL 1.9.20 (dev) api changes related to
7+
test case attachments, which are stored since TL 1.9.19 with a reference to
8+
the test case version instead the test case id .
99

1010
Parameter <version> is now mandatory for _uploadTestCaseAttachment_ and optional
1111
for _getTestCaseAttachments_.
1212

13-
Cause of the known TL 1.9.19 issue
14-
`TL Mantis Ticket 8658 <http://mantis.testlink.org/view.php?id=8658>`_ it is
15-
recommended to use the TL 1.9.20 development state with github commit
16-
6a4984164 or later.
13+
implement other 1.9.20 (dev) changed api interfaces - #122
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
16+
changed TestlinkAPIGeneric and TestlinkAPIClient api methods
17+
18+
- getTestCasesForTestPlan() is adapted to support the new optional argument <customfields> .
19+
Sample see `<example/TestLinkExample_CF_KW.py>`_
20+
21+
known TL 1.9.19 issue:
22+
~~~~~~~~~~~~~~~~~~~~~~~
23+
API-XMLRPC - getTestCaseAttachments returns no attachment, uploaded with uploadTestCaseAttachment
24+
25+
- see TL Mantis Ticket 8658 <http://mantis.testlink.org/view.php?id=8658>`_
26+
- recommended to use the TL 1.9.20 development state with github commit
27+
6a4984164 or later (even for the TL upgrade or installation).
28+
29+
known TL 1.9.20 development state issues (github commit a1c7aca97):
30+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31+
Calling getTestCasesForTestPlan() with the new optional argument <customfields> returns only internal db values.
32+
As alternative, loop over all returned test cases and call getTestCaseCustomFieldDesignValue().
33+
Sample see `<example/TestLinkExample_CF_KW.py>`_
1734

1835
TestLink-API-Python-client v0.8.0 (May. 2018)
1936
---------------------------------------------

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ TestLink-API-Python-client developers
120120
.. _Maberi: https://github.com/Maberi/TestLink-API-Python-client.git
121121
.. _Brian-Williams: https://github.com/Brian-Williams/TestLink-API-Python-client
122122
.. _alexei-drozdov: https://github.com/alexei-drozdov/TestLink-API-Python-client
123-
.. _janLo :https://github.com/janLo/TestLink-API-Python-client.git
123+
.. _janLo: https://github.com/janLo/TestLink-API-Python-client.git

example/TestLinkExample_CF_KW.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
assigned
2626
2727
a) run example TestLinkExample.py
28-
- this creates a project like NEW_PROJECT_API-34
28+
- this creates a project like NEW_PROJECT_API-37
2929
b) load custom field definitions customFields_ExampleDefs.xml
3030
TL - Desktop - System - Define Custom Fields - Import
31-
c) assign custom fields to project NEW_PROJECT_API-34
31+
c) assign custom fields to project NEW_PROJECT_API-37
3232
TL - Desktop - Test Project - Assign Custom Fields
3333
d) load keyword definitions keywords_ExampleDefs.xml
3434
TL - Desktop - Test Project - Keyword Management
3535
3636
Script works with:
3737
38-
TestProject NEW_PROJECT_API-34
38+
TestProject NEW_PROJECT_API-37
3939
- TestSuite B - First Level
4040
- TestCase TESTCASE_B
4141
- TestPlan TestPlan_API A (Platform Small Bird)
@@ -282,6 +282,14 @@
282282
args['testplanid'], args['linkid'])
283283
print( "getTestCaseCustomFieldTestPlanDesignValue", response )
284284

285+
# get CustomFields Values from all test cases of a TestPlan
286+
response = myTestLink.getTestCasesForTestPlan(args['testplanid'],
287+
customfields=True)
288+
print("getTestCasesForTestPlan with all customfields", response)
289+
response = myTestLink.getTestCasesForTestPlan(args['testplanid'],
290+
customfields=['cf_tc_sd_string'])
291+
print("getTestCasesForTestPlan with specific customfields", response)
292+
285293
# update CustomField Value - TestSuite SpecDesign
286294
response = myTestLink.updateTestSuiteCustomFieldDesignValue(
287295
args['testprojectid'], args['testsuiteid'],

src/testlink/testlinkapigeneric.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,8 @@ def reportTCResult(self):
490490
# * 'full': (default) get summary,steps,expected_results,test suite name
491491
# * 'simple':
492492
# * 'details':
493+
# * @param array $args["customfields"]
494+
# * - optional can be a boolean or an array with the requested fields
493495
# * @return mixed $resultInfo
494496
# *
495497
# * @internal revisions
@@ -503,7 +505,8 @@ def reportTCResult(self):
503505
@decoMakerApiCallWithArgs(['testplanid'],
504506
['buildid', 'platformid',
505507
'testcaseid', 'keywordid', 'keywords', 'executed', 'assignedto',
506-
'executestatus', 'executiontype', 'getstepinfo', 'details'])
508+
'executestatus', 'executiontype', 'getstepinfo', 'details',
509+
'customfields'])
507510
def getTestCasesForTestPlan(self):
508511
""" List test cases linked to a test plan
509512

src/testlink/version.py

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

20-
VERSION = '0.8.1-dev119'
21-
TL_RELEASE = 'DEV 1.9.20 (github 6a4984164)'
20+
VERSION = '0.8.1-dev122'
21+
TL_RELEASE = 'DEV 1.9.20 (github a1c7aca97)'

test/utest-offline/test_apiClients_whatArgs.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,14 @@ def test_whatArgs_unknownMethods(api_client):
5353
'timestamp=<timestamp>', 'steps=<steps>',
5454
"[{'step_number' : 6,"]),
5555
('getLastExecutionResult', ['options=<options>','getBugs']),
56-
('getTestCasesForTestPlan', ['buildid=<buildid>', 'platformid=<platformid>',
57-
'keywordid - keywords']),
56+
('getTestCasesForTestPlan', ['<testplanid>,',
57+
'buildid=<buildid>', 'platformid=<platformid>',
58+
'testcaseid=<testcaseid>', 'keywordid=<keywordid>',
59+
'keywords=<keywords>', 'executed=<executed>',
60+
'assignedto=<assignedto>', 'executestatus=<executestatus>',
61+
'executiontype=<executiontype>', 'getstepinfo=<getstepinfo>',
62+
'details=<details>', 'customfields=<customfields>',
63+
'keywordid - keywords']),
5864
('createTestCase', ['<testcasename>,', '<testsuiteid>,', '<testprojectid>,',
5965
'<authorlogin>,', '<summary>,', #'<steps>,',
6066
'preconditions=<preconditions>',

0 commit comments

Comments
 (0)