blob: c87b17d410f840a4282e9171b3faf68c38e2b90b [file] [log] [blame]
Kailash8394cff2019-04-29 09:19:22 -07001
2*** Settings ***
3Documentation Test Suite for XOS Service APIs
4Suite Setup ${SETUP_FLAG}
5Suite Teardown Delete All Sessions
6Test Template Verify API Functionality
7Library Collections
8Library String
9Library OperatingSystem
10Library XML
11Library RequestsLibrary
12Library HttpLibrary.HTTP
13Library ../Framework/utils/utils.py
14Library ../Framework/restApi.py
15Resource ${TESTLIBRARY}
16Variables ../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 %}
27Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_1}
28 [Tags] create
29
30Get {{ 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 ***
39Setup
40 Setup Tests
41
42Verify 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}
Kailash06190262019-04-30 09:50:14 -070050 ${test_result}= utils.compare_list_of_dicts ${list1} ${jsondata['items']}