Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test suite for Deletion of Subscribers and voltTenants |
| 3 | Suite Setup Read InputFile |
| 4 | Test Template Verify Deletion of Subscriber and volt Tenant functionality |
| 5 | Library Collections |
| 6 | Library String |
| 7 | Library OperatingSystem |
| 8 | Library XML |
| 9 | Library RequestsLibrary |
| 10 | Library ../Framework/utils/utils.py |
| 11 | Library ../Framework/restApi.py |
| 12 | |
| 13 | *** Variables *** |
| 14 | ${USER} admin |
| 15 | ${PASSWORD} admin |
| 16 | ${PATHFILE} ${CURDIR}/data/VoltTenant.json |
| 17 | |
| 18 | *** Test Cases *** TYPE LISTINDEX |
| 19 | Test Delete Subscriber and volt_tenant-1 |
| 20 | DELETE 0 |
| 21 | |
| 22 | Test Delete Subscriber and volt_tenant-2 |
| 23 | DELETE 1 |
| 24 | |
| 25 | Test Delete Subscriber and volt_tenant-3 |
| 26 | DELETE 2 |
| 27 | |
| 28 | *** Keywords *** |
| 29 | Read InputFile |
| 30 | ${voltList} = utils.jsonToList ${PATHFILE} voltSubscriberInfo |
| 31 | Set Suite Variable ${vlist} ${voltList} |
| 32 | |
| 33 | Verify Deletion of Subscriber and volt Tenant functionality |
| 34 | [Arguments] ${type} ${listIndex} |
| 35 | Run Keyword If "${type}" == "DELETE" Test Delete Subscriber and voltTenant ${listIndex} |
| 36 | |
| 37 | Test Delete Subscriber and voltTenant |
| 38 | [Arguments] ${listIndex} |
| 39 | ${getSubscriber_result}= restApi.ApiGet TENANT_SUBSCRIBER |
| 40 | ${getVoltTenant_result}= restApi.ApiGet TENANT_VOLT |
| 41 | ${voltList}= Get Variable Value ${vlist} |
| 42 | ${voltTenantDict}= utils.listToDict ${voltList} ${listIndex} |
| 43 | ${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant |
| 44 | ${account_num}= Get From Dictionary ${voltTenantDict} account_num |
| 45 | ${subscriberDict}= utils.getDictFromListofDict ${getSubscriber_result} account_num ${account_num} |
| 46 | Log ${subscriberDict} |
| 47 | ${subscriberId}= utils.getFieldValueFromDict ${subscriberDict} id |
| 48 | Log ${subscriberId} |
| 49 | ${subscriber_delete_result}= restApi.ApiDelete TENANT_SUBSCRIBER ${subscriberId} |
| 50 | Should Be True ${subscriber_delete_result} |
| 51 | # Deletion of volt Tenants |
| 52 | ${getVoltDict}= utils.getDictFromListOfDict ${getVoltTenant_result} subscriber ${subscriberId} |
| 53 | ${voltID}= utils.getFieldValueFromDict ${getVoltDict} id |
| 54 | ${volt_delete_result}= restApi.ApiDelete TENANT_VOLT ${voltID} |
| 55 | Should Be True ${volt_delete_result} |