blob: 3676c39161d9a727ff710b4b77b810f63a4e8802 [file] [log] [blame]
Suchitra Vemuri9335aed2017-05-25 16:50:03 -07001*** Settings ***
2Documentation Test suite for Deletion of Subscribers and voltTenants - Chameleon APIs
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/Ch_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 VOLT_SUBSCRIBER
40 ${getSubscriber_result_list}= Get From Dictionary ${getSubscriber_result} items
41 ${getVoltTenant_result}= restApi.ApiGet VOLT_TENANT
42 ${getVoltTenant_result_list}= Get From Dictionary ${getVoltTenant_result} items
43 ${voltList}= Get Variable Value ${vlist}
44 ${voltTenantDict}= utils.listToDict ${voltList} ${listIndex}
45 ${voltDict}= Get From Dictionary ${voltTenantDict} voltTenant
46 ${servicespecific_id}= Get From Dictionary ${voltTenantDict} service_specific_id
47 ${subscriberDict}= utils.getDictFromListofDict ${getSubscriber_result_list} service_specific_id ${servicespecific_id}
48 Log ${subscriberDict}
49 ${subscriberId}= utils.getFieldValueFromDict ${subscriberDict} id
50 Log ${subscriberId}
Suchitra Vemuri9335aed2017-05-25 16:50:03 -070051 # Deletion of volt Tenants
52 ${getVoltDict}= utils.getDictFromListOfDict ${getVoltTenant_result_list} subscriber_root_id ${subscriberId}
53 ${voltID}= utils.getFieldValueFromDict ${getVoltDict} id
54 ${volt_delete_result}= restApi.ApiChameleonDelete VOLT_TENANT ${voltID}
55 Should Be True ${volt_delete_result}
Suchitra Vemuri9acc8832017-05-30 15:39:39 -070056 #Deletion of Subscribers
57 ${subscriber_delete_result}= restApi.ApiChameleonDelete VOLT_SUBSCRIBER ${subscriberId}
58 Should Be True ${subscriber_delete_result}