blob: cf12f7fc44999d50a92833d2e1e4efce8f44bfc4 [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
Zack Williams821c5022020-01-15 15:11:46 -070012Library CORDRobot
13Library ImportResource resources=CORDRobot
Kailash8394cff2019-04-29 09:19:22 -070014Resource ${TESTLIBRARY}
15Variables ../Properties/RestApiProperties.py
16
17*** Variables ***
18${xos_service} core
19
20*** Test Cases *** TYPE API
21{% for m in proto.messages %}
22{%- if xproto_unquote(m.options.app_label) != "core" -%}
23{%- if m.name not in ['XOSBase'] -%}
24{% autoescape false %}
25{% endautoescape %}
26Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_1}
27 [Tags] create
28
29Get {{ m.name }} /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_1}
30 [Template] Verify Data Model
31 [Tags] get
32
33{% endif -%}
34{% endif -%}
35{% endfor %}
36
37*** Keywords ***
38Setup
39 Setup Tests
40
41Verify Data Model
42 [Arguments] ${endpoint} ${data}
43 ${list1}= Create List ${data}
44 ${resp}= Get Request ${SERVER_IP} ${endpoint}
45 Log ${resp.content}
46 Should Be Equal As Strings ${resp.status_code} 200
47 ${jsondata}= To Json ${resp.content}
48 Log ${data}
Zack Williams821c5022020-01-15 15:11:46 -070049 ${test_result}= CORDRobot.compare_list_of_dicts ${list1} ${jsondata['items']}