blob: 6254777d37cc9f0691ee40150aa0d8b29d2a574c [file] [log] [blame]
Suchitra Vemuriddb27792018-08-23 15:29:42 -07001*** Settings ***
2Documentation Test to Configure ATT Work flow driver
3Suite Setup Read InputFile
4Test Template Configuring ATT Driver
5Library Collections
6Library String
7Library OperatingSystem
8Library XML
9Library RequestsLibrary
Suchitra Vemuri32fc2f22018-09-10 12:06:01 -070010Library ../../Framework/utils/utils.py
11Library ../../Framework/restApi.py
Suchitra Vemuriddb27792018-08-23 15:29:42 -070012
13*** Variables ***
Suchitra Vemuriff825322018-09-07 14:00:04 -070014${PATHFILE} ${CURDIR}/data/ATTWorkFlowDriver.json
Suchitra Vemuriddb27792018-08-23 15:29:42 -070015
16*** Test Cases *** TYPE LISTINDEX
17Test Create AttWorkFlow-1
18 CREATE 0
19Test Get AttWorkFlow-1
20 RETRIEVE 0
21
22*** Keywords ***
23Read InputFile
24 ${AttWorkFlowList}= utils.jsonToList ${PATHFILE} AttWorkFlowDriverInfo
25 Set Suite Variable ${slist} ${AttWorkFlowList}
26 Set Global Variable ${AttWorkFlowDriver_Id} ${EMPTY}
27
28Configuring ATT Driver
29 [Arguments] ${type} ${listIndex}
30 Run Keyword If "${type}" == "CREATE" Post ATT Driver ${listIndex}
31 Run Keyword If "${type}" == "RETRIEVE" Get ATT Driver ${listIndex}
32
33Post ATT Driver
34 [Arguments] ${listIndex}
35 ${AttWorkFlowList} = Get Variable Value ${slist}
36 ${AttWorkFlowDriverDict}= utils.listToDict ${AttWorkFlowList} ${listIndex}
37 ${api_result_status} ${api_result_json}= restApi.ApiPostReturnJson ATT_SERVICE ${AttWorkFlowDriverDict}
38 Should Be True ${api_result_status}
39 ${AttWorkFlowDriver_Id}= Get From Dictionary ${api_result_json} id
40 Set Global Variable ${AttWorkFlowDriver_Id}
41
42Get ATT Driver
43 [Arguments] ${listIndex}
44 Log ${AttWorkFlowDriver_Id}
45 ${json_result}= restApi.ApiChameleonGet ATT_SERVICE ${AttWorkFlowDriver_Id}
46 Log ${json_result}
47 ${AttWorkFlowList} = Get Variable Value ${slist}
48 ${AttWorkFlowDriverDict}= utils.listToDict ${AttWorkFlowList} ${listIndex}
49 Log ${AttWorkFlowDriverDict}
50 ${test_result}= utils.compare_dict ${AttWorkFlowDriverDict} ${json_result}
51 Should Be True ${test_result}