Skip to content

Commit b8f4a66

Browse files
author
Luiko Czub
committed
examples added for new api method assignTestCaseExecutionTask #26
1 parent 47b4748 commit b8f4a66

File tree

5 files changed

+53
-10
lines changed

5 files changed

+53
-10
lines changed

CHANGES.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ implement 1.9.11 new api method - assignTestCaseExecutionTask #26
1010

1111
new TestlinkAPIGeneric and TestlinkAPIClient api method
1212

13-
- assignTestCaseExecutionTask
13+
- assignTestCaseExecutionTask(<user>, <testplanid>, <testcaseexternalid>,
14+
[buildid=<buildid>], [buildname=<buildname>], [platformid=<platformid>],
15+
[platformname=<platformname>], [devKey=<devKey>])
1416

15-
known TL Dev 1.9.11 problems
17+
known TL DEV1.9.11 problems
1618

17-
- [TestLink 0006433](http://mantis.testlink.org/view.php?id=6433):
19+
- `TestLink 0006433 <http://mantis.testlink.org/view.php?id=6433>`_:
1820
Add test case to test plan with assigning user raise PHP Fatal error
19-
- [TestLink 0006434](http://mantis.testlink.org/view.php?id=6434):
20-
assignTestCaseExecutionTask does not work for test plans, which has no platforms
21-
- [TestLink 0006440](http://mantis.testlink.org/view.php?id=6440):
21+
- `TestLink 0006440 <http://mantis.testlink.org/view.php?id=6440>`_:
2222
assignTestCaseExecutionTask does not assign user
2323

2424

example/TestLinkExample.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111

112112
# CHANGE this name into a valid account, known in your TL application
113113
myTestUserName="admin"
114+
myTestUserName2="admin"
114115
# get user information
115116
response = myTestLink.getUserByLogin(myTestUserName)
116117
print "getUserByLogin", response
@@ -120,7 +121,7 @@
120121

121122

122123
# example asking the api client about methods arguments
123-
print myTestLink.whatArgs('createTestCase')
124+
print myTestLink.whatArgs('assignTestCaseExecutionTask')
124125

125126

126127
# -- Start CHANGE v0.4.5 --
@@ -413,6 +414,20 @@
413414
print "createBuild", newBuild
414415
newBuildID_A = newBuild[0]['id']
415416
print "New Build '%s' - id: %s" % (NEWBUILD_A, newBuildID_A)
417+
418+
# assign user to test case execution tasks - test plan with platforms
419+
response = myTestLink.assignTestCaseExecutionTask( myTestUserName,
420+
newTestPlanID_A, tc_aa_full_ext_id,
421+
buildid=newBuildID_A, platformname=NEWPLATFORM_A)
422+
print "assignTestCaseExecutionTask", response
423+
response = myTestLink.assignTestCaseExecutionTask( myTestUserName2,
424+
newTestPlanID_A, tc_aa_full_ext_id,
425+
buildname=NEWBUILD_A, platformid=newPlatFormID_B)
426+
print "assignTestCaseExecutionTask", response
427+
response = myTestLink.assignTestCaseExecutionTask( myTestUserName,
428+
newTestPlanID_A, tc_b_full_ext_id,
429+
buildname=NEWBUILD_A, platformname=NEWPLATFORM_B)
430+
print "assignTestCaseExecutionTask", response
416431

417432
# report Test Case Results for platform 'Big Bird'
418433
# TC_AA failed, build should be guessed, TC identified with external id
@@ -456,6 +471,12 @@
456471
newBuildID_B = newBuild[0]['id']
457472
print "New Build '%s' - id: %s" % (NEWBUILD_B, newBuildID_B)
458473

474+
# assign user to test case execution tasks - test plans without platforms
475+
response = myTestLink.assignTestCaseExecutionTask( myTestUserName,
476+
newTestPlanID_B, tc_b_full_ext_id, buildname=NEWBUILD_B)
477+
print "assignTestCaseExecutionTask", response
478+
479+
459480
# TC_B blocked (without platform), explicit build and some notes ,
460481
# TC identified with internal id, report by myTestUserName
461482
newResult = myTestLink.reportTCResult(newTestCaseID_B, newTestPlanID_B, NEWBUILD_B,

example/TestLinkExampleGenericApi.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100

101101
# CHANGE this name into a valid account, known in your TL application
102102
myTestUserName="admin"
103+
myTestUserName2="admin"
103104
# get user information
104105
response = myTestLink.getUserByLogin(myTestUserName)
105106
print "getUserByLogin", response
@@ -338,6 +339,20 @@
338339
newBuildID_A = newBuild[0]['id']
339340
print "New Build '%s' - id: %s" % (NEWBUILD_A, newBuildID_A)
340341

342+
# assign user to test case execution tasks - test plan with platforms
343+
response = myTestLink.assignTestCaseExecutionTask( myTestUserName,
344+
newTestPlanID_A, tc_aa_full_ext_id,
345+
buildid=newBuildID_A, platformname=NEWPLATFORM_A)
346+
print "assignTestCaseExecutionTask", response
347+
response = myTestLink.assignTestCaseExecutionTask( myTestUserName2,
348+
newTestPlanID_A, tc_aa_full_ext_id,
349+
buildname=NEWBUILD_A, platformid=newPlatFormID_B)
350+
print "assignTestCaseExecutionTask", response
351+
response = myTestLink.assignTestCaseExecutionTask( myTestUserName,
352+
newTestPlanID_A, tc_b_full_ext_id,
353+
buildname=NEWBUILD_A, platformname=NEWPLATFORM_B)
354+
print "assignTestCaseExecutionTask", response
355+
341356
# report Test Case Results for platform 'Big Bird'
342357
# TC_AA failed, build should be guessed, TC identified with external id
343358
newResult = myTestLink.reportTCResult(newTestPlanID_A, 'f', guess=True,
@@ -380,7 +395,12 @@
380395
print "createBuild", newBuild
381396
newBuildID_B = newBuild[0]['id']
382397
print "New Build '%s' - id: %s" % (NEWBUILD_B, newBuildID_B)
383-
398+
399+
# assign user to test case execution tasks - test plans without platforms
400+
response = myTestLink.assignTestCaseExecutionTask( myTestUserName,
401+
newTestPlanID_B, tc_b_full_ext_id, buildname=NEWBUILD_B)
402+
print "assignTestCaseExecutionTask", response
403+
384404
# TC_B in test plan b (without platform)
385405
# first try failed, second blocked - all by user myTestUserName
386406
newResult = myTestLink.reportTCResult(newTestPlanID_B, 'f',

src/testlink/testlinkapigeneric.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,10 @@ def assignTestCaseExecutionTask(self):
10431043
user login name => tester
10441044
testcaseexternalid format PREFIX-NUMBER
10451045
1046-
args variations: buildid - buildname
1046+
args variations: buildid - buildname
10471047
platformid - platformname
1048+
build information is general mandatory
1049+
platform information is required, when test plan has assigned platforms
10481050
"""
10491051

10501052
#

src/testlink/version.py

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

20-
VERSION = '0.5.1-dev-26'
20+
VERSION = '0.5.1-Alpha'

0 commit comments

Comments
 (0)