Commit 246f6f6d authored by lopesg's avatar lopesg
Browse files

fixed merge conflicts

parents 1a620d56 d6796e96
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@

```$ git clone git@forge.etsi.org:cim/ngsi-ld-test-suite.git```

## Configure the environment

In the `resources/variables.py` file, configure the following:
* URL of the context broker under test (including the `ngsi-ld/v1` path, e.g., http://localhost:8080/ngsi-ld/v1)
* Notification server host and port (an address accessible from the context broker)

## Install the project requirements

Browse the base project root folder and execute the following command:   
+34 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation   Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute
Resource    ${EXECDIR}/resources/ApiUtils.resource
Resource    ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities

*** Variable ***
${building_id_prefix}=  urn:ngsi-ld:Building:
${filename}=  building-simple-attributes-sample.json

*** Test Case ***
Retrieve Detailed Representation Of Available Attribute Without Context
    [Documentation]  Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute
    [Tags]  mandatory

    Retrieve Attribute   attribute_name=airQualityLevel

    Check Response Status Code Set To  404
    Check Response Body Containing ProblemDetails Element Containing Type Element set to      ${response}     ${ERROR_TYPE_RESOURCE_NOT_FOUND}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response}

*** Keywords ***
Setup Initial Entities
    ${entity_id}=     Generate Random Entity Id    ${building_id_prefix}

    Create Entity Selecting Content Type  ${filename}     ${entity_id}    ${CONTENT_TYPE_JSON}    ${ngsild_test_suite_context}

    Set Suite Variable  ${entity_id}

Delete Initial Entities
    Delete Entity by Id Returning Response   ${entity_id}
+34 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation   Check that you can retrieve a list with a detailed representation of NGSI-LD attributes
Resource    ${EXECDIR}/resources/ApiUtils.resource
Resource    ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities

*** Variable ***
${building_id_prefix}=  urn:ngsi-ld:Building:
${filename}=  building-simple-attributes-sample.json
${expectation_file}=  types/expectations/attribute-027-01-expectation.json

*** Test Case ***
Retrieve Detailed Representation Of Available Attribute
    [Documentation]  Check that you can retrieve a list with a detailed representation of NGSI-LD attributes
    [Tags]  mandatory

    Retrieve Attribute   attribute_name=airQualityLevel     context=${ngsild_test_suite_context}

    Check Response Status Code Set To  200
    Check Response Body Containing Attribute element   ${expectation_file}

*** Keywords ***
Setup Initial Entities
    ${entity_id}=     Generate Random Entity Id    ${building_id_prefix}

    Create Entity Selecting Content Type  ${filename}     ${entity_id}    ${CONTENT_TYPE_JSON}    ${ngsild_test_suite_context}

    Set Suite Variable  ${entity_id}

Delete Initial Entities
    Delete Entity by Id Returning Response   ${entity_id}
+38 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation   Check that you can retrieve a list of NGSI-LD attributes
Resource    ${EXECDIR}/resources/ApiUtils.resource
Resource    ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Test Template  Retrieve Available Attributes
Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities

*** Variable ***
${building_id_prefix}=  urn:ngsi-ld:Building:
${filename}=  building-simple-attributes-sample.json

*** Test Cases ***          CONTEXT                         EXPECTATION_FILE
WithoutJsonLdContext        ${EMPTY}                        types/expectations/attribute-list-025-01-01-expectation.json
WithJsonLdContext           ${ngsild_test_suite_context}    types/expectations/attribute-list-025-01-02-expectation.json

*** Keywords ***
Retrieve Available Attributes
    [Arguments]  ${context}     ${expectation_file}
    [Documentation]  Check that you can retrieve a list of NGSI-LD attributes
    [Tags]  mandatory

    Retrieve Attributes   ${context}

    Check Response Status Code Set To  200
    Check Response Body Containing AttributeList element   ${expectation_file}

Setup Initial Entities
    ${entity_id}=     Generate Random Entity Id    ${building_id_prefix}

    Create Entity Selecting Content Type  ${filename}     ${entity_id}    ${CONTENT_TYPE_JSON}    ${ngsild_test_suite_context}

    Set Suite Variable  ${entity_id}

Delete Initial Entities
    Delete Entity by Id Returning Response   ${entity_id}
+38 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation   Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type
Resource    ${EXECDIR}/resources/ApiUtils.resource
Resource    ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities

*** Variable ***
${building_id_prefix}=  urn:ngsi-ld:Building:
${filename}=  building-simple-attributes-sample.json

*** Test Case ***
Retrieve Detailed Representation Of Available Entity Type Without Context
    [Documentation]  Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type
    [Tags]  mandatory

    Retrieve Entity Type   type=Building

    Check Response Status Code Set To  404
    Check Response Body Containing ProblemDetails Element Containing Type Element set to      ${response}     ${ERROR_TYPE_RESOURCE_NOT_FOUND}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response}

*** Keywords ***
Setup Initial Entities
    ${first_entity_id}=     Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=     Generate Random Entity Id    ${building_id_prefix}

    Create Entity Selecting Content Type  ${filename}     ${first_entity_id}    ${CONTENT_TYPE_JSON}    ${ngsild_test_suite_context}
    Create Entity Selecting Content Type  ${filename}     ${second_entity_id}    ${CONTENT_TYPE_JSON}    ${ngsild_test_suite_context}

    Set Suite Variable  ${first_entity_id}
    Set Suite Variable  ${second_entity_id}

Delete Initial Entities
    Delete Entity by Id Returning Response   ${first_entity_id}
    Delete Entity by Id Returning Response   ${second_entity_id}
 No newline at end of file
Loading