Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test to Configure ATT Work flow driver |
| 3 | Suite Setup Read InputFile |
| 4 | Test Template Configuring ATT Driver |
| 5 | Library Collections |
| 6 | Library String |
| 7 | Library OperatingSystem |
| 8 | Library XML |
| 9 | Library RequestsLibrary |
Suchitra Vemuri | 32fc2f2 | 2018-09-10 12:06:01 -0700 | [diff] [blame] | 10 | Library ../../Framework/utils/utils.py |
| 11 | Library ../../Framework/restApi.py |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 12 | |
| 13 | *** Variables *** |
Suchitra Vemuri | ff82532 | 2018-09-07 14:00:04 -0700 | [diff] [blame] | 14 | ${PATHFILE} ${CURDIR}/data/ATTWorkFlowDriver.json |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 15 | |
| 16 | *** Test Cases *** TYPE LISTINDEX |
| 17 | Test Create AttWorkFlow-1 |
| 18 | CREATE 0 |
| 19 | Test Get AttWorkFlow-1 |
| 20 | RETRIEVE 0 |
| 21 | |
| 22 | *** Keywords *** |
| 23 | Read InputFile |
| 24 | ${AttWorkFlowList}= utils.jsonToList ${PATHFILE} AttWorkFlowDriverInfo |
| 25 | Set Suite Variable ${slist} ${AttWorkFlowList} |
| 26 | Set Global Variable ${AttWorkFlowDriver_Id} ${EMPTY} |
| 27 | |
| 28 | Configuring 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 | |
| 33 | Post 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 | |
| 42 | Get 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} |