Skip to content

Commit 77b6111

Browse files
author
Luiko Czub
committed
changed api - addTestCaseToTestPlan - paramter overwrite #72
1 parent 524334b commit 77b6111

File tree

6 files changed

+47
-5
lines changed

6 files changed

+47
-5
lines changed

CHANGES.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,22 @@ new TestlinkAPIGeneric and TestlinkAPIClient api methods
1515
[details=<details>], [order=<order>], [devKey=<devKey>])
1616
- getTestSuite(<testsuitename>, <prefix>, [devKey=<devKey>])
1717

18-
implement 1.9.15 changed api interfaces - #68 #70
18+
implement 1.9.15 changed api interfaces - #68 #70 #72
1919
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020

2121
changed TestlinkAPIGeneric and TestlinkAPIClient api methods
2222

2323
- reportTCResult() is adapted to support the new optional argument <steps>
2424
for setting test step results
2525
- createBuild() is adapted to support new optional arguments
26+
2627
- <active> : 1 (default) = activ 0 = inactiv
2728
- <open> : 1 (default) = open 1 = closed
2829
- <releasedate> : YYYY-MM-DD
2930
- <copytestersfrombuild> : valid buildid tester assignments will be copied.
31+
32+
- addTestCaseToTestPlan() is adapted to to support the new optional argument
33+
<overwrite> to update linked Test Case Versions
3034

3135
examples:
3236

@@ -40,6 +44,9 @@ examples:
4044
>>> tls.createBuild(aTPlanID, 'newBuildName', 'a build note',
4145
>>> active=1, open=1, releasedate='2016-11-30'
4246
>>> copytestersfrombuild=existingBuildID)
47+
>>> tls.addTestCaseToTestPlan(aTProjectID, aTPlanID, 'aTCaseFullExID',
48+
>>> aTCVersion, overwrite=1)
49+
4350

4451
known TL 1.9.15 issues:
4552
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

example/TestLinkExample.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,11 +674,13 @@
674674
response = myTestLink.getTestCaseAttachments(testcaseid=newTestCaseID_B)
675675
print("getTestCaseAttachments", response)
676676

677-
# copy test cases
677+
# copy test case - as a new TC version
678678
print("create new version of TC B")
679679
response = myTestLink.copyTCnewVersion(newTestCaseID_B,
680680
summary='new version of TC B', importance='1')
681681
print('copyTCnewVersion', response)
682+
683+
# copy test case - as new TC in a different TestSuite
682684
print("copy TC B as TC BA into Test suite A")
683685
response = myTestLink.copyTCnewTestCase(newTestCaseID_B,
684686
testsuiteid=newTestSuiteID_A, testcasename='%sA' % NEWTESTCASE_B)
@@ -688,6 +690,16 @@
688690
response = myTestLink.getTestCasesForTestSuite(newTestSuiteID_A, True, 'simple')
689691
print('getTestCasesForTestSuite A', response)
690692

693+
# sample, how the test plan can be updated to use the new tc version
694+
# site effect of this step, assigned testers and existing execution results are
695+
# not accessible anymore via the TL Web Gui.
696+
# That is the reason, why we have uncomment it for the normal sample execution
697+
# response = myTestLink.addTestCaseToTestPlan(newProjectID, newTestPlanID_B,
698+
# tc_b_full_ext_id, tc_version+1,
699+
# overwrite=1)
700+
# print("addTestCaseToTestPlan overwrite", response)
701+
702+
691703
# no test data
692704
# response = myTestLink.getTestCaseCustomFieldDesignValue(
693705
# tc_aa_full_ext_id, 1, newProjectID, 'cfieldname', 'simple')

src/testlink/testlinkapigeneric.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def createBuild(self):
175175
""" Creates a new build for a specific test plan
176176
177177
active : 1 (default) = activ 0 = inactiv
178-
open : 1 (default) = open 1 = closed
178+
open : 1 (default) = open 0 = closed
179179
releasedate : YYYY-MM-DD
180180
copytestersfrombuild : valid buildid tester assignments will be copied.
181181
"""
@@ -465,14 +465,15 @@ def getTestCaseCustomFieldDesignValue(self):
465465
# * @param args['platformid'] - OPTIONAL Only if test plan has no platforms
466466
# * @param args['executionorder'] - OPTIONAL
467467
# * @param args['urgency'] - OPTIONAL
468+
# * @param args['overwrite'] - OPTIONAL
468469
# *
469470
# */
470471
# public function addTestCaseToTestPlan($args)
471472

472473
@decoApiCallAddDevKey
473474
@decoMakerApiCallWithArgs(['testprojectid',
474475
'testplanid', 'testcaseexternalid', 'version'],
475-
['platformid', 'executionorder', 'urgency'])
476+
['platformid', 'executionorder', 'urgency', 'overwrite'])
476477
def addTestCaseToTestPlan(self):
477478
""" Add a test case version to a test plan """
478479

src/testlink/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
#
1818
# ------------------------------------------------------------------------
1919

20-
VERSION = '0.6.3-dev070'
20+
VERSION = '0.6.3-dev072'
2121
TL_RELEASE = '1.9.15'
2222

test/utest-offline/testlinkapi_offline_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,17 @@ def test_whatArgs_createBuild(self):
693693
self.assertIn('releasedate=<releasedate>', argsDescription)
694694
self.assertIn('copytestersfrombuild=<copytestersfrombuild>', argsDescription)
695695

696+
def test_whatArgs_addTestCaseToTestPlan(self):
697+
argsDescription = self.api.whatArgs('addTestCaseToTestPlan')
698+
self.assertIn('<testprojectid>,', argsDescription)
699+
self.assertIn('<testplanid>,', argsDescription)
700+
self.assertIn('<testcaseexternalid>,', argsDescription)
701+
self.assertIn('<version>,', argsDescription)
702+
self.assertIn('platformid=<platformid>', argsDescription)
703+
self.assertIn('executionorder=<executionorder>', argsDescription)
704+
self.assertIn('urgency=<urgency>', argsDescription)
705+
self.assertIn('overwrite=<overwrite>', argsDescription)
706+
696707
if __name__ == "__main__":
697708
#import sys;sys.argv = ['', 'Test.testName']
698709
unittest.main()

test/utest-offline/testlinkapigeneric_offline_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,17 @@ def test_whatArgs_createBuild(self):
801801
self.assertIn('open=<open>', argsDescription)
802802
self.assertIn('releasedate=<releasedate>', argsDescription)
803803
self.assertIn('copytestersfrombuild=<copytestersfrombuild>', argsDescription)
804+
805+
def test_whatArgs_addTestCaseToTestPlan(self):
806+
argsDescription = self.api.whatArgs('addTestCaseToTestPlan')
807+
self.assertIn('<testprojectid>,', argsDescription)
808+
self.assertIn('<testplanid>,', argsDescription)
809+
self.assertIn('<testcaseexternalid>,', argsDescription)
810+
self.assertIn('<version>,', argsDescription)
811+
self.assertIn('platformid=<platformid>', argsDescription)
812+
self.assertIn('executionorder=<executionorder>', argsDescription)
813+
self.assertIn('urgency=<urgency>', argsDescription)
814+
self.assertIn('overwrite=<overwrite>', argsDescription)
804815

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

0 commit comments

Comments
 (0)