|
77 | 77 | NEWPREFIX="GPROAPI%i" % projNr |
78 | 78 | NEWTESTPLAN_A="TestPlan_API_GENERIC A" |
79 | 79 | NEWTESTPLAN_B="TestPlan_API_GENERIC B" |
| 80 | +NEWTESTPLAN_C="TestPlan_API_GENERIC C - DeleteTest" |
80 | 81 | NEWPLATFORM_A='Big Bird %i' % projNr |
81 | 82 | NEWPLATFORM_B='Small Bird' |
82 | 83 | NEWPLATFORM_C='Ugly Bird' |
|
88 | 89 | myApiVersion='%s v%s' % (myTestLink.__class__.__name__ , myTestLink.__version__) |
89 | 90 | NEWBUILD_A='%s' % myApiVersion |
90 | 91 | NEWBUILD_B='%s' % myApiVersion |
| 92 | +NEWBUILD_C='%s - DeleteTest' % myApiVersion |
91 | 93 |
|
92 | 94 | this_file_dirname=os.path.dirname(__file__) |
93 | 95 | NEWATTACHMENT_PY= os.path.join(this_file_dirname, 'TestLinkExampleGenericApi.py') |
|
499 | 501 | newProjectID, MANUAL) |
500 | 502 | print("setTestCaseExecutionType", response) |
501 | 503 |
|
| 504 | +# create TestPlan C with Platform, Build , TestCase, assigned TestCase |
| 505 | +# and delete it |
| 506 | +newTestPlan = myTestLink.createTestPlan(NEWTESTPLAN_C, NEWPROJECT, |
| 507 | + notes='TestPlan for delete test.', |
| 508 | + active=1, public=1) |
| 509 | +print("createTestPlan for DeleteTest", newTestPlan) |
| 510 | +newTestPlanID_C = newTestPlan[0]['id'] |
| 511 | +print("Test Plan '%s' - id: %s" % (NEWTESTPLAN_C,newTestPlanID_C)) |
| 512 | +newBuild = myTestLink.createBuild(newTestPlanID_C, NEWBUILD_C, |
| 513 | + buildnotes='Build for TestPlan delete test') |
| 514 | +print("createBuild for DeleteTest", newBuild) |
| 515 | +newBuildID_C = newBuild[0]['id'] |
| 516 | +print("Build '%s' - id: %s" % (NEWBUILD_C, newBuildID_C)) |
| 517 | +response = myTestLink.addPlatformToTestPlan(newTestPlanID_C, NEWPLATFORM_C) |
| 518 | +print("addPlatformToTestPlan", response) |
| 519 | +response = myTestLink.addTestCaseToTestPlan(newProjectID, newTestPlanID_C, |
| 520 | + tc_aa_full_ext_id, tc_version, platformid=newPlatFormID_C) |
| 521 | +print("addTestCaseToTestPlan", response) |
| 522 | +response = myTestLink.assignTestCaseExecutionTask( myTestUserName, |
| 523 | + newTestPlanID_C, tc_aa_full_ext_id, buildid=newBuildID_C, |
| 524 | + platformid=newPlatFormID_C) |
| 525 | +print("assignTestCaseExecutionTask", response) |
| 526 | +newResult = myTestLink.reportTCResult(newTestPlanID_C, 'p', |
| 527 | + buildid=newBuildID_C, testcaseid=newTestCaseID_AA, |
| 528 | + platformname=NEWPLATFORM_C, notes="TP delete test") |
| 529 | +print("reportTCResult", newResult) |
| 530 | +newResultID_B = newResult[0]['id'] |
| 531 | +newAttachment = myTestLink.uploadExecutionAttachment(NEWATTACHMENT_PY, newResultID_B, |
| 532 | + title='Textfile Example', filename='MyPyTPDeleteTest.py', |
| 533 | + description='Attachment Example for a TC Execution and TP delete test') |
| 534 | +print("uploadExecutionAttachment", newAttachment) |
| 535 | +response = myTestLink.getTotalsForTestPlan(newTestPlanID_C) |
| 536 | +print("getTotalsForTestPlan before delete", response) |
| 537 | +response = myTestLink.deleteTestPlan(newTestPlanID_C) |
| 538 | +print("deleteTestPlan", response) |
| 539 | +try: |
| 540 | + response = myTestLink.getTotalsForTestPlan(newTestPlanID_C) |
| 541 | + print("getTotalsForTestPlan after delete", response) |
| 542 | +except TLResponseError as tl_err: |
| 543 | + print(tl_err.message) |
| 544 | + |
502 | 545 | # get information - TestProject |
503 | 546 | response = myTestLink.getTestProjectByName(NEWPROJECT) |
504 | 547 | print("getTestProjectByName", response) |
|
0 commit comments