Commit 4f536918 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

feat: add permutations with expanded terms for discovery endpoints

parent 899ed252
Loading
Loading
Loading
Loading
+14 −6
Original line number Original line Diff line number Diff line
@@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource


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




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




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




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


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




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




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




*** Keywords ***
*** 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
Setup Initial Entities
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
+24 −5
Original line number Original line Diff line number Diff line
{
{
  "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02",
  "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",
  "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7",
  "config_id": "",
  "config_id": "",
  "parent_release": "v1.3.1",
  "parent_release": "v1.3.1",
@@ -9,6 +9,7 @@
  ],
  ],
  "pics_selection": "",
  "pics_selection": "",
  "keywords": [
  "keywords": [
    "Retrieve Detailed Representation Of Available Entity Type",
    "Setup Initial Entities",
    "Setup Initial Entities",
    "Delete Initial Entities"
    "Delete Initial Entities"
  ],
  ],
@@ -16,23 +17,41 @@
  "initial_condition": "with {\n   the SUT containing an initial state\n}",
  "initial_condition": "with {\n   the SUT containing an initial state\n}",
  "test_cases": [
  "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",
      "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": [
      "tags": [
        "5_7_7",
        "5_7_7",
        "ed-type"
        "ed-type"
      ],
      ],
      "setup": null,
      "setup": null,
      "teardown": 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}",
      "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}",
      "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",
      "http_verb": "GET",
      "endpoint": "types/{type}"
      "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",
  "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation",
  "robotfile": "024_02"
  "robotfile": "024_02"
}
}
 No newline at end of file
+22 −5
Original line number Original line Diff line number Diff line
{
{
  "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02",
  "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",
  "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10",
  "config_id": "",
  "config_id": "",
  "parent_release": "v1.3.1",
  "parent_release": "v1.3.1",
@@ -9,6 +9,7 @@
  ],
  ],
  "pics_selection": "",
  "pics_selection": "",
  "keywords": [
  "keywords": [
    "Retrieve Detailed Representation Of Available Attribute",
    "Setup Initial Entity",
    "Setup Initial Entity",
    "Delete Initial Entity"
    "Delete Initial Entity"
  ],
  ],
@@ -16,18 +17,34 @@
  "initial_condition": "with {\n   the SUT containing an initial state\n}",
  "initial_condition": "with {\n   the SUT containing an initial state\n}",
  "test_cases": [
  "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",
      "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": [
      "tags": [
        "5_7_10",
        "5_7_10",
        "ed-attr"
        "ed-attr"
      ],
      ],
      "setup": null,
      "setup": null,
      "teardown": 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}",
      "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",
      "http_verb": "GET",
      "endpoint": "attributes/{attribute_name}"
      "endpoint": "attributes/{attribute_name}"
    }
    }