|
188 | 188 | {'step_number': '7', 'actions': 'action 7 createTestCaseSteps.create', 'execution_type': '2', 'active': '1', 'id': '8157', 'expected_results': 'create - cause step 7 not yet exist'},
|
189 | 189 | {'step_number': '8', 'actions': 'action 8 createTestCaseSteps.update', 'execution_type': '2', 'active': '1', 'id': '8158', 'expected_results': 'create - cause step 8 not yet exist'}],
|
190 | 190 | 'author_id': '1'},
|
191 |
| - {'node_order': '1', 'is_open': '1', |
| 191 | + {'node_order': '1', 'is_open': '1', |
192 | 192 | 'keywords': {'2': {'keyword_id': '2', 'notes': 'another key word', 'testcase_id': '8159', 'keyword': 'KeyWord02'}},
|
193 | 193 | 'id': '8159', 'node_type_id': '3', 'layout': '1', 'tc_external_id': '3', 'parent_id': '8134', 'version': '1',
|
194 | 194 | 'details': '<p>\n\tDetails of the Test Suite B</p>\n', 'estimated_exec_duration': '3.00', 'updater_id': '2', 'status': '1',
|
|
199 | 199 | 'steps': [{'step_number': '1', 'actions': '<p>\n\tStep action 1 -b2</p>\n', 'execution_type': '2', 'active': '1', 'id': '8161', 'expected_results': '<p>\n\tStep result 1 - b2</p>\n'},
|
200 | 200 | {'step_number': '2', 'actions': '<p>\n\tStep action 2 -b2</p>\n', 'execution_type': '2', 'active': '1', 'id': '8162', 'expected_results': '<p>\n\tStep result 2 - b2</p>\n'}],
|
201 | 201 | 'author_id': '2'},
|
202 |
| - {'node_order': '2', 'is_open': '1', |
| 202 | + {'node_order': '2', 'is_open': '1', |
203 | 203 | 'id': '8169', 'node_type_id': '3', 'layout': '1', 'tc_external_id': '4', 'parent_id': '8134', 'version': '1',
|
204 | 204 | 'details': '<p>\n\tDetails of the Test Suite B</p>\n', 'estimated_exec_duration': '3.00', 'updater_id': '2', 'status': '1',
|
205 | 205 | 'importance': '3', 'modification_ts': '2014-07-02 21:02:23', 'execution_type': '1',
|
|
209 | 209 | 'steps': [{'step_number': '1', 'actions': '<p>\n\tStep action 1 -b3</p>\n', 'execution_type': '2', 'active': '1', 'id': '8171', 'expected_results': '<p>\n\tStep result 1 - b3</p>\n'},
|
210 | 210 | {'step_number': '2', 'actions': '<p>\n\tStep action 2 -b3</p>\n', 'execution_type': '2', 'active': '1', 'id': '8172', 'expected_results': '<p>\n\tStep result 2 - b3</p>\n'}],
|
211 | 211 | 'author_id': '2'}]
|
212 |
| - } |
| 212 | + }, |
| 213 | + 'getTestCase' : { |
| 214 | + '8144' : [{'full_tc_external_id': 'NPROAPI-2', 'id': '8145', 'tc_external_id': '2', 'version': '1', |
| 215 | + 'testsuite_id': 'deepFalse3', 'testcase_id': '8144', 'name': 'TESTCASE_B'}], |
| 216 | + 'NPROAPI-2' : [{'full_tc_external_id': 'NPROAPI-2', 'id': '8145', 'tc_external_id': '2', 'version': '1', |
| 217 | + 'testsuite_id': 'deepFalse3', 'testcase_id': '8144', 'name': 'TESTCASE_B'}], |
| 218 | + '8159' : [{'full_tc_external_id': 'NPROAPI-3', 'id': '8160', 'tc_external_id': '3', 'version': '1', |
| 219 | + 'testsuite_id': 'deepFalse3', 'testcase_id': '8159', 'name': 'TESTCASE_B2'}], |
| 220 | + 'NPROAPI-3' : [{'full_tc_external_id': 'NPROAPI-3', 'id': '8160', 'tc_external_id': '3', 'version': '1', |
| 221 | + 'testsuite_id': 'deepFalse3', 'testcase_id': '8159', 'name': 'TESTCASE_B2'}], |
| 222 | + '8169' : [{'full_tc_external_id': 'NPROAPI-4', 'id': '8170', 'tc_external_id': '3', 'version': '1', |
| 223 | + 'testsuite_id': 'deepFalse3', 'testcase_id': '8169', 'name': 'TESTCASE_B3'}], |
| 224 | + 'NPROAPI-4' : [{'full_tc_external_id': 'NPROAPI-4', 'id': '8170', 'tc_external_id': '3', 'version': '1', |
| 225 | + 'testsuite_id': 'deepFalse3', 'testcase_id': '8169', 'name': 'TESTCASE_B3'}] } |
213 | 226 | }
|
214 | 227 |
|
215 | 228 |
|
@@ -245,7 +258,14 @@ def _callServer(self, methodAPI, argsAPI=None):
|
245 | 258 | elif methodAPI in ['getTestCaseIDByName']:
|
246 | 259 | response = data[argsAPI['testcasename']]
|
247 | 260 | elif methodAPI in ['getTestCase']:
|
248 |
| - response = data['%(testcaseid)s-%(version)s' % argsAPI] |
| 261 | + datakey = argsAPI.get('testcaseid') |
| 262 | + if datakey: |
| 263 | + datakey = str(datakey) |
| 264 | + else: |
| 265 | + datakey = argsAPI.get('testcaseexternalid', '') |
| 266 | + if argsAPI.has_key('version'): |
| 267 | + datakey += '-%(version)s' % argsAPI |
| 268 | + response = data[datakey] |
249 | 269 | elif methodAPI in ['getFullPath']:
|
250 | 270 | response = data[argsAPI['nodeid']]
|
251 | 271 | elif methodAPI in ['getTestProjectByName']:
|
@@ -472,6 +492,33 @@ def test_whatArgs_getTestCasesForTestSuite(self):
|
472 | 492 | argsDescription = self.api.whatArgs('getTestCasesForTestSuite')
|
473 | 493 | self.assertIn('getkeywords=<getkeywords>', argsDescription)
|
474 | 494 |
|
| 495 | + def test_listKeywordsForTC_FullExternalId(self): |
| 496 | + self.api.loadScenario(SCENARIO_KEYWORDS) |
| 497 | + response = self.api.listKeywordsForTC('NPROAPI-2') |
| 498 | + self.assertEqual(['KeyWord01', 'KeyWord03'], response) |
| 499 | + |
| 500 | + def test_listKeywordsForTC_InternalId_Int(self): |
| 501 | + self.api.loadScenario(SCENARIO_KEYWORDS) |
| 502 | + response = self.api.listKeywordsForTC(8144) |
| 503 | + self.assertEqual(['KeyWord01', 'KeyWord03'], response) |
| 504 | + |
| 505 | + def test_listKeywordsForTC_InternalId_String(self): |
| 506 | + self.api.loadScenario(SCENARIO_KEYWORDS) |
| 507 | + response = self.api.listKeywordsForTC('8144') |
| 508 | + self.assertEqual(['KeyWord01', 'KeyWord03'], response) |
| 509 | + |
| 510 | + def test_listKeywordsForTC_One(self): |
| 511 | + self.api.loadScenario(SCENARIO_KEYWORDS) |
| 512 | + response = self.api.listKeywordsForTC('NPROAPI-3') |
| 513 | + self.assertEqual(['KeyWord02'], response) |
| 514 | + |
| 515 | + def test_listKeywordsForTC_None(self): |
| 516 | + self.api.loadScenario(SCENARIO_KEYWORDS) |
| 517 | + response = self.api.listKeywordsForTC('NPROAPI-4') |
| 518 | + self.assertEqual([], response) |
| 519 | + |
| 520 | + |
| 521 | + |
475 | 522 |
|
476 | 523 |
|
477 | 524 | if __name__ == "__main__":
|
|
0 commit comments