Commit 185972f0 authored by poujol's avatar poujol
Browse files

Merge branch 'chore/review-all-set-up-and-teardown-with-a-common-behaviour' into 'develop'

chore: review all set up and teardown with a common behaviour

See merge request cim/ngsi-ld-test-suite!81
parents 332c6373 635d2c57
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


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




@@ -38,7 +38,7 @@ Setup Initial Entities
    ...    ${entity_id}
    ...    ${entity_id}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${ngsild_test_suite_context}
    ...    ${ngsild_test_suite_context}
    Set Suite Variable    ${entity_id}
    Set Test Variable    ${entity_id}


Delete Initial Entities
Delete Initial Entities
    Delete Entity by Id Returning Response    ${entity_id}
    Delete Entity by Id Returning Response    ${entity_id}
+4 −4
Original line number Original line Diff line number Diff line
@@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Setup         Setup Initial Entities
Test Setup          Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Teardown       Delete Initial Entities
Test Template       Retrieve Available Entity Types
Test Template       Retrieve Available Entity Types




@@ -46,8 +46,8 @@ Setup Initial Entities
    ...    ${second_entity_id}
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${ngsild_test_suite_context}
    ...    ${ngsild_test_suite_context}
    Set Suite Variable    ${first_entity_id}
    Set Test Variable    ${first_entity_id}
    Set Suite Variable    ${second_entity_id}
    Set Test Variable    ${second_entity_id}


Delete Initial Entities
Delete Initial Entities
    Delete Entity by Id Returning Response    ${first_entity_id}
    Delete Entity by Id Returning Response    ${first_entity_id}
+3 −3
Original line number Original line Diff line number Diff line
@@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


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




@@ -38,7 +38,7 @@ Setup Initial Entities
    ...    ${entity_id}
    ...    ${entity_id}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${ngsild_test_suite_context}
    ...    ${ngsild_test_suite_context}
    Set Suite Variable    ${entity_id}
    Set Test Variable    ${entity_id}


Delete Initial Entities
Delete Initial Entities
    Delete Entity by Id Returning Response    ${entity_id}
    Delete Entity by Id Returning Response    ${entity_id}
+4 −4
Original line number Original line Diff line number Diff line
@@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Setup         Setup Initial Entities
Test Setup          Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Teardown       Delete Initial Entities
Test Template       Retrieve Details Of Available Entity Types
Test Template       Retrieve Details Of Available Entity Types




@@ -46,8 +46,8 @@ Setup Initial Entities
    ...    ${second_entity_id}
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${ngsild_test_suite_context}
    ...    ${ngsild_test_suite_context}
    Set Suite Variable    ${first_entity_id}
    Set Test Variable    ${first_entity_id}
    Set Suite Variable    ${second_entity_id}
    Set Test Variable    ${second_entity_id}


Delete Initial Entities
Delete Initial Entities
    Delete Entity by Id Returning Response    ${first_entity_id}
    Delete Entity by Id Returning Response    ${first_entity_id}
+6 −2
Original line number Original line Diff line number Diff line
@@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Teardown      Delete Entities



*** Variables ***
*** Variables ***
${building_id_prefix}=      urn:ngsi-ld:Building:
${building_id_prefix}=      urn:ngsi-ld:Building:
@@ -18,18 +20,21 @@ Query several entities based on ids
    [Documentation]    Check that you can query several entities based on ids
    [Documentation]    Check that you can query several entities based on ids
    [Tags]    e-query    5_7_2
    [Tags]    e-query    5_7_2
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${first_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${first_entity_id}
    ...    ${first_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${response.status_code}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${second_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${second_entity_id}
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${response.status_code}
    ${third_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${third_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${third_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${third_entity_id}
    ...    ${third_entity_id}
@@ -46,12 +51,11 @@ Query several entities based on ids
    ...    ${expectation_filename}
    ...    ${expectation_filename}
    ...    ${entities_ids_to_be_compared}
    ...    ${entities_ids_to_be_compared}
    ...    ${response.json()}
    ...    ${response.json()}
    [Teardown]    Delete Entities    ${first_entity_id}    ${second_entity_id}    ${third_entity_id}





*** Keywords ***
*** Keywords ***
Delete Entities
Delete Entities
    [Arguments]    ${first_entity_id}    ${second_entity_id}    ${third_entity_id}
    Delete Entity by Id Returning Response    ${first_entity_id}
    Delete Entity by Id Returning Response    ${first_entity_id}
    Delete Entity by Id Returning Response    ${second_entity_id}
    Delete Entity by Id Returning Response    ${second_entity_id}
    Delete Entity by Id Returning Response    ${third_entity_id}
    Delete Entity by Id Returning Response    ${third_entity_id}
Loading