Commit 0c299392 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

fix: bunch of fixes in Temporal API Test Cases

parent ae5cbdf7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,10 +15,10 @@ ${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-samp
${bus_payload_file}=    2020-08-bus-temporal-representation-sample.jsonld

*** Test Cases ***    TIMEREL    TIMEAT                  EXPECTATION_FILE
After                 after      2020-08-01T12:05:00Z    vehicles-temporal-representation-021-01-01-expectation.jsonld
After                 after      2020-08-01T12:04:00Z    vehicles-temporal-representation-021-01-01-expectation.jsonld
                      [Tags]     te-query                5_7_4

Before                before     2020-09-01T13:05:00Z    vehicles-temporal-representation-021-01-02-expectation.jsonld
Before                before     2020-09-01T13:06:00Z    vehicles-temporal-representation-021-01-02-expectation.jsonld
                      [Tags]     te-query                5_7_4

*** Keywords ***
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ Query the temporal evolution of entities matching the given type(s)
    [Tags]    te-query    5_7_4
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Bus
    Query Temporal Representation Of Entities    entity_types=${entity_types_to_be_retrieved}    timerel=after    timeAt=2020-07-01T12:05:00Z    context=${ngsild_test_suite_context}
    @{temporal_entities_representation_ids}=    Create List    ${first_temporal_entity_representation_id}    ${second_temporal_entity_representation_id}
    @{temporal_entities_representation_ids}=    Create List    ${second_temporal_entity_representation_id}
    Check Response Status Code Set To    200
    Check Response Body Containing List Containing EntityTemporal elements    ${expectation_file}    ${temporal_entities_representation_ids}

+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ Query the temporal evolution of entities matching the given NGSI-LD query
    [Documentation]    Check that you can query the temporal evolution of entities matching the given NGSI-LD query
    [Tags]    te-query    5_7_4
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Vehicle
    Query Temporal Representation Of Entities    entity_types=${entity_types_to_be_retrieved}    ngsild_query=speed>90;brandName!=Mercedes    timerel=after    timeAt=2020-07-01T12:05:00Z    context=${ngsild_test_suite_context}
    Query Temporal Representation Of Entities    entity_types=${entity_types_to_be_retrieved}    ngsild_query=speed>90    timerel=after    timeAt=2020-07-01T12:05:00Z    context=${ngsild_test_suite_context}
    @{temporal_entities_representation_ids}=    Create List    ${first_temporal_entity_representation_id}    ${second_temporal_entity_representation_id}
    Check Response Status Code Set To    200
    Check Response Body Containing List Containing EntityTemporal elements    ${expectation_file}    ${temporal_entities_representation_ids}
+9 −12
Original line number Diff line number Diff line
@@ -9,37 +9,34 @@ Test Template Query the temporal evolution of entities with a limit to the n

*** Variable ***
${vehicule_id_prefix}=    urn:ngsi-ld:Vehicle:
${bus_id_prefix}=    urn:ngsi-ld:Bus:
${first_vehicle_payload_file}=    2020-08-vehicule-temporal-representation-sample.jsonld
${second_vehicle_payload_file}=    2020-09-vehicule-temporal-representation-sample.jsonld
${bus_payload_file}=    2020-08-bus-temporal-representation-sample.jsonld
${expectation_file}=    vehicles-temporal-representation-021-11-expectation.jsonld

*** Test Cases ***    LIMIT     EXPECTATION_FILE                                                 TEMPORAL_ENTITIES_REPRESENTATION_IDS
*** Test Cases ***    LIMIT
Query Some entities
                      ${2}      vehicles-temporal-representation-021-11-01-expectation.jsonld    ${first_temporal_entity_representation_id}    ${second_temporal_entity_representation_id}
                      ${2}
                      [Tags]    te-query                                                         5_7_4

Query All entities
                      ${20}     vehicles-temporal-representation-021-11-02-expectation.jsonld    ${first_temporal_entity_representation_id}    ${second_temporal_entity_representation_id}    ${third_temporal_entity_representation_id}
                      ${3}
                      [Tags]    te-query                                                         5_7_4

*** Keywords ***
Query the temporal evolution of entities with a limit to the number of entities to be retrieved
    [Arguments]    ${limit}    ${expectation_file}    @{temporal_entities_representation_ids}
    [Arguments]    ${limit}
    [Documentation]    Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Bus
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Bus,Vehicle
    Query Temporal Representation Of Entities    entity_types=${entity_types_to_be_retrieved}    limit=${limit}    timerel=after    timeAt=2020-07-01T12:05:00Z    context=${ngsild_test_suite_context}
    Check Response Status Code Set To    200
    Check Response Body Containing List Containing EntityTemporal elements    ${expectation_file}    ${temporal_entities_representation_ids}
    Check Response Body Containing Number Of Entities   Vehicle     ${limit}

Setup Initial Entities
    ${first_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicule_id_prefix}
    ${second_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicule_id_prefix}
    ${third_temporal_entity_representation_id}=    Generate Random Entity Id    ${bus_id_prefix}
    ${third_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicule_id_prefix}
    Create Temporal Representation Of Entity    ${first_vehicle_payload_file}     ${first_temporal_entity_representation_id}
    Create Temporal Representation Of Entity    ${second_vehicle_payload_file}    ${second_temporal_entity_representation_id}
    Create Temporal Representation Of Entity    ${bus_payload_file}    ${third_temporal_entity_representation_id}
    Create Temporal Representation Of Entity    ${second_vehicle_payload_file}    ${third_temporal_entity_representation_id}
    Set Suite Variable    ${first_temporal_entity_representation_id}
    Set Suite Variable    ${second_temporal_entity_representation_id}
    Set Suite Variable    ${third_temporal_entity_representation_id}
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ Before entity-operations-before-query.jsonld vehicles-temporal
Query the temporal evolution of entities using the entityOperations method
    [Arguments]    ${payload_file}    ${expectation_file}
    [Documentation]    Check that you can query the temporal evolution of entities using the entityOperations method
    Query Temporal Representation Of Entities Via Post    ${payload_file}
    Query Temporal Representation Of Entities Via Post    ${payload_file}   context=${ngsild_test_suite_context}
    @{temporal_entities_representation_ids}=    Create List    ${first_temporal_entity_representation_id}    ${second_temporal_entity_representation_id}
    Check Response Status Code Set To    200
    Check Response Body Containing List Containing EntityTemporal elements    ${expectation_file}    ${temporal_entities_representation_ids}
Loading