blob: cf12f7fc44999d50a92833d2e1e4efce8f44bfc4 [file] [log] [blame]
*** Settings ***
Documentation Test Suite for XOS Service APIs
Suite Setup ${SETUP_FLAG}
Suite Teardown Delete All Sessions
Test Template Verify API Functionality
Library Collections
Library String
Library OperatingSystem
Library XML
Library RequestsLibrary
Library CORDRobot
Library ImportResource resources=CORDRobot
Resource ${TESTLIBRARY}
Variables ../Properties/RestApiProperties.py
*** Variables ***
${xos_service} core
*** Test Cases *** TYPE API
{% for m in proto.messages %}
{%- if xproto_unquote(m.options.app_label) != "core" -%}
{%- if m.name not in ['XOSBase'] -%}
{% autoescape false %}
{% endautoescape %}
Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_1}
[Tags] create
Get {{ m.name }} /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ xproto_pluralize(m) | lower }} ${json_{{ m.name | lower}}_1}
[Template] Verify Data Model
[Tags] get
{% endif -%}
{% endif -%}
{% endfor %}
*** Keywords ***
Setup
Setup Tests
Verify Data Model
[Arguments] ${endpoint} ${data}
${list1}= Create List ${data}
${resp}= Get Request ${SERVER_IP} ${endpoint}
Log ${resp.content}
Should Be Equal As Strings ${resp.status_code} 200
${jsondata}= To Json ${resp.content}
Log ${data}
${test_result}= CORDRobot.compare_list_of_dicts ${list1} ${jsondata['items']}