Skip to content

Commit 3c7b1a8

Browse files
author
Luiko Czub
committed
server call methods shifted to generic API lczub#7
getLastExecutionResult, getTestCaseCustomFieldDesignValue, getTestCaseAttachments - version changed to v0.4.5-beta - now, all v0.4.0 API methods from TestlinkAPIClient are shifted to TestlinkAPIGeneric
1 parent ac6ccf5 commit 3c7b1a8

7 files changed

Lines changed: 163 additions & 321 deletions

File tree

‎example/TestLinkExample.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,32 @@
364364
tcpathname = '::'.join([NEWPROJECT, NEWTESTSUITE_A, NEWTESTSUITE_AA, NEWTESTCASE_AA])
365365
response = myTestLink.getTestCaseIDByName('unknown', testcasepathname=tcpathname)
366366
print "getTestCaseIDByName", response
367+
# get execution result
368+
response = myTestLink.getLastExecutionResult(newTestPlanID, None,
369+
testcaseexternalid=tc_aa_full_ext_id)
370+
print "getLastExecutionResult", response
371+
response = myTestLink.getLastExecutionResult(newTestPlanID, newTestCaseID_B)
372+
print "getLastExecutionResult", response
373+
367374

368375
# get information - general
369376
response = myTestLink.getFullPath(int(newTestSuiteID_AA))
370377
print "getFullPath", response
371378
response = myTestLink.getFullPath([int(newTestCaseID_AA), int(newTestCaseID_B)])
372379
print "getFullPath", response
373380

381+
# no test data
382+
# response = myTestLink.getTestCaseCustomFieldDesignValue(
383+
# tc_aa_full_ext_id, 1, newProjectID, 'cfieldname', 'simple')
384+
# print "getTestCaseCustomFieldDesignValue", response
385+
print "getTestCaseCustomFieldDesignValue", "Sorry currently no testdata"
386+
387+
# response = myTestLink.getTestCaseAttachments(None, testcaseexternalid=tc_aa_full_ext_id)
388+
# print "getTestCaseAttachments", response
389+
# response = myTestLink.getTestCaseAttachments(newTestCaseID_B)
390+
# print "getTestCaseAttachments", response
391+
print "getTestCaseAttachments", "Sorry currently no testdata"
392+
374393

375394
print ""
376395
print "Number of Projects in TestLink: %s " % (myTestLink.countProjects(),)

‎example/TestLinkExampleGenericApi.py‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,35 @@
281281
tcpathname = '::'.join([NEWPROJECT, NEWTESTSUITE_A, NEWTESTSUITE_AA, NEWTESTCASE_AA])
282282
response = myTestLink.getTestCaseIDByName('unknown', testcasepathname=tcpathname)
283283
print "getTestCaseIDByName", response
284+
# get execution result
285+
response = myTestLink.getLastExecutionResult(newTestPlanID,
286+
testcaseexternalid=tc_aa_full_ext_id)
287+
print "getLastExecutionResult", response
288+
response = myTestLink.getLastExecutionResult(newTestPlanID,
289+
testcaseid=newTestCaseID_B)
290+
print "getLastExecutionResult", response
291+
284292

285293
# get information - general
286294
response = myTestLink.getFullPath(int(newTestSuiteID_AA))
287295
print "getFullPath", response
288296
response = myTestLink.getFullPath([int(newTestCaseID_AA), int(newTestCaseID_B)])
289297
print "getFullPath", response
290298

299+
# no test data
300+
# response = myTestLink.getTestCaseCustomFieldDesignValue(
301+
# tc_aa_full_ext_id, 1, newProjectID, 'cfieldname', details='simple')
302+
# print "getTestCaseCustomFieldDesignValue", response
303+
print "getTestCaseCustomFieldDesignValue", "Sorry currently no testdata"
304+
305+
# response = myTestLink.getTestCaseAttachments(testcaseexternalid=tc_aa_full_ext_id)
306+
# print "getTestCaseAttachments", response
307+
# response = myTestLink.getTestCaseAttachments(testcaseid=newTestCaseID_B)
308+
# print "getTestCaseAttachments", response
309+
print "getTestCaseAttachments", "Sorry currently no testdata"
310+
311+
312+
291313
print ""
292314
print "Number of Projects in TestLink: %i " % len(myTestLink.getProjects())
293315
print ""

‎src/testlink/testlinkapi.py‎

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ def _changePositionalArgConfig(self):
7979
# getTestCasesForTestSuite
8080
pos_arg_config['getTestCasesForTestSuite'] = ['testsuiteid', 'deep',
8181
'details']
82+
# getLastExecutionResult
83+
pos_arg_config['getLastExecutionResult'] = ['testplanid', 'testcaseid']
84+
# getTestCaseCustomFieldDesignValue
85+
pos_arg_config['getTestCaseCustomFieldDesignValue'] = [
86+
'testcaseexternalid', 'version' , 'testprojectid',
87+
'customfieldname', 'details']
88+
# getTestCaseAttachments
89+
pos_arg_config['getTestCaseAttachments'] = ['testcaseid']
90+
8291

8392
#
8493
# BUILT-IN API CALLS - extented / customised against generic behaviour
@@ -150,15 +159,15 @@ def echo(self, message):
150159
# 'nodeid':str(nodeid)}
151160
# return self._callServer('getFullPath', argsAPI)
152161

153-
def getLastExecutionResult(self, testplanid, testcaseid):
154-
""" getLastExecutionResult :
155-
Gets the result of LAST EXECUTION for a particular testcase on a
156-
test plan, but WITHOUT checking for a particular build
157-
"""
158-
argsAPI = {'devKey' : self.devKey,
159-
'testplanid' : str(testplanid),
160-
'testcaseid' : str(testcaseid)}
161-
return self._callServer('getLastExecutionResult', argsAPI)
162+
# def getLastExecutionResult(self, testplanid, testcaseid):
163+
# """ getLastExecutionResult :
164+
# Gets the result of LAST EXECUTION for a particular testcase on a
165+
# test plan, but WITHOUT checking for a particular build
166+
# """
167+
# argsAPI = {'devKey' : self.devKey,
168+
# 'testplanid' : str(testplanid),
169+
# 'testcaseid' : str(testcaseid)}
170+
# return self._callServer('getLastExecutionResult', argsAPI)
162171

163172
# def getLatestBuildForTestPlan(self, testplanid):
164173
# """ getLastExecutionResult :
@@ -202,27 +211,27 @@ def getLastExecutionResult(self, testplanid, testcaseid):
202211
# 'testcaseid' : str(testcaseid)}
203212
# return self._callServer('getTestCase', argsAPI)
204213

205-
def getTestCaseAttachments(self, testcaseid):
206-
""" getTestCaseAttachments :
207-
Gets attachments for specified test case
208-
"""
209-
argsAPI = {'devKey' : self.devKey,
210-
'testcaseid':str(testcaseid)}
211-
212-
return self._callServer('getTestCaseAttachments', argsAPI)
214+
# def getTestCaseAttachments(self, testcaseid):
215+
# """ getTestCaseAttachments :
216+
# Gets attachments for specified test case
217+
# """
218+
# argsAPI = {'devKey' : self.devKey,
219+
# 'testcaseid':str(testcaseid)}
220+
#
221+
# return self._callServer('getTestCaseAttachments', argsAPI)
213222

214-
def getTestCaseCustomFieldDesignValue(self, testcaseexternalid, version,
215-
testprojectid, customfieldname, details):
216-
""" getTestCaseCustomFieldDesignValue :
217-
Gets value of a Custom Field with scope='design' for a given Test case
218-
"""
219-
argsAPI = {'devKey' : self.devKey,
220-
'testcaseexternalid' : str(testcaseexternalid),
221-
'version' : int(version),
222-
'testprojectid' : str(testprojectid),
223-
'customfieldname' : str(customfieldname),
224-
'details' : str(details)}
225-
return self._callServer('getTestCaseCustomFieldDesignValue', argsAPI)
223+
# def getTestCaseCustomFieldDesignValue(self, testcaseexternalid, version,
224+
# testprojectid, customfieldname, details):
225+
# """ getTestCaseCustomFieldDesignValue :
226+
# Gets value of a Custom Field with scope='design' for a given Test case
227+
# """
228+
# argsAPI = {'devKey' : self.devKey,
229+
# 'testcaseexternalid' : str(testcaseexternalid),
230+
# 'version' : int(version),
231+
# 'testprojectid' : str(testprojectid),
232+
# 'customfieldname' : str(customfieldname),
233+
# 'details' : str(details)}
234+
# return self._callServer('getTestCaseCustomFieldDesignValue', argsAPI)
226235

227236
# def getTestCaseIDByName(self, testCaseName, testSuiteName=None, testProjectName=None):
228237
# """

0 commit comments

Comments
 (0)