Kailash | 8394cff | 2019-04-29 09:19:22 -0700 | [diff] [blame] | 1 | |
| 2 | *** Settings *** |
| 3 | Documentation Test Suite for XOS Service APIs |
| 4 | Suite Setup ${SETUP_FLAG} |
| 5 | Suite Teardown Delete All Sessions |
| 6 | Test Template Verify API Functionality |
| 7 | Library Collections |
| 8 | Library String |
| 9 | Library OperatingSystem |
| 10 | Library XML |
| 11 | Library RequestsLibrary |
| 12 | Library HttpLibrary.HTTP |
| 13 | Library ../Framework/utils/utils.py |
| 14 | Library ../Framework/restApi.py |
| 15 | Resource ${TESTLIBRARY} |
| 16 | Variables ../Properties/RestApiProperties.py |
| 17 | |
| 18 | *** Variables *** |
| 19 | ${xos_service} core |
| 20 | |
| 21 | *** Test Cases *** TYPE API |
| 22 | {% for m in proto.messages %} |
| 23 | {%- if xproto_unquote(m.options.app_label) != "core" -%} |
| 24 | {%- if m.name not in ['XOSBase'] -%} |
| 25 | {% autoescape false %} |
| 26 | {% endautoescape %} |
| 27 | Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_1} |
| 28 | [Tags] create |
| 29 | |
| 30 | Get {{ m.name }} /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_1} |
| 31 | [Template] Verify Data Model |
| 32 | [Tags] get |
| 33 | |
| 34 | {% endif -%} |
| 35 | {% endif -%} |
| 36 | {% endfor %} |
| 37 | |
| 38 | *** Keywords *** |
| 39 | Setup |
| 40 | Setup Tests |
| 41 | |
| 42 | Verify Data Model |
| 43 | [Arguments] ${endpoint} ${data} |
| 44 | ${list1}= Create List ${data} |
| 45 | ${resp}= Get Request ${SERVER_IP} ${endpoint} |
| 46 | Log ${resp.content} |
| 47 | Should Be Equal As Strings ${resp.status_code} 200 |
| 48 | ${jsondata}= To Json ${resp.content} |
| 49 | Log ${data} |
Kailash | 0619026 | 2019-04-30 09:50:14 -0700 | [diff] [blame] | 50 | ${test_result}= utils.compare_list_of_dicts ${list1} ${jsondata['items']} |