blob: 5621b2476ee3c59334baa36e128221ebaecb8aca [file] [log] [blame]
Suchitra.Vemurid2035342016-11-22 17:44:40 -08001*** Settings ***
2Documentation Test suite for Deletion of Subscribers and voltTenants
3Suite Setup Read InputFile
4Test Template Verify Deletion of Subscriber and volt Tenant functionality
5Library Collections
6Library String
7Library OperatingSystem
8Library XML
9Library RequestsLibrary
10Library ../Framework/utils/utils.py
11Library ../Framework/restApi.py
12
13*** Variables ***
14${USER} admin
15${PASSWORD} admin
16${PATHFILE} ${CURDIR}/data/VoltTenant.json
17
18*** Test Cases *** TYPE LISTINDEX
19Test Delete Subscriber and volt_tenant-1
20 DELETE 0
21
22Test Delete Subscriber and volt_tenant-2
23 DELETE 1
24
25Test Delete Subscriber and volt_tenant-3
26 DELETE 2
27
28*** Keywords ***
29Read InputFile
30 ${voltList} = utils.jsonToList ${PATHFILE} voltSubscriberInfo
31 Set Suite Variable ${vlist} ${voltList}
32
33Verify Deletion of Subscriber and volt Tenant functionality
34 [Arguments] ${type} ${listIndex}
35 Run Keyword If "${type}" == "DELETE" Test Delete Subscriber and voltTenant ${listIndex}
36
37Test 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}