Commit 81f0da80 authored by Houcem Kacem's avatar Houcem Kacem
Browse files

feat: improve assertions using a custom Compare Dictionaries Ignoring Keys keyword

parent 26deef4d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ Suite Setup Setup Initial Entities

*** Variable ***
${vehicule_id_prefix}=  urn:ngsi-ld:Vehicle:
${vehicle_payload_file}=  vehicule-temporal-representation-sample.jsonld
${vehicle_expectation_file}=  vehicle-temporal-representation-020-01-expectation.jsonld

*** Test Case ***
Retrieve the temporal evolution of an entity
@@ -16,15 +18,13 @@ Retrieve the temporal evolution of an entity

    Retrieve Temporal Representation Of Entity   ${temporal_entity_representation_id}

    @{expected_temporal_attributes}=  Create List   https://ngsi-ld-test-suite/context#speed   https://ngsi-ld-test-suite/context#fuelLevel

    Check Response Status Code Set To  200
    Check Response Body Containing EntityTemporal element       ${expected_temporal_attributes}
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}

    #TODO Call Delete Temporal Representation Of Entity

*** Keywords ***
Setup Initial Entities
    ${temporal_entity_representation_id}=     Generate Random Entity Id    ${vehicule_id_prefix}
    Create Temporal Representation Of Entity  vehicule-temporal-representation-sample.jsonld     ${temporal_entity_representation_id}
    Create Temporal Representation Of Entity  ${vehicle_payload_file}     ${temporal_entity_representation_id}
    Set Suite Variable  ${temporal_entity_representation_id}
+4 −4
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ Suite Setup Setup Initial Entities

*** Variable ***
${vehicule_id_prefix}=  urn:ngsi-ld:Vehicle:
${vehicle_payload_file}=  vehicule-temporal-representation-sample.jsonld
${vehicle_expectation_file}=  vehicle-temporal-representation-020-02-expectation.jsonld

*** Test Case ***
Retrieve the temporal evolution of an entity using a context
@@ -16,15 +18,13 @@ Retrieve the temporal evolution of an entity using a context

    Retrieve Temporal Representation Of Entity   ${temporal_entity_representation_id}   context=${ngsild_test_suite_context}

    @{expected_temporal_attributes}=  Create List   speed   fuelLevel

    Check Response Status Code Set To  200
    Check Response Body Containing EntityTemporal element       ${expected_temporal_attributes}
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}

    #TODO Call Delete Temporal Representation Of Entity

*** Keywords ***
Setup Initial Entities
    ${temporal_entity_representation_id}=     Generate Random Entity Id    ${vehicule_id_prefix}
    Create Temporal Representation Of Entity  vehicule-temporal-representation-sample.jsonld     ${temporal_entity_representation_id}
    Create Temporal Representation Of Entity  ${vehicle_payload_file}     ${temporal_entity_representation_id}
    Set Suite Variable  ${temporal_entity_representation_id}
+4 −2
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ Suite Setup Setup Initial Entities

*** Variable ***
${vehicule_id_prefix}=  urn:ngsi-ld:Vehicle:
${vehicle_payload_file}=  vehicule-temporal-representation-sample.jsonld
${vehicle_expectation_file}=  vehicle-temporal-representation-020-03-expectation.jsonld

*** Test Case ***
Retrieve the temporal evolution of certain attributes of an entity
@@ -18,12 +20,12 @@ Retrieve the temporal evolution of certain attributes of an entity
    Retrieve Temporal Representation Of Entity   ${temporal_entity_representation_id}   attrs=${temporal_attributes_to_be_retrieved}    context=${ngsild_test_suite_context}

    Check Response Status Code Set To  200
    Check Response Body Containing EntityTemporal element       ${temporal_attributes_to_be_retrieved}
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}

    #TODO Call Delete Temporal Representation Of Entity

*** Keywords ***
Setup Initial Entities
    ${temporal_entity_representation_id}=     Generate Random Entity Id    ${vehicule_id_prefix}
    Create Temporal Representation Of Entity  vehicule-temporal-representation-sample.jsonld     ${temporal_entity_representation_id}
    Create Temporal Representation Of Entity  ${vehicle_payload_file}     ${temporal_entity_representation_id}
    Set Suite Variable  ${temporal_entity_representation_id}
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ Retrieve the temporal evolution of an entity with the simplified temporal repres
    Retrieve Temporal Representation Of Entity   ${temporal_entity_representation_id}   options=${options}    context=${ngsild_test_suite_context}

    Check Response Status Code Set To  200
    Check Response Body Containing simplified temporal representation of EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}

    #TODO Call Delete Temporal Representation Of Entity

+43 −0
Original line number Diff line number Diff line
{
   "id":"urn:ngsi-ld:Vehicle:randomUUID",
   "type":"Vehicle",
   "https://ngsi-ld-test-suite/context#brandName":{
      "type":"Property",
      "value":"Volvo"
   },
   "https://ngsi-ld-test-suite/context#speed":[
      {
         "type":"Property",
         "value":120,
         "observedAt":"2018-08-01T12:03:00Z"
      },
      {
         "type":"Property",
         "value":80,
         "observedAt":"2018-08-01T12:05:00Z"
      },

      {
         "type":"Property",
         "value":100,
         "observedAt":"2018-08-01T12:07:00Z"
      }
   ],
   "https://ngsi-ld-test-suite/context#fuelLevel":[
      {
         "type":"Property",
         "value":67,
         "observedAt":"2018-08-01T12:03:00Z"
      },
      {
         "type":"Property",
         "value":53,
         "observedAt":"2018-08-01T13:05:00Z"
      },
      {
         "type":"Property",
         "value":40,
         "observedAt":"2018-08-01T14:07:00Z"
      }
   ]
}
 No newline at end of file
Loading