blob: 551f1798256aabd535269faa7aaccaa295ea7b3f [file] [log] [blame]
Kailash Khalasi22da3862018-05-07 10:01:01 -06001
2*** Settings ***
3Documentation Test Suite for XOS APIs
4Suite Setup Setup
5Suite Teardown Teardown
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{%- if m.name not in ['ServiceMonitoringAgentInfo', 'XOS'] -%}
26{% autoescape false %}
27{% endautoescape %}
28Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_1}
29 [Tags] {{ m.name }}
30
31Update {{ m.name }} UPDATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_updated_1} ${id}
32 [Tags] {{ m.name }}
33
34Get {{ m.name }} RETRIEVE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s ${json_{{ m.name | lower}}_updated_1} ${id} ${json_{{ m.name | lower}}_updated_key}
35 [Tags] {{ m.name }}
36
37Delete {{ m.name }} DELETE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}s data_id=${id}
38 [Tags] {{ m.name }}
39{% else %}
40Create {{ m.name }} CREATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_1}
41 [Tags] {{ m.name }}
42
43Update {{ m.name }} UPDATE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_updated_1} ${id}
44 [Tags] {{ m.name }}
45
46Get {{ m.name }} RETRIEVE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es ${json_{{ m.name | lower}}_updated_1} ${id} ${json_{{ m.name | lower}}_updated_key}
47 [Tags] {{ m.name }}
48
49Delete {{ m.name }} DELETE /xosapi/v1/{{ xproto_unquote(m.options.app_label) }}/{{ m.name | lower}}es data_id=${id}
50 [Tags] {{ m.name }}
51{% endif -%}
52{% endif -%}
53{% endif -%}
54{% endfor %}
55
56*** Keywords ***
57Setup
58 Setup Tests
59
60Teardown
61 Teardown Tests