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 |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 10 | Library CORDRobot |
| 11 | Library ImportResource resources=CORDRobot |
Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 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 |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 30 | ${voltList} = CORDRobot.jsonToList ${PATHFILE} voltSubscriberInfo |
Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 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} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 39 | ${getSubscriber_result}= CORDRobot.ApiGet TENANT_SUBSCRIBER |
| 40 | ${getVoltTenant_result}= CORDRobot.ApiGet TENANT_VOLT |
Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 41 | ${voltList}= Get Variable Value ${vlist} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 42 | ${voltTenantDict}= CORDRobot.listToDict ${voltList} ${listIndex} |
Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 43 | ${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant |
| 44 | ${account_num}= Get From Dictionary ${voltTenantDict} account_num |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 45 | ${subscriberDict}= CORDRobot.getDictFromListofDict ${getSubscriber_result} account_num ${account_num} |
Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 46 | Log ${subscriberDict} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 47 | ${subscriberId}= CORDRobot.getFieldValueFromDict ${subscriberDict} id |
Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 48 | Log ${subscriberId} |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 49 | ${subscriber_delete_result}= CORDRobot.ApiDelete TENANT_SUBSCRIBER ${subscriberId} |
Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 50 | Should Be True ${subscriber_delete_result} |
| 51 | # Deletion of volt Tenants |
Zack Williams | 821c502 | 2020-01-15 15:11:46 -0700 | [diff] [blame^] | 52 | ${getVoltDict}= CORDRobot.getDictFromListOfDict ${getVoltTenant_result} subscriber ${subscriberId} |
| 53 | ${voltID}= CORDRobot.getFieldValueFromDict ${getVoltDict} id |
| 54 | ${volt_delete_result}= CORDRobot.ApiDelete TENANT_VOLT ${voltID} |
Suchitra.Vemuri | d203534 | 2016-11-22 17:44:40 -0800 | [diff] [blame] | 55 | Should Be True ${volt_delete_result} |