|
151 | 151 |
|
152 | 152 | SCENARIO_STEPS = {'createTestCase' : ['noRealReponseData - ok for step tests']}
|
153 | 153 |
|
| 154 | +# scenario_keywords defines response with keywords |
| 155 | +SCENARIO_KEYWORDS = {'getTestCasesForTestSuite' : { |
| 156 | + 'noTestCase' : [] , |
| 157 | + |
| 158 | + 'deepTrue1' : [{'node_order': '0', 'is_open': '1', |
| 159 | + 'keywords': {'3': {'keyword_id': '3', 'notes': 'a third key word', 'testcase_id': '8136', 'keyword': 'KeyWord03'}}, |
| 160 | + 'id': '8136', 'node_type_id': '3', 'layout': '1', 'tc_external_id': '1', 'parent_id': '8135', 'version': '1', |
| 161 | + 'estimated_exec_duration': '', 'updater_id': '2', 'status': '1', 'tsuite_name': 'AA - Second Level', |
| 162 | + 'importance': '2', 'modification_ts': '2014-07-01 21:21:59', 'execution_type': '2', |
| 163 | + 'preconditions': '<p>\n\tthese are the preconditions</p>\n', 'active': '1', 'creation_ts': '2014-06-28 22:06:17', |
| 164 | + 'node_table': 'testcases', 'tcversion_id': '8137', 'name': 'TESTCASE_AA', |
| 165 | + 'summary': '<p>\n\tThis is the summary of the Test Case AA</p>\n', |
| 166 | + 'steps': [{'step_number': '1', 'actions': 'Step action 1 - aa', 'execution_type': '1', 'active': '1', 'id': '8138', 'expected_results': 'Step result 1 - aa'}, |
| 167 | + {'step_number': '2', 'actions': 'Step action 2 - aa', 'execution_type': '1', 'active': '1', 'id': '8139', 'expected_results': 'Step result 2 - aa'}, |
| 168 | + {'step_number': '3', 'actions': 'Step action 3 - aa', 'execution_type': '1', 'active': '1', 'id': '8140', 'expected_results': 'Step result 3 - aa'}, |
| 169 | + {'step_number': '4', 'actions': 'Step action 4 - aa', 'execution_type': '1', 'active': '1', 'id': '8141', 'expected_results': 'Step result 4 - aa'}, |
| 170 | + {'step_number': '5', 'actions': 'Step action 5 - aa', 'execution_type': '1', 'active': '1', 'id': '8142', 'expected_results': 'Step result 5 - aa'}], |
| 171 | + 'author_id': '1', 'external_id': 'GPROAPI10-1'}], |
| 172 | + |
| 173 | + 'deepFalse3' : [{'node_order': '0', 'is_open': '1', |
| 174 | + 'keywords': {'1': {'keyword_id': '1', 'notes': 'a key word', 'testcase_id': '8144', 'keyword': 'KeyWord01'}, |
| 175 | + '3': {'keyword_id': '3', 'notes': 'a third key word', 'testcase_id': '8144', 'keyword': 'KeyWord03'}}, |
| 176 | + 'id': '8144', 'node_type_id': '3', 'layout': '1', 'tc_external_id': '2', 'parent_id': '8134', 'version': '1', |
| 177 | + 'details': '<p>\n\tDetails of the Test Suite B</p>\n', 'estimated_exec_duration': '3.00', 'updater_id': '2', 'status': '1', |
| 178 | + 'importance': '3', 'modification_ts': '2014-06-30 20:45:40', 'execution_type': '1', |
| 179 | + 'preconditions': '<p>\n\tthese are the preconditions</p>\n', 'active': '1', 'creation_ts': '2014-06-28 22:06:17', |
| 180 | + 'node_table': 'testcases', 'tcversion_id': '8145', 'name': 'TESTCASE_B', |
| 181 | + 'summary': '<p>\n\tThis is the summary of the Test Case B</p>\n', |
| 182 | + 'steps': [{'step_number': '1', 'actions': 'Step action 1 -b ', 'execution_type': '2', 'active': '1', 'id': '8151', 'expected_results': 'Step result 1 - b'}, |
| 183 | + {'step_number': '2', 'actions': 'Step action 2 -b ', 'execution_type': '2', 'active': '1', 'id': '8152', 'expected_results': 'Step result 2 - b'}, |
| 184 | + {'step_number': '3', 'actions': 'action 3 createTestCaseSteps.update', 'execution_type': '2', 'active': '1', 'id': '8153', 'expected_results': 'update - cause step 3 already exist'}, |
| 185 | + {'step_number': '4', 'actions': 'Step action 4 -b ', 'execution_type': '2', 'active': '1', 'id': '8154', 'expected_results': 'Step result 4 - b'}, |
| 186 | + {'step_number': '5', 'actions': 'Step action 5 -b changed by updateTestCase', 'execution_type': '2', 'active': '1', 'id': '8155', 'expected_results': 'Step result 5 - b changed'}, |
| 187 | + {'step_number': '6', 'actions': 'Step action 6 -b added by updateTestCase', 'execution_type': '2', 'active': '1', 'id': '8156', 'expected_results': 'Step result 6 - b added'}, |
| 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 | + {'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 | + 'author_id': '1'}, |
| 191 | + {'node_order': '1', 'is_open': '1', |
| 192 | + 'keywords': {'2': {'keyword_id': '2', 'notes': 'another key word', 'testcase_id': '8159', 'keyword': 'KeyWord02'}}, |
| 193 | + 'id': '8159', 'node_type_id': '3', 'layout': '1', 'tc_external_id': '3', 'parent_id': '8134', 'version': '1', |
| 194 | + 'details': '<p>\n\tDetails of the Test Suite B</p>\n', 'estimated_exec_duration': '3.00', 'updater_id': '2', 'status': '1', |
| 195 | + 'importance': '3', 'modification_ts': '2014-07-02 21:03:02', 'execution_type': '1', |
| 196 | + 'preconditions': '<p>\n\tthese are the preconditions</p>\n', 'active': '1', 'creation_ts': '2014-07-02 20:53:45', |
| 197 | + 'node_table': 'testcases', 'tcversion_id': '8160', 'name': 'TESTCASE_B2', |
| 198 | + 'summary': '<p>\n\tThis is the summary of the Test Case B2</p>\n', |
| 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 | + {'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 | + 'author_id': '2'}, |
| 202 | + {'node_order': '2', 'is_open': '1', |
| 203 | + 'id': '8169', 'node_type_id': '3', 'layout': '1', 'tc_external_id': '4', 'parent_id': '8134', 'version': '1', |
| 204 | + 'details': '<p>\n\tDetails of the Test Suite B</p>\n', 'estimated_exec_duration': '3.00', 'updater_id': '2', 'status': '1', |
| 205 | + 'importance': '3', 'modification_ts': '2014-07-02 21:02:23', 'execution_type': '1', |
| 206 | + 'preconditions': '<p>\n\tthese are the preconditions</p>\n', 'active': '1', 'creation_ts': '2014-07-02 20:55:46', |
| 207 | + 'node_table': 'testcases', 'tcversion_id': '8170', 'name': 'TESTCASE_B3', |
| 208 | + 'summary': '<p>\n\tThis is the summary of the Test Case B3</p>\n', |
| 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 | + {'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 | + 'author_id': '2'}] |
| 212 | + } |
| 213 | + } |
| 214 | + |
| 215 | + |
154 | 216 | class DummyAPIClient(TestlinkAPIClient):
|
155 | 217 | """ Dummy for Simulation TestLinkAPICLient.
|
156 | 218 | Overrides _callServer() Method to return test scenarios
|
@@ -397,6 +459,19 @@ def test_reportTCResult_user(self):
|
397 | 459 | def test_whatArgs_reportTCResult(self):
|
398 | 460 | argsDescription = self.api.whatArgs('reportTCResult')
|
399 | 461 | self.assertIn('user=<user>', argsDescription)
|
| 462 | + |
| 463 | + def test_getTestCasesForTestSuite_keyWords(self): |
| 464 | + self.api.loadScenario(SCENARIO_KEYWORDS) |
| 465 | + response = self.api.getTestCasesForTestSuite('deepFalse3', False, |
| 466 | + 'full', getkeywords=True) |
| 467 | + self.assertIn('keywords', response[0]) |
| 468 | + self.assertNotIn('keywords', response[2]) |
| 469 | + self.assertEqual(self.api.devKey, self.api.callArgs['devKey']) |
| 470 | + |
| 471 | + def test_whatArgs_getTestCasesForTestSuite(self): |
| 472 | + argsDescription = self.api.whatArgs('getTestCasesForTestSuite') |
| 473 | + self.assertIn('getkeywords=<getkeywords>', argsDescription) |
| 474 | + |
400 | 475 |
|
401 | 476 |
|
402 | 477 | if __name__ == "__main__":
|
|
0 commit comments