Commit aba8e1a3 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

Merge branch 'feature/add-permutation-expanded-discovery-endpoints' into 'develop'

feat: add permutations with expanded terms for discovery endpoints

See merge request !156
parents 899ed252 4f536918
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource

Suite Setup         Setup Initial Entity
Suite Teardown      Delete Initial Entity
Test Template       Retrieve Detailed Representation Of Available Attribute


*** Variables ***
@@ -16,16 +17,23 @@ ${filename}= building-simple-attributes.json
${expectation_file}=        types/expectations/attribute-027-01.json


*** Test Cases ***
027_02_01 Retrieve Detailed Representation Of Available Attribute
    [Documentation]    Check that one can retrieve a list with a detailed representation of NGSI-LD attributes
*** Test Cases ***    ATTR_NAME
027_02_01 WithCompactedAttributeName
    [Tags]    ed-attr    5_7_10
    ${response}=    Retrieve Attribute    attribute_name=airQualityLevel    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing Attribute element    ${expectation_file}    ${response.json()}
    airQualityLevel
027_02_02 WithExpandedAttributeName
    [Tags]    ed-attr    5_7_10
    https%3A%2F%2Fngsi-ld-test-suite%2Fcontext%23airQualityLevel


*** Keywords ***
Retrieve Detailed Representation Of Available Attribute
    [Documentation]    Check that one can retrieve a list with a detailed representation of NGSI-LD attributes
    [Arguments]    ${attributeName}
    ${response}=    Retrieve Attribute    attribute_name=${attributeName}    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing Attribute element    ${expectation_file}    ${response.json()}

Setup Initial Entity
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${create_response}=    Create Entity Selecting Content Type
+14 −6
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource

Suite Setup         Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Template       Retrieve Detailed Representation Of Available Entity Type


*** Variables ***
@@ -16,16 +17,23 @@ ${filename}= building-simple-attributes.json
${expectation_file}=        types/expectations/entity-type-info-024-01.json


*** Test Cases ***
024_02_01 Retrieve Detailed Representation Of Available Entity Type
    [Documentation]    Check that one can retrieve a detailed representation of a specified NGSI-LD entity type
*** Test Cases ***    TYPE
024_02_01 WithCompactedType
    [Tags]    ed-type    5_7_7
    ${response}=    Retrieve Entity Type    type=Building    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing EntityTypeInfo element    ${expectation_file}    ${response.json()}
    Building
024_02_02 WithExpandedType
    [Tags]    ed-type    5_7_7
    https%3A%2F%2Fngsi-ld-test-suite%2Fcontext%23Building


*** Keywords ***
Retrieve Detailed Representation Of Available Entity Type
    [Documentation]    Check that one can retrieve a detailed representation of a specified NGSI-LD entity type
    [Arguments]    ${type}
    ${response}=    Retrieve Entity Type    type=${type}    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing EntityTypeInfo element    ${expectation_file}    ${response.json()}

Setup Initial Entities
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
+24 −5
Original line number Diff line number Diff line
{
  "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02",
  "test_objective": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type",
  "test_objective": "Check that one can retrieve a detailed representation of a specified NGSI-LD entity type",
  "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7",
  "config_id": "",
  "parent_release": "v1.3.1",
@@ -9,6 +9,7 @@
  ],
  "pics_selection": "",
  "keywords": [
    "Retrieve Detailed Representation Of Available Entity Type",
    "Setup Initial Entities",
    "Delete Initial Entities"
  ],
@@ -16,23 +17,41 @@
  "initial_condition": "with {\n   the SUT containing an initial state\n}",
  "test_cases": [
    {
      "name": "024_02_01 Retrieve Detailed Representation Of Available Entity Type",
      "name": "024_02_01 WithCompactedType",
      "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02_01",
      "doc": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type",
      "doc": "Check that one can retrieve a detailed representation of a specified NGSI-LD entity type",
      "tags": [
        "5_7_7",
        "ed-type"
      ],
      "setup": null,
      "teardown": null,
      "template": null,
      "template": "Retrieve Detailed Representation Of Available Entity Type",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Retrieve Entity Type with Response Status Code set to 200     and\n        Retrieve Entity Type with Response body containing an Entity Type Info with expectation body set to file 'types/expectations/entity-type-info-024-01.json' and response body to be checked set to '${response.json()}'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/types/{type}'\n        method set to 'GET'\n        Retrieve Entity Type, with type set to 'Building', with Header['Link'] containing 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}",
      "http_verb": "GET",
      "endpoint": "types/{type}"
    },
    {
      "name": "024_02_02 WithExpandedType",
      "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02_02",
      "doc": "Check that one can retrieve a detailed representation of a specified NGSI-LD entity type",
      "tags": [
        "5_7_7",
        "ed-type"
      ],
      "setup": null,
      "teardown": null,
      "template": "Retrieve Detailed Representation Of Available Entity Type",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Retrieve Entity Type with Response Status Code set to 200     and\n        Retrieve Entity Type with Response body containing an Entity Type Info with expectation body set to file 'types/expectations/entity-type-info-024-01.json' and response body to be checked set to '${response.json()}'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/types/{type}'\n        method set to 'GET'\n        Retrieve Entity Type, with type set to 'https%3A%2F%2Fngsi-ld-test-suite%2Fcontext%23Building', with Header['Link'] containing 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}",
      "http_verb": "GET",
      "endpoint": "types/{type}"
    }
  ],
  "permutations": [],
  "permutations": [
    "when"
  ],
  "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation",
  "robotfile": "024_02"
}
 No newline at end of file
+22 −5
Original line number Diff line number Diff line
{
  "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02",
  "test_objective": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes",
  "test_objective": "Check that one can retrieve a list with a detailed representation of NGSI-LD attributes",
  "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10",
  "config_id": "",
  "parent_release": "v1.3.1",
@@ -9,6 +9,7 @@
  ],
  "pics_selection": "",
  "keywords": [
    "Retrieve Detailed Representation Of Available Attribute",
    "Setup Initial Entity",
    "Delete Initial Entity"
  ],
@@ -16,18 +17,34 @@
  "initial_condition": "with {\n   the SUT containing an initial state\n}",
  "test_cases": [
    {
      "name": "027_02_01 Retrieve Detailed Representation Of Available Attribute",
      "name": "027_02_01 WithCompactedAttributeName",
      "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02_01",
      "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes",
      "doc": "Check that one can retrieve a list with a detailed representation of NGSI-LD attributes",
      "tags": [
        "5_7_10",
        "ed-attr"
      ],
      "setup": null,
      "teardown": null,
      "template": null,
      "template": "Retrieve Detailed Representation Of Available Attribute",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Retrieve Attribute with Response Status Code set to 200     and\n        Retrieve Attribute with Response body containing an array of attributes\n            * with the expected payload defined in the file 'types/expectations/attribute-027-01.json'\n            * and response body set to '${response.json()}'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n        method set to 'GET'\n        Retrieve Attribute with attributeName set to 'airQualityLevel'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n        method set to 'GET'\n        Retrieve Attribute with attributeName set to '${attributeName}'\n}",
      "http_verb": "GET",
      "endpoint": "attributes/{attribute_name}"
    },
    {
      "name": "027_02_02 WithExpandedAttributeName",
      "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02_02",
      "doc": "Check that one can retrieve a list with a detailed representation of NGSI-LD attributes",
      "tags": [
        "5_7_10",
        "ed-attr"
      ],
      "setup": null,
      "teardown": null,
      "template": "Retrieve Detailed Representation Of Available Attribute",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Retrieve Attribute with Response Status Code set to 200     and\n        Retrieve Attribute with Response body containing an array of attributes\n            * with the expected payload defined in the file 'types/expectations/attribute-027-01.json'\n            * and response body set to '${response.json()}'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n        method set to 'GET'\n        Retrieve Attribute with attributeName set to '${attributeName}'\n}",
      "http_verb": "GET",
      "endpoint": "attributes/{attribute_name}"
    }