diff --git a/README.md b/README.md index 5c314cd01fb1f2c4dfe21093a41f7b9694eebc80..b4925e6f8ffa1fdc35ccb03c8eed46a15abc7607 100644 --- a/README.md +++ b/README.md @@ -107,14 +107,6 @@ Launch the tests with the following command: For more running instructions please consult [scripts/run_tests.sh](./scripts/run_tests.sh). -## Generate metrics from the tests results - -Optionally, you can generate metrics from the results of tests: - -```$ robotmetrics --inputpath -k True -s True``` - -A sample report can be seen at https://robotmetrics.netlify.app/# - ## Generate a documentation for the support keywords ```$ python3 -m robot.libdoc resources/ApiUtils.resource api_docs/ApiUtils.html``` @@ -126,11 +118,10 @@ A sample report can be seen at https://robotmetrics.netlify.app/# # Frameworks and libraries used in the project * [Robot Framework](https://github.com/robotframework/robotframework) -* [RESTinstance](https://github.com/asyrjasalo/RESTinstance) -* [JSON Schema Library](https://github.com/jstaffans/robotframework-jsonschemalibrary) * [JSON Library](https://github.com/robotframework-thailand/robotframework-jsonlibrary) * [Requests Library](https://github.com/MarketSquare/robotframework-requests) * [Deep Diff](https://github.com/seperman/deepdiff) +* [HttpCtrl Library](https://github.com/annoviko/robotframework-httpctrl) * [Robotidy Library ](https://github.com/MarketSquare/robotframework-tidy) # Useful links diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 3643488adeca45020f32cc0900f8efc7be846988..62b9ef0ab834abdd56af15d1a0ea4629e846e903 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -23,15 +23,15 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Documentation] Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity) [Tags] e-create 5_2_2 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id ${entity_id} 043_02 Create subscription @@ -39,11 +39,11 @@ ${registration_filename}= csourceRegistrations/context-source-registration [Tags] sub-create 5_2_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Subscription ${subscription_id} 043_03 Create Temporal Representation of Entities @@ -54,11 +54,11 @@ ${registration_filename}= csourceRegistrations/context-source-registration ... ${temporal_entity_representation_id} ... ${tea_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} 043_04 Batch entity create @@ -69,12 +69,12 @@ ${registration_filename}= csourceRegistrations/context-source-registration ${first_entity}= Load Entity ${building_filename} ${first_entity_id} ${second_entity}= Load Entity ${building_filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To ${expected_status_code} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Batch Delete Entities @{entities_to_be_created} 043_05 Create context source registration @@ -83,7 +83,6 @@ ${registration_filename}= csourceRegistrations/context-source-registration ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code ${expected_status_code} ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code ${expected_status_code} ${response.status_code} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 32b3ecf94c7da3bb6010bad0e681711fd58a8537..279678cdeb25c09375234f5f2a28bc6e5fa5f6af 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -21,18 +21,18 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${vehicle_fragment} ... ${CONTENT_TYPE_MERGE_PATCH_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} [Teardown] Delete Entity by Id ${entity_id} 044_01_02_endpoint /subscriptions/{subscriptionId} @@ -40,11 +40,11 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp [Tags] sub-update 6_3_4 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Update Subscription ... ${subscription_id} ... ${subscription_fragment} ... ${CONTENT_TYPE_MERGE_PATCH_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 475f650890ae640b7b068fad20a94be2e6165f1c..f8e87f4bc4b97db6209e9e2bc5fc125064992e5a 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -25,15 +25,15 @@ ${content_type}= application/json [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) [Tags] e-query 6_3_4 ${id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* - Check Response Status Code 200 ${response['status']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ${id} context=${ngsild_test_suite_context} accept=*/* + Check Response Status Code 200 ${response.status_code} + Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Entity by Id Returning Response ${id} 044_02_02_endpoint /subscriptions/{subscriptionId} @@ -41,11 +41,11 @@ ${content_type}= application/json [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Retrieve Subscription ${id} accept=*/* - Check Response Status Code 200 ${response['status']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Subscription ${id} accept=*/* + Check Response Status Code 200 ${response.status_code} + Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Subscription ${id} 044_02_03_endpoint /csourceRegistrations/ @@ -54,16 +54,16 @@ ${content_type}= application/json ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Context Source Registrations With Return + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Context Source Registrations With Return ... id=${registration_id} ... type=${registration_type} ... context=${ngsild_test_suite_context} ... accept=*/* - Check Response Status Code 200 ${response['status']} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Status Code 200 ${response.status_code} + Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Context Source Registration ${registration_id} 044_02_04_endpoint /temporal/entities @@ -74,15 +74,15 @@ ${content_type}= application/json ... ${temporal_entity_representation_id} ... ${tea_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Temporal Representation Of Entities With Return + Check Response Status Code 201 ${response.status_code} + ${response}= Query Temporal Representation Of Entities With Return ... entity_types=${teatype} ... timerel=after ... timeAt=2020-08-01T12:05:00Z ... context=${ngsild_test_suite_context} ... accept=*/* - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Set Test Variable ${response} - Check Response Headers Containing Content-Type set to ${response} ${content_type} - Check Response Headers Link Not Empty ${response} + Check Response Headers Containing Content-Type set to ${response.headers} ${content_type} + Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index f0b6139347ba4cb93ff67267c062b66b28a86792..306335d6cf974d64f66c0131b9cdfdef3d282046 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -26,17 +26,17 @@ ${content_type}= application/xml [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) [Tags] ea-partial-update 6_3_4 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${vehicle_attribute} ... ${vehicle_fragment} ... ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${entity_id} 044_03_02_endpoint patch /subscriptions/{subscriptionId} @@ -44,20 +44,20 @@ ${content_type}= application/xml [Tags] sub-update 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Update Subscription ${id} ${subscription_fragment} ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Subscription ${id} 044_03_03_endpoint post /entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) [Tags] e-create 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Entity by Id ${entity_id} 044_03_04_endpoint post /subscriptions/ @@ -65,7 +65,7 @@ ${content_type}= application/xml [Tags] sub-create 6_3_4 ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Subscription ${subscriptions_id} 044_03_05_endpoint post /entityOperations/create @@ -76,9 +76,9 @@ ${content_type}= application/xml ${first_entity}= Load Entity ${building_filename} ${first_entity_id} ${second_entity}= Load Entity ${building_filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - Batch Create Entities @{entities_to_be_created} content_type=${content_type} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${content_type} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 415 + Check Response Status Code 415 ${response.status_code} [Teardown] Batch Delete Entities @{expected_entities_ids} 044_03_06_endpoint post /temporal/entities/ @@ -89,5 +89,5 @@ ${content_type}= application/xml ... ${temporal_entity_representation_id} ... ${tea_filename} ... ${content_type} - Check Response Status Code 415 ${response['status']} + Check Response Status Code 415 ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index 1f8b1b7ea3b37e680b3e346609aef5b0efabb463..b0670b2a9482a5160ec776ee5c96a71188dc3caf 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -20,13 +20,13 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId}) [Tags] e-query 6_3_4 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ${entity_id} accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${entity_id} 044_04_02_endpoint get /subscriptions/{subscriptionId} @@ -34,30 +34,30 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Retrieve Subscription ${id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Subscription ${id} accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Subscription ${id} 044_04_03_endpoint get /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) [Tags] csr-query 6_3_4 - ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} 044_04_04_endpoint get /csourceSubscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) [Tags] csrsub-query Query Context Source Registration Subscriptions accept=${accept} - Check Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} 044_04_05_endpoint get /temporal/entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-08-01T12:05:00Z ... accept=${accept} - Check Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index 20f32c376cb2068392657a4a27b9bd4af5a176c8..c7bd6dcc410e4e42999d18028ab6549caedd0267 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -19,24 +19,24 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Retrieve Subscription ${id} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Subscription ${id} accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Subscription ${id} 044_05_02 Query temporal entities [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) [Tags] te-query 6_3_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-08-01T12:05:00Z ... accept=${accept} - Check Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} 044_05_03 Query context source registration [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations) [Tags] csr-query 6_3_4 - ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} - Check Response Status Code ${status_code} ${response['status']} + ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot index cf01a3124055072551cb948de2532d43c66c58b6..889a5c5eeb03f197aa400a4b0c23d5e6e61656d2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot @@ -18,12 +18,13 @@ ${filename}= building-simple-attributes-sample.json Retrieve Detailed Representation Of Available Attribute Without Context [Documentation] Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute [Tags] ed-attr 5_7_10 - Retrieve Attribute attribute_name=airQualityLevel - Check Response Status Code Set To 404 + ${response}= Retrieve Attribute attribute_name=airQualityLevel + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot index c2fb70836544878b54107f035bdd613cb22c8b49..1a2f0f77b6f0107a7ebfd94e33c0b66b7381af9e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot @@ -19,8 +19,8 @@ ${expectation_file}= types/expectations/attribute-027-01-expectation.json Retrieve Detailed Representation Of Available Attribute [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes [Tags] ed-attr 5_7_10 - Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Attribute element ${expectation_file} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot index 17bb74b3ee7ef7b9ed3618ba70f884d9b57c29ce..c611457b77438619949bfcf6fbdb6514c564b24f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributes/025_01.robot @@ -27,8 +27,8 @@ WithJsonLdContext [Tags] ed-attrs 5_7_8 Retrieve Available Attributes [Documentation] Check that you can retrieve a list of NGSI-LD attributes [Arguments] ${context} ${expectation_file} - Retrieve Attributes ${context} - Check Response Status Code Set To 200 + ${response}= Retrieve Attributes ${context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing AttributeList element ${expectation_file} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot index 2ba0b2bf52f229c4f01efb1d446576197034e8e4..f45a563b066805f7d1aa916a871522fd8503b60c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot @@ -18,12 +18,13 @@ ${filename}= building-simple-attributes-sample.json 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] ed-type 5_7_7 - Retrieve Entity Type type=Building - Check Response Status Code Set To 404 + ${response}= Retrieve Entity Type type=Building + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot index 761260d91325193659882abb4d8400f7b6ac5a68..33d7f30e89171591a912b1333787ceabccca2fc0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot @@ -19,8 +19,8 @@ ${expectation_file}= types/expectations/entity-type-info-024-01-expectati Retrieve Detailed Representation Of Available Entity Type [Documentation] Check that you can retrieve a detailed representation of a specified NGSI-LD entity type [Tags] ed-type 5_7_7 - Retrieve Entity Type type=Building context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Entity Type type=Building context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTypeInfo element ${expectation_file} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot index 22b2d42a478d06d09c2b411872083bcdba194683..0089b75bc2636268414b15eb017043ae1a219a19 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypes/022_01.robot @@ -29,8 +29,8 @@ WithJsonLdContext [Tags] ed-types 5_7_5 Retrieve Available Entity Types [Documentation] Check that you can retrieve a list of NGSI-LD entity types [Arguments] ${context} ${expectation_file} - Retrieve Entity Types ${context} - Check Response Status Code Set To 200 + ${response}= Retrieve Entity Types ${context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTypeList element ${expectation_file} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot index 77ac8a2d6f00314b0ae66ad3424b0701c53fb44f..ff3c65112ba3e97fb5d8e4e089fd1b6a3b2caaf0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableAttributes/026_01.robot @@ -27,8 +27,8 @@ WithJsonLdContext [Tags] ed-attrs-details 5_7_9 Retrieve Details Of Available Attributes [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD attributes [Arguments] ${context} ${expectation_file} - Retrieve Attributes context=${context} details=${TRUE} - Check Response Status Code Set To 200 + ${response}= Retrieve Attributes context=${context} details=${TRUE} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Attribute element ${expectation_file} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot index 3f76ca0e3feeb41b08326c2d74c1427e8c7dd91c..b725e55a6856523bdcf05e4b7947149285fbc558 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveDetailsOfAvailableEntityTypes/023_01.robot @@ -29,8 +29,8 @@ WithJsonLdContext [Tags] ed-types-details 5_7_6 Retrieve Details Of Available Entity Types [Documentation] Check that you can retrieve a list with a detailed representation of NGSI-LD entity types [Arguments] ${context} ${expectation_file} - Retrieve Entity Types context=${context} details=${TRUE} - Check Response Status Code Set To 200 + ${response}= Retrieve Entity Types context=${context} details=${TRUE} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityType element ${expectation_file} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot index 6a44b0d9cf373f5f24c88461034d4becab7cc12e..d09a2f728aa9d98e603ec480aed20bc83fc1325b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot @@ -18,34 +18,34 @@ Query several entities based on ids [Documentation] Check that you can query several entities based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot index a33dd671fd6a21bc336227303f129dc8988d2991..5656a2ff5c350a3f11a592ffcd30fe468308c59c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_02.robot @@ -24,31 +24,31 @@ Query several entities based on the entities types [Documentation] Check that you can query several entities based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${parking_filename} ... ${parking_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} accept=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${vehicle_entity_id} ${parking_entity_id} Check Response Body Containing List Containing Entity Elements With Different Types ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot index e4dece98b0fd5994b4168c78ead7da2958a08a42..fbd386434d463eb8f44bf327a0263ce37720b72b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot @@ -19,27 +19,27 @@ Query several entities based on the given id pattern [Documentation] Check that you can query several entities based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @{entities_ids_to_be_compared}= Create List ${second_entity_id} ${first_entity_id} ${response}= Query Entities ... entity_id_pattern=${entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot index 1cdc121f3338f860c40c89512c271b1cc6df35aa..064080b45b68969cce57dcd2f17f725912034e40 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot @@ -21,28 +21,28 @@ Query several entities based on attribute names [Documentation] Check that you can query several entities based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename2} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} ... ${attribute_subcategory} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot index 754d15c24a01810b7ab5904a3a69f3424dfcc7e1..84abf53912ba2f689f9748fe59b8ee6f58826ecf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_05.robot @@ -19,17 +19,17 @@ Query several entities based on a list of properties [Documentation] Check that you can query entitites based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -37,11 +37,11 @@ Query several entities based on a list of properties ... entity_types=${entity_types_to_be_retrieved} ... geoproperty=${geometry_property} ... accept=${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot index f27065ef50d6474e4e4917df00b6a3670ae24f0e..dbb050fb16b0ff46db0e1035d3de533fc4df188e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot @@ -18,34 +18,34 @@ Query several entities via POST Interaction based on ids [Documentation] Check that you can query several entities via POST Interaction based on ids [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities Via POST + ${response}= Query Entities ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot index 854ba8a4b7266648e9c19be6c13a5a20284a9961..edf911adf2dfccbdc1ef206e3e1ece2a68772dc6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_02.robot @@ -24,31 +24,31 @@ Query several entities via POST Interaction based on the entities types [Documentation] Check that you can query several entities via POST Interaction based on the entities types [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${parking_filename} ... ${parking_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entity_types_to_be_compared}= Create List ${vehicle_entity_type} ${parking_entity_type} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} - ${response}= Query Entities Via POST entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entity_types_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} ${parking_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot index 32450318c67bbb8aab58abd339bdb3ae097fafe9..6643c88e89a48fc5dd7bd0c730cb44a70c0618c9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot @@ -19,27 +19,27 @@ Query several entities via POST Interaction based on the given id pattern [Documentation] Check that you can query several entities via POST Interaction based on the given id pattern [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities Via POST + ${response}= Query Entities ... entity_id_pattern=${entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index bc09646de39b302c7df3140e1947ddbc89f8a751..90fbe9b16a90a7cce01b38aaa7e25b7272b2dbc4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -19,28 +19,28 @@ Query several entities via POST Interaction based on attribute names [Documentation] Check that you can query several entities via POST Interaction based on attribute names [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} ... ${attribute_subcategory} @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} - ${response}= Query Entities Via POST attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} + ${response}= Query Entities attrs=${attributes_to_be_retrieved} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_retrieved} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index b4d9dfe6ccee771c64f86161974194f6dbbf303e..9b5473cf9f5da362c049f2e629396d22edc2f0c1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -19,27 +19,27 @@ Query several entities via POST Interaction based on a list of properties [Documentation] Check that you can query entitites via POST Interaction based on a list of properties [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} @{entity_types_to_be_retrieved}= Create List ${entity_type} - ${response}= Query Entities Via POST + ${response}= Query Entities ... entity_types=${entity_types_to_be_retrieved} ... geoproperty=${geometry_property} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot index 1538368d06bd709f75e68b6ab869d7b91949a4a4..23f067acc4c046822fe0cd58ba284887eb59313d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot @@ -19,27 +19,27 @@ Query entities based on incorrect ids [Documentation] Check that you cannot query entities if the requested ids are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${entity_invalid_id_one} ${entity_invalid_id_two} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot index c6e8d8d253ebd59caead8b67df9375c62a1ea0f8..e324a59711ceb279ff64f4179b113b080910ba04 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot @@ -20,27 +20,27 @@ Query entities based on incorrect entity types [Documentation] Check that you cannot query entities if the requested entity types are incorrect [Tags] e-query 5_7_2 ${building_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${building_filename} ... ${building_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${invalid_entity_type_one} ... ${invalid_entity_type_two} ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${building_entity_id} ${vehicle_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot index 2ab80b97e25a94b28620df61022c83bbb784f2a3..64d4749a6d9549704c4efe3ff0cc34da17b3a33b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot @@ -18,26 +18,26 @@ Query several entities based on incorrect id pattern [Documentation] Check that you cannot query entities if the requested id pattern is incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_id_pattern=${invalid_entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 12ab098d9448bf8a037fd3793727b0231c5ff678..3e1334d6774b79323345e9da6a6e8bdc488cb62f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -19,24 +19,24 @@ Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${invalid_attribute_one} ${invalid_attribute_two} ${response}= Query Entities attrs=${attributes_to_be_retrieved} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index 1f1255e1bd6d7ae9af21de2aa79bc44db99ac56c..a3bc398783d88c9f38ef43bb84d3cf750c596bd6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -21,17 +21,17 @@ Query entitites when the request has a wrong geometryProperty [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} ${response}= Query Entities ... entity_types=${entity_types_to_be_retrieved} @@ -40,11 +40,11 @@ Query entitites when the request has a wrong geometryProperty ... geometry=${geometry} ... coordinates=${coordinates} ... context=${ngsild_test_suite_context} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot index 9cb3a2af30373ea2f8f0544a2b664135736f7a7d..fdf6a3b96a100c14ad23fe812dd02578afb16f07 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -19,23 +19,23 @@ Query entities in a simplified representation [Documentation] Check that the queried entities by Id can be returned in a simplified representation [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -43,11 +43,11 @@ Query entities in a simplified representation ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} ... options=${options_parameter} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index b903862fe4b5bfa7da28c411dfb9736574bbe4b4..65a42cffd276d43a8b7c8ce34124dfd4b71affbd 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -19,23 +19,23 @@ Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entities by id can be returned in a geoJSON format [Tags] e-query 6_3_7 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} ${entities_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} @@ -43,11 +43,11 @@ Get an entity by id that can be returned in a geoJSON format ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} ... accept=${accept_header} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Entity elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} - ... ${response['body']} + ... ${response.json()} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot index 7d239a2989dd51aa6e7d6a14c3fbfd5e3ec89a68..449cd3a999c03cf24edefa7b7bc6016d5aa168de 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -18,23 +18,23 @@ Query entities specifying a maximum number of results [Documentation] Check that you can query entities specifying a maximum number of results [Tags] e-query 6_3_10 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${second_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${third_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${entities_ids_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${first_entity_id} @@ -45,7 +45,7 @@ Query entities specifying a maximum number of results ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} ... limit=${limit} - Check Response Status Code 200 ${response['status']} + Check Response Status Code 200 ${response.status_code} @{entities_ids_to_be_compared}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Number Of Entities ${entity_type} ${2} [Teardown] Delete Entities ${first_entity_id} ${second_entity_id} ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot index 981201953ea247704fdbcde7450a187699704562..aa405bc92e28efa0a951a9e884a9206979dd6a5e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot @@ -17,12 +17,12 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld [Documentation] Check that you can get an entity by id [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot index 88ea67fa7f3543126d374746a8f847ddd87e41a2..b7fbc456635eda5e3ea1b3e0890c4d7856c664a8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_02.robot @@ -19,19 +19,19 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego [Documentation] Check that you can query some attributes from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate ... SEPARATOR=, ... ${attribute_airqualitylevel} ... ${attribute_subcategory} - ${request} ${response}= Query Entity + ${response}= Query Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... attrs=${attributes_to_be_retrieved} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot index 2b311a5ac9bcb69c59dd93b33506b2a67eb47cd9..a8fa27b2989ab5852b93a1ce5e90e9017ae0d1d4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_03.robot @@ -18,15 +18,15 @@ ${geometry_property}= location [Documentation] Check that you can query the geometry property from an entity [Tags] e-retrieve 5_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... geoproperty=${geometry_property} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot index 2ba3ed123cce86f364158791abbd88c8a742cda0..b8ab4a7ed6ff66339fe80e4043e1826b4cae6a5b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -19,9 +19,9 @@ Get Entity With Invalid/Missing Id [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] e-retrieve 5_7_1 [Arguments] ${entity_id} ${expected_status_code} ${problem_type} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${expected_status_code} ${response['status']} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot index 56ef5bb58717ffb9cbb99eef76c60cbf747a8be3..f73abb0f129b67c3cedee7a7fc9a54064d644978 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_01.robot @@ -15,9 +15,9 @@ Get an entity if the Entity Id is not known to the system [Documentation] Check that you cannot get an entity if the entity id or attributes are not known to the system [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot index 630c67548202fa5dbfa5350851599a1490fbea56..1e3d05d1d6838333de5d9f7a15f27b955d09f78f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_03_02.robot @@ -17,19 +17,19 @@ Get an entity if an attribute is not known to the system [Documentation] Check that you cannot get an entity if an attribute is not known to the system [Tags] e-retrieve 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${attributes_to_be_retrieved}= Catenate SEPARATOR=, ${attribute_not_known} - ${request} ${response}= Query Entity + ${response}= Query Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... attrs=${attributes_to_be_retrieved} - Check Response Status Code 404 ${response['status']} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index 1370d9c267cc5407263f3c20290a82d9275f757a..75c6fd20f9c86ef3d7b2fb2d4be1b1929144c313 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -18,15 +18,15 @@ Get an entity in a simplified representation [Documentation] Check that the queried entity by Id can be returned in a simplified representation [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... options=${options_parameter} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response['body']} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index 5d5eb85468e69e7d4b28a834c9a0ecdaa74d94c5..45cfc1e89a7067b231b516e6d645979f65b3c299 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -19,12 +19,12 @@ Get an entity by id that can be returned in a geoJSON format [Documentation] Check that the queried entity by id can be returned in a geoJSON format [Tags] e-retrieve 6_3_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response} + Check Response Status Code 201 ${response.status_code} + ${response}= Query Entity ${entity_id} ${accept_header} options=${options_parameter} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot index 40246d08d5690a78ba8206decec09d748887ec6e..00915f13a2f66c5000e886eea8476a883b9ba49f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -30,9 +30,9 @@ CreationTimeJsonLdContext Check JSON-LD Resolution When retrieving an entity [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present [Arguments] ${context} ${expected_payload} - ${request} ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} - Check Response Status Code 200 ${response['status']} - Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response['body']} + ${response}= Query Entity ${entity_id} ${CONTENT_TYPE_JSON} context=${context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expected_payload} ${entity_id} ${response.json()} Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index 1d280eb4cc05dd9448230bfef95fcd6057f707db..2501434ad59e20ebb0b66367f8c59b25a168339c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -30,7 +30,7 @@ Query the temporal evolution of entities [Documentation] Check that you can query the temporal evolution of entities [Arguments] ${timerel} ${timeAt} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=${timerel} ... timeAt=${timeAt} @@ -38,7 +38,7 @@ Query the temporal evolution of entities @{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 Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index 73695a9d335256450d463d46f266f457909fef4b..af1dd0992bfb6665a2f8c7c420ef78deaefa5344 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -22,7 +22,7 @@ Query the temporal evolution of certain attributes of entities [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${temporal_attributes_to_be_retrieved}= Catenate SEPARATOR=, speed - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z @@ -31,7 +31,7 @@ Query the temporal evolution of certain attributes of entities @{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 Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index b48e938e62d48dfd128dac580a5a077556d787da..0fbed90c43a3969082b76491ae57e89629899c56 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -21,7 +21,7 @@ Query the temporal evolution of the last N instances of entities attributes [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z @@ -30,7 +30,7 @@ Query the temporal evolution of the last N instances of entities attributes @{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 Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot index 8ad92735c4a182958b213ce340556ebca70c5cb2..30a92bf32fb36bdfd4dff3c875c9ca9951d12a78 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -21,7 +21,7 @@ Query the temporal evolution of entities using a context [Documentation] Check that you can query the temporal evolution of entities using a context [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z @@ -29,7 +29,7 @@ Query the temporal evolution of entities using a 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 Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot index f6809bec705c40053f2be8d2021e80fe3147d364..1d6c2d16ca008f856a0ac978e33666e12a09499e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -22,13 +22,13 @@ Query the temporal evolution of entities matching the given type(s) [Documentation] Check that you can 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 + ${response}= 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 ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index 67c5a413901369abbb24148fe003530846b87711..59e25190e7a7ec446111c4798ca9fec8ca1a72b8 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -22,14 +22,14 @@ Query the temporal evolution of entities matching the given identifier(s) [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle ${entity_ids_to_be_retrieved}= Catenate SEPARATOR=, ${first_temporal_entity_representation_id} - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... entity_ids=${entity_ids_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} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot index c6ef14aab6bd94c76d16807c7abc98dedd3fc611..b4075e657aefd3dd9912fe863b0d8e8b90337c3b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -21,7 +21,7 @@ Query the temporal evolution of entities matching the given id pattern [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... entity_id_pattern=urn:ngsi-ld:Vehicle:.* ... timerel=after @@ -30,7 +30,7 @@ Query the temporal evolution of entities matching the given id pattern @{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 Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot index 8ea5288c7c9a725310c517eeafecceac65e28b8d..4d1efb4da5504c35d96247341b092399f6a386f6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -21,7 +21,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 + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... ngsild_query=speed>90 ... timerel=after @@ -30,7 +30,7 @@ Query the temporal evolution of entities matching the given NGSI-LD query @{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 Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index 7d2f24abc85814252fe50f50782a1b05c80b0244..5269eb3963f5c6b0c995e1875ec68792ba06c4a3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -29,7 +29,7 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... georel=${georel} ... geometry=${geometry} @@ -39,7 +39,7 @@ Query the temporal evolution of entities matching the given NGSI-LD geo-query ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot index 544dc92366e0018500464cafd6ef6d3108fefc06..062f404ff1d014082d325dd08b0e6966774ff2cf 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -21,14 +21,15 @@ Query the temporal evolution of entities matching the given NGSI-LD context sour [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD Context Source filter [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Building - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... entity_types=${entity_types_to_be_retrieved} ... csf=endpoint=="${context_source_url}" ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} Wait for redirected request - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot index 2b30e80d132b4ac833fd97588fda421264905849..5e0e25debeb907dacd9323c0c22eff93e3ee164a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_11.robot @@ -30,13 +30,13 @@ Query the temporal evolution of entities with a limit to the number of entities [Documentation] Check that you can query the temporal evolution of entities with a limit to the number of entities to be retrieved [Arguments] ${limit} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Bus,Vehicle - Query Temporal Representation Of Entities + ${response}= 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 Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Vehicle ${limit} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot index dfed8f790d6d42587b888267bfd42d776f93b5d6..d52e17b8a12bbabd8a22ee16f5f9dec22fd0149b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -18,15 +18,16 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json Query the temporal evolution of entities with an invalid request [Documentation] Check that you cannot query the temporal evolution of entities with an invalid request [Tags] te-query 5_7_4 - Query Temporal Representation Of Entities + ${response}= Query Temporal Representation Of Entities ... timerel=after ... timeAt=2020-07-01T12:05:00Z ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot index 2f86519491ebbf246bd1772ef4c9460879f59dc5..54963f57f95df50e5fbd86740d16dca3f14cdd6f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_13.robot @@ -27,11 +27,13 @@ Before [Tags] te-query 5_7_4 Query the temporal evolution of entities using the entityOperations method [Documentation] Check that you can query the temporal evolution of entities using the entityOperations method [Arguments] ${payload_file} ${expectation_file} - Query Temporal Representation Of Entities Via Post ${payload_file} context=${ngsild_test_suite_context} + ${response}= 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 Status Code 200 ${response.status_code} Check Response Body Containing List Containing EntityTemporal elements ... ${expectation_file} ... ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 884d204629467d3e43c3de77784e442a73b13373..95c4e17b13cd21188d4c493997c0aeb33d40daa4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -19,8 +19,8 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectati Retrieve the temporal evolution of an entity [Documentation] Check that you can retrieve the temporal evolution of an entity [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} - Check Response Status Code Set To 200 + ${response}= Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index bd965bf3ea091d3e1d7a824c85766832a6a54ca3..0d3d4f9bde7bd6d481a8116482e05e7be0ed0382 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -19,10 +19,10 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectati Retrieve the temporal evolution of an entity using a context [Documentation] Check that you can retrieve the temporal evolution of an entity using a context [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 16ad9623536e1db9b0388607a7faa681dd1e9701..b4d586e0f5fb9af4bf75017524fd94c39d8eca66 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -20,11 +20,11 @@ Retrieve the temporal evolution of certain attributes of an entity [Documentation] Check that you can retrieve the temporal evolution of certain attributes of an entity [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List fuelLevel - Retrieve Temporal Representation Of Entity + ${response}= 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 Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 8e5789b99c36e8e74beca4412e49e2b2778ff091..d1ecd7b61bad3c5a4d2d79cefd1569b466fbcf9c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -28,13 +28,13 @@ Between [Tags] te-retrieve 5_7_3 Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... timerel=${timerel} ... timeAt=${timeAt} ... endTimeAt=${endTimeAt} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 274a150b103c9c36d690d4f8241220b0f7c5e691..0a07a3acba5d31986400d7a803e631dadbb87255 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -28,11 +28,11 @@ Retrieve All Instances Retrieve the temporal evolution of the last N instances of entity attributes [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes [Arguments] ${lastN} ${vehicle_expectation_file} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... lastN=${lastN} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot index 7cfec33b03446734c91a33ffb075df1fce5e57ae..0126271574212a6f96fc79768231e1bdd77ff628 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve the temporal evolution of an entity with an invalid id [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity invalidUri - Check Response Status Code Set To 400 + ${response}= Retrieve Temporal Representation Of Entity invalidUri + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot index 1d44b0f567600f0a10caacb0f276db5dfda1857b..6e6a1d42ae199b39aaf568f6f778edf37fb741a9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve the temporal evolution of a non-existing entity [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity [Tags] te-retrieve 5_7_3 - Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity - Check Response Status Code Set To 404 + ${response}= Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index a56bd8420893ec847c174095f69d74850ff39041..35b573da9d1a536951e8c83030219e10355f3d5e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -19,15 +19,16 @@ Retrieve the temporal evolution of non-existing entity attributes [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes [Tags] te-retrieve 5_7_3 @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute - Retrieve Temporal Representation Of Entity + ${response}= 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 404 + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index b8b5ce555e4f29ef4185a7cdc74cd6a2b1664eb4..c536d78bb45e5ac9f3001346f867ae4759cff069 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -28,16 +28,16 @@ Between [Tags] te-retrieve 5_7_3 Retrieve the temporal evolution of an entity with an invalid request content [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content [Arguments] ${timerel} ${timeAt} ${endTimeAt} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... timerel=${timerel} ... timeAt=${timeAt} ... endTimeAt=${endTimeAt} - Check Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 0cea8d05626f0f3f50e88d425b5db5cd99160fbe..d982aaa54e76e7b2b696e70aef7335c5d37283c1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -20,11 +20,11 @@ Retrieve the temporal evolution of an entity with the simplified temporal repres [Documentation] Check that you can retrieve the temporal evolution of an entity with the simplified temporal representation [Tags] te-retrieve 5_7_3 @{options}= Create List temporalValues - Retrieve Temporal Representation Of Entity + ${response}= 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 Status Code 200 ${response.status_code} Check Response Body Containing EntityTemporal element ... ${vehicle_expectation_file} ... ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot index d79401efa586468a50f64cc5e9202cdf3a2458e9..3961c29cc7955ed5e4892388cfbab73c4185ba37 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -35,15 +35,15 @@ Batch Create Entity Scenarios ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - Batch Create Entities @{entities_to_be_created} + ${response}= Batch Create Entities @{entities_to_be_created} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} ${entities_to_be_queried}= Catenate SEPARATOR=, ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 201 + Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to @{expected_entities_ids} - Query Entities + ${response}= Query Entities ... ${entities_to_be_queried} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Created Resources Set To ${entities_to_be_created} - Batch Delete Entities @{expected_entities_ids} + ${response}= Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot index 9f0e90eb6cad8986c0202ce724496a9c1bca1413..383d98fde7e500c1b750ad4c32f5879a9d0b19ba 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_02.robot @@ -23,16 +23,16 @@ Create a batch of two valid entities and one invalid entity ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} ${already_existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} ${already_existing_entity} - Batch Create Entities @{entities_to_be_created} + ${response}= Batch Create Entities @{entities_to_be_created} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} @{expected_failed_entities_ids}= Create List ${existing_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code Set To 207 + Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_entities_ids} ... Building ... context=${ngsild_test_suite_context} @@ -40,7 +40,8 @@ Create a batch of two valid entities and one invalid entity @{created_entities}= Create List ${first_entity} ${second_entity} Check Created Resources Set To ${created_entities} @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} ${existing_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index afbc5db4f8b838f9c1df9f03a7f337f138b9c33f..980c579e2abfe46c20d75e90fc3dfb600b7c0ebb 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -18,9 +18,9 @@ EmptyJson [Tags] be-create 5_6_7 Create Batch Entity With Invalid Request Scenarios [Documentation] Check that you cannot create a batch of entities with an invalid request [Arguments] ${filename} ${problem_type} - Batch Request Entities From File create filename=${filename} - Check RL Response Status Code Set To 400 + ${response}= Batch Request Entities From File create filename=${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot index f78f2faa9b127bbd75626530a1013d8393d628d0..58d817e6ccb9ad463de136315bc1e9d104897dc0 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_04.robot @@ -17,16 +17,16 @@ Create a batch of one entity using a provided Link header with JSON content type ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities + ${response}= Batch Create Entities ... @{entities_to_be_created} ... content_type=${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 201 - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this attribute Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot index de13670195da702ed33e61cfe3144a536a50a764..a16bb2cadbc546fcc3ca246fbb985c5f71cf4a65 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_05.robot @@ -17,13 +17,13 @@ Create a batch of one entity using the default context with JSON content type ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} - Check Response Status Code Set To 201 - Retrieve Entity by Id ${entity_id} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot index 538c0f8d8b6d50c11e9426e2f6b27f0585aa49fc..390ff2bf29f2ca19005ade3105461a663bc4cf81 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_06.robot @@ -17,9 +17,9 @@ Create a batch of one entity containing a JSON-LD @context with a JSON content t ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot index 9aa8dc7a5fc4e93d0e2bc2db524a0a6979d0bf3f..00dc0dbc25c9f0cd6f5f0617f000b82b672f5c48 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_07.robot @@ -17,13 +17,13 @@ Create a batch of one entity using a JSON-LD @context obtained from the request ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To 201 - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull @{entities_ids_to_be_deleted}= Create List ${entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot index 9926817d38cd97d58e002489539e711e2860c2de..bc106ed57fab6d12fb3a9c7a4fd56fe18ad0a308 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_08.robot @@ -17,9 +17,9 @@ Create a batch of one entity not containing a JSON-LD @context with a JSON-LD co ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.json ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To 400 + ${response}= Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot index 53810f46e5b366012693bda426467251f4b689c1..cde6b9e3b3f049ec76ec2832812d9ddc258e897e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_09.robot @@ -17,12 +17,12 @@ Create a batch of one entity with a Link header and a JSON-LD content type ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${entity}= Load Entity building-simple-attributes-sample.jsonld ${entity_id} @{entities_to_be_created}= Create List ${entity} - Batch Create Entities + ${response}= Batch Create Entities ... @{entities_to_be_created} ... content_type=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot index 917b08130db839b088006fe3e3377e687c47e09c..17b0c55239cd7f9bc1a9da4fa6e9fd849fc36371 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_01.robot @@ -17,10 +17,10 @@ Delete a batch of entities [Documentation] Check that you can delete a batch of entities [Tags] be-delete 5_6_10 @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} - Check Response Status Code Set To 204 + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} + Check Response Status Code 204 ${response.status_code} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_deleted} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + ${response}= Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot index abe62e7e2e329b335ea5f64b14e1e20a939f8350..c408657c5c0f6f88f8d4d383385d886c587d8858 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_02.robot @@ -18,16 +18,16 @@ Delete a batch of non-existing and existing entities [Tags] be-delete 5_6_10 ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} @{expected_successful_entities_ids}= Create List ${existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code Set To 207 + Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} + ${response}= Query Entities ${expected_entities_ids} Building context=${ngsild_test_suite_context} Check SUT Not Containing Resources diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index c36cc59e4103db84921bf7081b3ef03f69adec2b..77423e963e82f24e50b2310ea3bdbc0c39442358 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -18,9 +18,9 @@ EmptyJson [Tags] be-delete 5_6_10 Batch Delete Entity With Invalid Request Scenarios [Documentation] Check that you cannot delete a batch of entities with an invalid request [Arguments] ${filename} ${problem_type} - Batch Request Entities From File delete filename=${filename} - Check RL Response Status Code Set To 400 + ${response}= Batch Request Entities From File delete filename=${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot index 9cd6e877d9057bd3f3c5f92ddda3d69b6b4aed29..a6150c46ba09a0720ab55abc730ae1ea83248766 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_01.robot @@ -35,8 +35,8 @@ Batch Update Entity Scenarios ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} - Batch Update Entities @{entities_to_be_updated} - Check Response Status Code Set To 204 + ${response}= Batch Update Entities @{entities_to_be_updated} + Check Response Status Code 204 ${response.status_code} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} @@ -44,7 +44,7 @@ Batch Update Entity Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities + ${response}= Query Entities ... ${expected_entities_ids} ... Building ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 005e8145fe58fe93f7a212733d697def093d7007..d307e90c758cc77b72ceaf16588c9bc06c993d32 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -35,8 +35,8 @@ Batch Update Entity With NoOverwrite Option Scenarios ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} - Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite - Check Response Status Code Set To ${expected_status} + ${response}= Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite + Check Response Status Code ${expected_status} ${response.status_code} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_entity_id} ${second_created_entity}= Load Test Sample entities/${entity_payload_filename} ${second_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} @@ -44,7 +44,7 @@ Batch Update Entity With NoOverwrite Option Scenarios ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} - Query Entities + ${response}= Query Entities ... ${expected_entities_ids} ... Building ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot index 9cfe8864d25223bfe844027e250ffcea3c1af97c..51137694e07b82d44c2db723d0420d7c096397e3 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_03.robot @@ -27,13 +27,13 @@ Update a batch of non-existing and existing entities ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} ${new_entity}= Load Entity building-relationship-of-property-sample.jsonld ${new_entity_id} @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} - Batch Update Entities @{entities_to_be_updated} + ${response}= Batch Update Entities @{entities_to_be_updated} @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code Set To 207 + Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${first_created_entity}= Load Test Sample entities/${entity_payload_filename} ${first_existing_entity_id} ${second_created_entity}= Load Test Sample @@ -44,13 +44,13 @@ Update a batch of non-existing and existing entities ${second_updated_entity}= Upsert Element In Entity ${second_created_entity} ${update_fragment} @{updated_entities}= Create List ${first_updated_entity} ${second_updated_entity} ${expected_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} - Batch Delete Entities @{expected_successful_entities_ids} + ${response}= Batch Delete Entities @{expected_successful_entities_ids} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index e00b0a4e9ed0ab5289028491a4897bfbc2793414..c450dcab296b009675237b3be902a66d0cfb137f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -18,9 +18,9 @@ InvalidJsonLd [Tags] be-update 5_6_9 Batch Update Entity With Invalid Request Scenarios [Documentation] Check that you cannot update a batch of entities with an invalid request [Arguments] ${filename} ${problem_type} - Batch Request Entities From File update filename=${filename} - Check RL Response Status Code Set To 400 + ${response}= Batch Request Entities From File update filename=${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot index 7901378ad2b8c290d8c9fcb3a350392caf8b2988..a8b6abab531a16f7a45adfb4f34d05d41f70411c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_01.robot @@ -33,15 +33,15 @@ Batch Upsert Entity Scenarios ${first_entity}= Load Entity ${filename} ${first_entity_id} ${second_entity}= Load Entity ${filename} ${second_entity_id} @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} - Batch Upsert Entities @{entities_to_be_upserted} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Status Code Set To 201 + Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to @{expected_entities_ids} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} - Batch Delete Entities @{expected_entities_ids} + ${response}= Batch Delete Entities @{expected_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot index b41d692cbcdcbe803e2d600ace29a8354826bcd1..afcab51010c850d455e2da3b451cc7b6c88fc004 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_02.robot @@ -38,23 +38,23 @@ Batch Upsert Non-existing And Existing Entities Scenarios ... ${new_entity} ... ${first_existing_entity} ... ${second_existing_entity} - Batch Upsert Entities @{entities_to_be_upserted} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_entities_ids}= Create List ${new_entity_id} - Check Response Status Code Set To 201 + Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to @{expected_entities_ids} @{upserted_entities_ids}= Create List ... ${new_entity_id} ... ${first_existing_entity_id} ... ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${entities_to_be_upserted} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot index 882bab4d32fd18100a3a569169501a54c2580ea5..de53092edd3ebe0c5bc9baf42c9955bdfb963d60 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_03.robot @@ -33,11 +33,11 @@ Batch Upsert Existing Entities Scenarios ${first_existing_entity}= Load Entity ${filename} ${first_existing_entity_id} ${second_existing_entity}= Load Entity ${filename} ${second_existing_entity_id} @{entities_to_be_upserted}= Create List ${first_existing_entity} ${second_existing_entity} - Batch Upsert Entities @{entities_to_be_upserted} - Check Response Status Code Set To 204 + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + Check Response Status Code 204 ${response.status_code} @{upserted_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot index 9673baf0bbd7a9415fda34cbfc245a02d4416563..47681f62f5997296107419ebfbc90d2ca08b1035 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_04.robot @@ -36,23 +36,23 @@ Batch Upsert Entities With Update Option Scenarios ${existing_entity}= Load Entity ${filename} ${existing_entity_id} @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} @{entities_ids_to_be_upserted}= Create List ${existing_entity_id} ${new_entity_id} - Batch Upsert Entities @{entities_to_be_upserted} update_option=update + ${response}= Batch Upsert Entities @{entities_to_be_upserted} update_option=update @{expected_entities_ids}= Create List ${new_entity_id} - Check Response Status Code Set To 201 + Check Response Status Code 201 ${response.status_code} Check Response Body Containing Array Of URIs set to @{expected_entities_ids} ${old_entity}= Load Test Sample entities/${existing_entity_payload_filename} ${existing_entity_id} ${update_fragment}= Load Test Sample entities/${update_fragment_filename} ${old_updated_entity}= Upsert Element In Entity ${old_entity} ${update_fragment} @{updated_entities}= Create List ${new_entity} ${old_updated_entity} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_upserted} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resources Set To ${updated_entities} @{entities_ids_to_be_deleted}= Create List ${new_entity_id} - Batch Delete Entities @{entities_ids_to_be_deleted} + ${response}= Batch Delete Entities @{entities_ids_to_be_deleted} Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot index b66d407e9a1b1bf2a3550d9a2eb54ac9d0add0f9..678baa02e4468379c2623f6057551ce328af5bc5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_05.robot @@ -22,20 +22,20 @@ Upsert a batch of two valid entities and one invalid entity ${third_entity}= Load Entity building-minimal-sample.jsonld ${third_entity_id} ${invalid_entity}= Remove Entity Type ${third_entity} @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} ${invalid_entity} - Batch Upsert Entities @{entities_to_be_upserted} + ${response}= Batch Upsert Entities @{entities_to_be_upserted} @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} @{expected_failed_entities_ids}= Create List ${third_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ... ${expected_successful_entities_ids} ... ${expected_failed_entities_ids} - Check Response Status Code Set To 207 + Check Response Status Code 207 ${response.status_code} Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{expected_successful_entities_ids} - Query Entities + ${response}= Query Entities ... ${expected_updated_entities_ids} ... Building ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} @{upserted_entities}= Create List ${first_entity} ${second_entity} Check Updated Resources Set To ${upserted_entities} - Batch Delete Entities @{expected_successful_entities_ids} + ${response}= Batch Delete Entities @{expected_successful_entities_ids} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 1b8c9cc360fd0330750ca693c2e0dd45307f12ba..75fcacdd21c62e060e1f224fd10e1c14fe0b4bb7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -18,9 +18,9 @@ InvalidJsonLd [Tags] be-upsert 5_6_8 Batch Upsert Entity With Invalid Request Scenarios [Documentation] Check that you cannot upsert a batch of entities with an invalid request [Arguments] ${filename} ${problem_type} - Batch Request Entities From File upsert filename=${filename} - Check RL Response Status Code Set To 400 + ${response}= Batch Request Entities From File upsert filename=${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index a2a680ab45cf78dfd2c52f75639d4aec70addf23..4b83df499f41b121475722e6d99ac91635ba87db 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -29,18 +29,21 @@ Create Entity Scenarios [Tags] e-create 5_6_1 [Arguments] ${filename} ${content_type} ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${entity_id} ${response.headers} ${created_entity}= Load Test Sample entities/${filename} ${entity_id} IF '${content_type}'=='application/json' - Retrieve Entity by Id ${entity_id} ${content_type} + ${response}= Retrieve Entity by Id ${entity_id} ${content_type} END IF '${content_type}'=='application/ld+json' - Retrieve Entity by Id ${entity_id} ${content_type} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... ${content_type} + ... context=${ngsild_test_suite_context} END Check Created Resource Set To ${created_entity} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index 061bdd725e6c7b8d81ddc05f5196a3a9597d2b67..1971ddbea5557cfc7aa939bbecc22e76c1512062 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -21,9 +21,9 @@ Create Entity With Invalid Request Scenarios [Documentation] Check that you cannot create an entity with an invalid request [Tags] e-create 5_6_1 [Arguments] ${filename} ${error_type} - Request Entity From File ${filename} - Check RL Response Status Code Set To 400 + ${response}= Request Entity From File ${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${error_type} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot index c5dc19819535f317e20e1dead500af9a2fb955d4..c100cba88f206c99da7c93a0a9509530461de125 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_03.robot @@ -17,18 +17,18 @@ Create one valid entity and one invalid entity [Documentation] Check that you cannot create an entity with an existing id [Tags] e-create 5_6_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Create Entity Selecting Content Type + Check Response Status Code 201 ${response.status_code} + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${content_type} - Check Response Status Code 409 ${response['status']} + Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot index 3c5d816c53f4827c00de598b16266a7ddf432c90..bfbca10a3d28bf1da6ba45da8e80bb6909dd4a8f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_04.robot @@ -16,15 +16,15 @@ Create one entity using a provided Link header with JSON content type [Documentation] Check that the @context is obtained from a Link Header if the Content-Type header is "application/json" [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull - Delete Entity by Id ${entity_id} + ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot index 826c69405c74e8723f5990612d8ded687d1d127f..4c44f76ba0327488da5c9af19de06b1896c52d90 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_05.robot @@ -16,11 +16,14 @@ Create one entity using the default context with JSON content type [Documentation] Check that the default @context is used if the Content-Type header is "application/json" and the Link header does not contain a JSON-LD @context [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} - Retrieve Entity by Id ${entity_id} + ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_JSON} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should be compacted as we used the same default context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} ${CONTENT_TYPE_JSON} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... ${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to ngsi-ld:default-context/almostFull - Delete Entity by Id ${entity_id} + ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot index 5b39952ddb652a909ca00347e190a0d3632c2ef4..333b91eeeed0998ecc13338a2c9a52482711288a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_06.robot @@ -16,12 +16,12 @@ Create one entity containing a JSON-LD @context with a JSON content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/json" and the request payload body (as JSON) contains a "@context" term [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot index 4e40f111e5b2bbef43d6ea90cee5dc7d2b70cd9c..c2fda435a83af30c4839bf1891cfb32af6f130e2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_07.robot @@ -16,11 +16,11 @@ Create one entity using a JSON-LD @context obtained from the request payload [Documentation] Check that the @context is obtained from the request payload body itself if the Content-Type header is "application/ld+json" [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} # Attribute should be compacted as we used the same context as provided when creating the entity Check Response Body Containing an Attribute set to almostFull - Retrieve Entity by Id ${entity_id} + ${response}= Retrieve Entity by Id ${entity_id} # Attribute should not be compacted as we did not provide a context containing this term Check Response Body Containing an Attribute set to https://ngsi-ld-test-suite/context#almostFull - Delete Entity by Id ${entity_id} + ${response}= Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot index 51efb05e10a94b1ea76265ef3c6c7d0e3dcd4e20..c2834df6541b08631b83a143c369974e3cccf74d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_08.robot @@ -16,12 +16,12 @@ Create one entity not containing a JSON-LD @context with a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and the request payload body does not contain a @context term [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot index e48f067a39093b6fc09dd9473fd6f96a065a7d2e..4c4940b611019ccc28ddb218d516ae869a15bd34 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_09.robot @@ -16,13 +16,13 @@ Create one entity with a Link header and a JSON-LD content type [Documentation] Check that an HTTP error response of type BadRequestData is raised if the Content-Type header is "application/ld+json" and a JSON-LD Link header is present in the incoming HTTP request [Tags] e-create 6_3_5 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot index 1a5a555fb6513112be1d6e39146808c0729d77ed..235d59536da34813c735a3511232621073626da1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot @@ -15,12 +15,12 @@ Delete an entity [Documentation] Check that you can delete an entity by id [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... building-simple-attributes-sample.jsonld ... ${entity_id} ... application/ld+json - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code 204 ${response['status']} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index a3b5e07363b80ce499afc249a8c46eb45de94bb4..62beb73d01abfb3be2a88fdd4e708b9b617bdd0d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -21,8 +21,8 @@ Delete Entity Scenarios [Tags] e-delete 5_6_6 [Arguments] ${entity_id} ${expected_status_code} ${problem_type} ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot index fc9f8d101d43d4cfa8d4f3ac9366ad4e9b74e3c8..d6b35cba148ca5479876c992999437cdb6dfd02d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_03.robot @@ -17,8 +17,8 @@ Delete an entity with an id not known to the system [Tags] e-delete 5_6_6 ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Delete Entity by Id Returning Response ${entity_id} - Check Response Status Code ${expected_status_code} ${response['status']} + Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index 345f90e04bf5454bee9d56d496f7c1e87cd4e08b..5f2d95f28a1574d91a2a9243c2afb64846569391 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -45,15 +45,18 @@ Append Attributes Without Params [Tags] ea-append 5_6_3 [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} Check Updated Resource Set To ${entity_expectation_payload} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -62,26 +65,29 @@ Append Attributes With Params [Tags] ea-append 5_6_3 [Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Entity Attributes With Parameters ... ${entity_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} ... noOverwrite - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} # ignore the reason for the not updated attribute as this detail is up to each context broker implementation IF "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ... ${expectation_response_body} - ... ${response['body']} + ... ${response.json()} ... root\\['notUpdated'\\]\\[0\\]\\['reason'\\] END ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot index 79a09e95f6c1fb91f71e3dcf1544c34b08caecb9..63d6fb86175c1e8b2ae3a7d6a51ee2301db86db5 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_02.robot @@ -31,34 +31,33 @@ Append Attributes [Tags] ea-append 5_6_3 [Arguments] ${entity_invalid_id} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} Append entity attributes with invalid entity fragments [Documentation] Check that you cannot append entity attributes with invalid entity fragments [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Append Entity Attributes Using Session + Check Response Status Code 201 ${response.status_code} + ${response}= Append Entity Attributes ... ${entity_id} ... ${invalid_fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - ... ${EMPTY} - Check RL Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot index caecdd7d5c083132df99bf6b1bd17131aae3d24f..f363e0a3c3878e81a1cbffca61b4e1b5aa61e594 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_03.robot @@ -17,11 +17,12 @@ Append entity attributes when the entity id is not known to the system [Tags] ea-append 5_6_3 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index 3dd3b1ca722b741fbef756ea62b27c73ea01940d..8e90be9de35274da56dcd7cfef94ea5e0776bd2e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -30,20 +30,23 @@ Delete Attributes [Tags] ea-delete 5_6_5 [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${datasetId} ... ${deleteAll} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index 094b3eaa338fe1e3da3dd2f451637224083f8a48..5a665fbe697f203b8ec7eda0cbfe711aabaf4b45 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -29,13 +29,13 @@ Delete Attributes [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 [Arguments] ${entity_id} ${attribute_id} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${EMPTY} false - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot index 9d2c56c440e77c0ac2105c51ab857c0bc19e9e81..d41856d2b4c33183754e50e82708f9c08481316d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_03.robot @@ -31,17 +31,17 @@ Delete Attributes [Tags] ea-delete 5_6_5 [Arguments] ${entity_id} ${attribute_id} ${datasetId} ${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} false - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${entity_id} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${valid_entity_id} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${not_found_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${not_found_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot index e8117d22ca8a5478cc906d04e06cc60a7f9a4aec..f62936e25aa32fef8970ce5c839b66aaefff9e21 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot @@ -27,19 +27,22 @@ Update Attributes [Tags] ea-partial-update 5_6_4 [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index 2195665d550bee04107c75feb71e73b5ca6548f9..626ec9bae03403670fad3e1f002671abb04a3afd 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -33,21 +33,21 @@ Update Attributes [Documentation] Check that you cannot perform a partial update on an entity attribute with invalid/missing ids [Tags] ea-partial-update 5_6_4 [Arguments] ${entity_id} ${attribute_id} ${fragment_filename} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index 5eda275eefc2cf16eaa24a84d10a32a86f260124..cc3175e212e4a15ac8bd7529dad7b8902804c9e1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -32,21 +32,21 @@ Partial Update Attributes [Documentation] Check that you cannot perform a partial update on an entity attribute if the entity id or attribute is not known to the system [Tags] ea-partial-update 5_6_4 [Arguments] ${entity_id} ${fragment_filename} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Partial Update Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${valid_entity_id} Setup Initial Entities diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index af12e56be4d9e9c24272e21b47ef62844f6158a6..9c1abaf82853be1a9931bbcf3f1e5d1bdb779f83 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -32,18 +32,21 @@ Update Attributes ... ${expectation_response_filename} ... ${expectation_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} IF "${expectation_response_filename}"!="${EMPTY}" - Check Response Body Content ${expectation_response_filename} ${response['body']} + Check Response Body Content ${expectation_response_filename} ${response.json()} END ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} - Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List @context Check Updated Resource Set To ${entity_expectation_payload} ${ignored_attributes} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot index c786688cb5b9b18a895a290db81cc671389d7184..ba193571aeb896f618d6d1ca28835c36ee34f028 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_02.robot @@ -35,17 +35,17 @@ Update Attributes [Tags] ea-update 5_6_2 [Arguments] ${entity_invalid_id} ${filename} ${fragment_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Update Entity Attributes ${entity_invalid_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} Update entity attributes with invalid entity fragments @@ -53,17 +53,16 @@ Update entity attributes with invalid entity fragments [Tags] ea-update 5_6_2 [Arguments] ${filename} ${fragment_filename} ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Update Entity Attributes Using Session + Check Response Status Code 201 ${response.status_code} + ${response}= Update Entity Attributes ... ${entity_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - ... ${EMPTY} - Check RL Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot index 4fed63275665db7d9a101a853b97dc249abda897..2a355c9896293eeffb9c8928832ade31dcb5a2b7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_03.robot @@ -16,12 +16,14 @@ Update entity attributes when the entity id is not known to the system [Documentation] Check that you cannot update entity attributes if the entity id or attributes are not known to the system [Tags] ea-update 5_6_2 ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test Variable ${entity_id} ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 409b05bef7d9b46c06f7b159814330c003b94eb7..d78353d688f83b75583e8f1f5c743cf1e70f62f2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -29,15 +29,15 @@ Create Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${content_type} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${created_temporal_entity}= Load Test Sample ... temporalEntities/${filename} ... ${temporal_entity_representation_id} IF '${content_type}'=='application/json' - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + ${response}= Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} END IF '${content_type}'=='application/ld+json' - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} END diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot index 53d971444fc5aef51b899166954b9af53720b653..f90979e27acd9a75d5944a3cb048e639d5d03304 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_02.robot @@ -29,10 +29,10 @@ Create Temporal Entity From File [Documentation] Check that you cannot create a temporal entity with an empty/invalid json/id [Tags] te-create 5_6_11 [Arguments] ${filename} - Create Temporal Representation Of Entity Selecting Content Type Using Session + ${response}= Create Temporal Representation Of Entity Selecting Content Type ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check RL Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} @@ -44,5 +44,5 @@ Create Temporal Entity ... ${entity_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot index d03e836896149910a92acc66c59d6792208f295b..cd263d541ffbf866fe93ad506b9054c6471df25c 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_01.robot @@ -20,11 +20,11 @@ Delete a temporal representation of an entity with simple temporal properties ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Temporal Representation Of Entity With Returning Response ... ${temporal_entity_representation_id} - Check Response Status Code 204 ${response['status']} - Retrieve Temporal Representation Of Entity + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index c9c0300328433522677b7a816f4b0906af8942a7..f5208af7d4f95fed28e1a9b79aa5543a53a01674 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -25,8 +25,8 @@ Delete Temporal Entity [Tags] te-delete 5_6_16 [Arguments] ${status_code} ${id} ${problem_type} ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot index 5f2a3cf75091070486a939aa1d2700d109f99e5f..95f5bf07ec40dd6bf53e686b8bdcd068b87eabf4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_03.robot @@ -17,8 +17,8 @@ ${status_code}= 404 [Tags] te-delete 5_6_16 ${temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_id} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot index c2042366e567f31431a3ff27e0265ce4236d44c0..8e2dd36cfd546abcd01f8ade5722620425b1cbee 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/UpdateTemporalRepresentationOfEntity/008_01.robot @@ -22,16 +22,16 @@ ${expectation_filename}= vehicle-temporal-representation-update-expectation.j ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ... ${temporal_entity_representation_id} ... ${update_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot index 7331164d77ca958247f093c41826859d42d10c2e..b510e97a7901b093ce82874379b2bc65b0288d15 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_01.robot @@ -22,16 +22,16 @@ ${expectation_filename}= vehicle-temporal-representation-added-attribute-expe ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot index 3360b67706be723f1fab23cbf549c7d419030c63..93e28938992465e225158f27a844e37d8b0f6d51 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_02.robot @@ -37,12 +37,12 @@ Add an Attribute To a Temporal Entity From File ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Append Attribute To Temporal Entity Using Session + Check Response Status Code 201 ${response.status_code} + ${response}= Append Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${update_filename} ... ${CONTENT_TYPE_LD_JSON} - Check RL Response Status Code Set To ${status_code} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_INVALID_REQUEST} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} @@ -56,7 +56,7 @@ Add Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Append Attribute To Temporal Entity ${id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot index 2f50f7caca6d20c22e7a166c958ce653b8a84bbd..c1d3a16aae225ffdaa2115dbb40ad18a0e6dd238 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/AppendAttributes/014_03.robot @@ -22,11 +22,11 @@ Add Attribute To Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${not_found_temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} ${response}= Append Attribute To Temporal Entity ... ${not_found_temporal_entity_representation_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot index 94a7fd93b1c5ddf5c6765674e5a1d6a24d4b83f7..88c24a253d7e2b1aac9c41ac04d4fdb157ad862e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_01.robot @@ -34,7 +34,7 @@ Delete Attribute From A Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Attribute From Temporal Entity ... ${temporal_entity_representation_id} ... ${attribute_id} @@ -42,11 +42,11 @@ Delete Attribute From A Temporal Entity ... ${datasetId} ... ${deleteAll} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot index f6d074b49201a41478202b8905c85b965664dfca..def7efd25a374659fb6866fc5e72a7a2c6d20d90 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_02.robot @@ -36,11 +36,11 @@ Delete attribute from temporal entity with unknow entity/attribute id ... ${CONTENT_TYPE_JSON} ... ${EMPTY} ... false - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} Create Temporal Entity ${valid_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -48,7 +48,7 @@ Create Temporal Entity ... ${valid_temporal_entity_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} Set Suite Variable ${valid_temporal_entity_id} Delete Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot index 918a4a957bd6be2dfb7b23487890b277b89cb769..7ae8d891e2f43ec097551979ea200c3f6eabcf8f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttribute/015_03.robot @@ -31,7 +31,7 @@ Delete Attribute ... ${valid_temporal_entity_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Attribute From Temporal Entity ... ${entity_id} ... ${attribute_id} @@ -39,11 +39,11 @@ Delete Attribute ... ${EMPTY} ... false ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Temporal Representation Of Entity ${valid_temporal_entity_id} Create Id diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot index ccfbb73a75fe2e4dcd5bb76fa1c66facf2e1cbff..ccdb46d9294f64fe84aeaeb3fe1099296c85323b 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_01.robot @@ -23,23 +23,23 @@ ${expectation_filename}= vehicle-temporal-representation-delete-speed-instanc ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Temporal Representation Of Entity + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} ${response}= Delete Attribute Instance From Temporal Entity ... ${temporal_entity_representation_id} ... ${attributeId} ... ${instanceId} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot index 79f7aea06ff5df3db5ac6e65cc8198ab55eca641..6909b2a6b6d517731e97b5b906b72fb8464f1840 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_02.robot @@ -40,7 +40,7 @@ Delete attribute instance ... ${instanceId} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Create Temporal Entity ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -49,13 +49,13 @@ Create Temporal Entity ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Get Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} Delete Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot index 59d1a5236be0a8cbe15d6f6634f5e209ec178689..8629a98d3420e7278a4271a5941dd8304e2dc857 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/DeleteAttributeInstance/017_03.robot @@ -35,7 +35,7 @@ Delete Attribute Instance ... ${instanceId} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} Create Id @@ -45,7 +45,7 @@ Create Id ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} ${response}= Get Temporal Representation Of Entity @@ -53,5 +53,5 @@ Create Id ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot index 10f330e259238cf958cdb14a814898fd0d1048fc..fc7f96366a36bdbe5abe0df5bb1a442e87983b42 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_01.robot @@ -25,13 +25,13 @@ ${attributeId}= speed ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId_before_update}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${instanceId_before_update}= Set Variable ${response.json()['speed'][0]['instanceId']} ${response}= Modify Attribute Instance From Temporal Entity ... ${temporal_entity_representation_id} @@ -40,16 +40,16 @@ ${attributeId}= speed ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 204 ${response['status']} + Check Response Status Code 204 ${response.status_code} ${temporal_entity_expectation_payload}= Load Test Sample ... temporalEntities/expectations/${expectation_filename} ... ${temporal_entity_representation_id} - Retrieve Temporal Representation Of Entity + ${response}= Retrieve Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${instanceId_after_update}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${instanceId_after_update}= Set Variable ${response.json()['speed'][0]['instanceId']} Should Be Equal As Strings ${instanceId_before_update} ${instanceId_after_update} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot index 133be6183e7867702c5fb3a3989c944a518d2b31..0fd7114af7b22159d4d05e2d92da7e5be7fa44ad 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_02.robot @@ -44,7 +44,7 @@ Modify Attribute Instance Temporal Entity ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -53,13 +53,13 @@ Create Id ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${response}= Get Temporal Representation Of Entity ... ${temporal_entity_representation_id} ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} Delete Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot index 9c805e2dac6d51020d652407240d705ff9469664..0433ba9d759802c68e668311d3fe27598d0c6d20 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/ModifyAttributeInstance/016_03.robot @@ -38,7 +38,7 @@ Modify Attribute Instance Temporal Entity ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response['status']} + Check Response Status Code ${status_code} ${response.status_code} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} @@ -47,7 +47,7 @@ Create Id ... ${temporal_entity_representation_id} ... ${filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} + Check Response Status Code 201 ${response.status_code} ${unknown_temporal_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} Set Suite Variable ${unknown_temporal_entity_id} ${response}= Get Temporal Representation Of Entity @@ -55,7 +55,7 @@ Create Id ... ${CONTENT_TYPE_LD_JSON} ... sysAttrs ... ${ngsild_test_suite_context} - ${valid_instanceId}= Set Variable ${response['body']['speed'][0]['instanceId']} + ${valid_instanceId}= Set Variable ${response.json()['speed'][0]['instanceId']} Set Suite Variable ${valid_instanceId} Delete Temporal Entity diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index 24f69dd4e875c5a23972806eeafdc8c6961ee80c..e5e8f6de6c96ce0799f3de2572a425f5673d9916 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -17,9 +17,12 @@ Create Subscription [Documentation] Check that you can create a subscription [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} ${expected_subscription}= Load Test Sample ${subscription_expectation_file_path} ${subscription_id} - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot index 6fdab2c6ef2612c663743d2572a358be8cf35325..ac0eefe625ce2e7822cab68184a93103fe33340f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_02.robot @@ -19,9 +19,9 @@ Create Subscription With Invalid Request [Documentation] Check that you cannot create a subscription with an invalid request [Tags] sub-create 5_8_1 [Arguments] ${filename} ${expected_status} - Create Subscription From File ${filename} - Check RL Response Status Code Set To 400 + ${response}= Create Subscription From File ${filename} + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${expected_status} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot index b2d0a297204bec1bd5a7feac05844c2e481bb865..906c79f26d26449f1c6225e32881caae11ac6520 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_03.robot @@ -27,9 +27,9 @@ Create Subscription With Invalid/Empty Id ... ${subscription_id} ... ${subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot index 6683c91bc9a95d4a746d29cd6821bdc27f6a87bc..379e27e8130eec7373e4750e28af69cc23ffb27c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_04.robot @@ -16,14 +16,17 @@ Create a subscription with an id known to the system [Documentation] Check that you cannot create a subscription with an existing id [Tags] sub-create 5_8_1 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} - Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} ${response}= Create Subscription ... ${subscription_id} ... ${subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 409 ${response['status']} + ${response}= Create Subscription + ... ${subscription_id} + ... ${subscription_payload_file_path} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Subscription ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot index 4c86e30a0e8d355d48f485f88da7704ec8da38f4..eb799b7f6abb756a3ea907b4b158f6ac305d9fd5 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -18,9 +18,9 @@ InvalidId [Tags] sub-delete 5_8_5 Delete Subscription With Non present Or Invalid Id [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised [Arguments] ${id} - Delete Subscription ${id} - Check Response Status Code Set To 400 + ${response}= Delete Subscription ${id} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot index 930dbf02b5dbb660cb7f8f3b5ff416778fb8f567..d9f6c5b98b60f74bcc462b9018635f0ad5d9f347 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -9,9 +9,9 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Delete Unknown Subscription [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] sub-delete 5_8_5 - Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription - Check Response Status Code Set To 404 + ${response}= Delete Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot index f6ded38ab2070388ec1173685b4765d7fa704dd4..7a12cff99ad89e4492f9556e308d4081241a0695 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -18,9 +18,9 @@ ${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld Delete Subscription [Documentation] Check that you can delete a subscription [Tags] sub-delete 5_8_5 - Delete Subscription ${subscription_id} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Delete Subscription ${subscription_id} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot index c366b8b6d304db561173d1a06aa49e45cff1aa62..371d868d396dc2ba2fb239cdb434489cff5de1df 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_01.robot @@ -32,7 +32,6 @@ Check that a notification is only sent if status is active ${notification}= Wait for notification timeout=${10} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] Should be Equal ${5} ${notification}[data][0][airQualityLevel][value] @@ -53,7 +52,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot index 0a9bc524f99fa771a9375e879f9b4d3551b42ede..9459cae7f61ec7b9d48e4ef78124326781ec9f10 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_02.robot @@ -28,10 +28,8 @@ Check that a notification is sent on the timeInterval Setup Initial Subscriptions ${notification}= Wait for notification timeout=${15} - Output ${notification} ${notification}= Wait for notification timeout=${15} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data @@ -65,7 +63,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot index bef47b8a21cd9d98bf023e87dc5084863aa7987a..9378e768e2152e83ea7a96537a2e241e70f1f19c 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_03.robot @@ -28,7 +28,6 @@ Check that a notification is sent with all entities Setup Initial Subscriptions ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty @@ -61,7 +60,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot index bd71d44bdcd7a8b0d4b3724716ef0a9468ea6da3..fa8745c968473b231113a74bd4a58ba2e2075fa8 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_04.robot @@ -30,7 +30,6 @@ Check that a notification is sent with all entities Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty @@ -62,7 +61,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot index 83d3bcdb2fd2a63b1b2528a4a702025b0c2e2f8b..1519846103361de764ef7ccd4f201f986434e44f 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_05.robot @@ -30,7 +30,6 @@ Check that a notification is sent with all entities Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data Should Not Be Empty ${notification}[data] Notification data should not be empty @@ -63,7 +62,7 @@ Delete Initial Entity Delete Entity by Id ${entity_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot index d47618f98ea601dcb6001c9eb70c5a9f32590a74..a00726755e0b4bf30eda9bfae10a0627ca070cbb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_06.robot @@ -28,8 +28,6 @@ Check that a notification is sent with all matching entities ... ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification timeout=${10} - - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Should be Equal ${entity_id} ${notification}[data][0][id] @@ -43,7 +41,7 @@ Setup Server And Subscriptions ... ${notification_server_send_url} Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON} Set Suite Variable ${subscription_id} - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot index a6c1e60703a92cecb34527d9bf8c33eb27fb1f4e..9bd99774fdee7b0e5785cb746774409dbfdbe5c2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_07.robot @@ -66,7 +66,6 @@ Check URI expansion is observed Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification - Output ${notification} Should Be Equal ${notification}[type] Notification Should Be Equal ${notification}[subscriptionId] ${subscription_id} ${is_date}= Is Date ${notification}[notifiedAt] ${date_format} @@ -104,7 +103,7 @@ Delete Fixture Data Delete Initial Entity Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot index 0c52a261e1ed35efca5268ab68d5ed69f7bb7c3d..33a1751c0224d9448695f323e71ba3573e54e79a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_08.robot @@ -31,7 +31,6 @@ Check that a notification is sent with all attributes Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data @@ -64,7 +63,6 @@ Check that a notification is sent with all attributes in simplified format Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} ${notification}= Wait for notification ${5} - Output ${notification} Should be Equal ${subscription_id} ${notification}[subscriptionId] Dictionary Should Contain Key ${notification} data @@ -101,7 +99,7 @@ Delete Fixture Data Delete Initial Entity Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Stop Local Server diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot index 94f38d3fe6683a3d40c0a9bc89cfdfb0330c7a66..588e9d483f8df632bae3b3b9f002555c33e6ee98 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_09.robot @@ -48,7 +48,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot index 8b91cbdb3438caccc71abc302ee87eb0bc585271..5b74fc305f12ade83fd1a566edd9f84e583cb0fb 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_10.robot @@ -59,7 +59,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot index 3867b044062628a9d1ed905c5dafa79c34d627ac..d9d7b847166ec9a760057ac8b15d58874d70a6c2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_11.robot @@ -34,13 +34,13 @@ Check that timesSent is increased by one Wait for notification timeout=${10} - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - Dictionary Should Contain Key ${response}[body][notification] timesSent - Should Be Equal ${1} ${response}[body][notification][timesSent] + Dictionary Should Contain Key ${response.json()}[notification] timesSent + Should Be Equal ${1} ${response.json()}[notification][timesSent] *** Keywords *** @@ -58,7 +58,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot index 44160ead46c212be4c0ea70c932ec47b4a693b66..9a7ecead149afe2790268de1a3771946d5a04d07 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_12.robot @@ -32,13 +32,12 @@ Check that lastNotification is updated Wait for notification timeout=${10} - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - ${notification_info}= Get Value From JSON ${response} $.body.notification - Output ${notification_info} + ${notification_info}= Get Value From Json ${response.json()} $.notification Dictionary Should Contain Key ${notification_info}[0] status Should Be Equal ok ${notification_info}[0][status] @@ -69,7 +68,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot index d3e136714bdd93b514645dc1a40b23ecdccdae91..1cb6c606ba66146ef01e2644c990e814a9d32ff6 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_13.robot @@ -29,13 +29,12 @@ Check that lastFailure and status are updated if a notification could not be sen Sleep 10s - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - ${notification_info}= Get Value From Json ${response} $.body.notification - Output ${notification_info} + ${notification_info}= Get Value From Json ${response.json()} $.notification Dictionary Should Contain Key ${notification_info}[0] status Should Be Equal failed ${notification_info}[0][status] diff --git a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot index b4601190d516b420b255e01f1f20268674be878f..dcb7ec3d75168d5d2b017f7f6903370d36fb47c5 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/Notification/046_14.robot @@ -58,7 +58,7 @@ Delete Initial Subscriptions Delete Subscription ${subscription_id} Before Test - NotificationUtils.Start Local Server ${notification_server_host} ${notification_server_port} + Start Local Server ${notification_server_host} ${notification_server_port} After Test Delete Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot index 124aac46945910f01d32d8652609faf15a6f85ef..757768a1cd20e44f0a7dbe02e9a2f00f35f039c0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_01.robot @@ -21,12 +21,12 @@ ${expectation_file_path}= subscriptions/expectations/subsc Query Subscriptions [Documentation] Check that you can query a list of subscriptions [Tags] sub-query 5_8_4 - Query Subscriptions context=${ngsild_test_suite_context} + ${response}= Query Subscriptions context=${ngsild_test_suite_context} @{subscription_ids}= Create List ... ${first_subscription_id} ... ${second_subscription_id} ... ${third_subscription_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Subscription elements ... ${expectation_file_path} ... ${subscription_ids} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot index 3cd655f2739f8818b270b83a94719c46060a68f8..c8c763a14d81d6f871d81035ea41058fcdfe7ae9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/QuerySubscriptions/031_02.robot @@ -33,12 +33,12 @@ Query All Subscriptions Query Subscriptions With Limit And Page Parameters [Documentation] Check that you can query a list of subscriptions: Pagination logic shall be in place [Arguments] ${limit} ${offset} ${expectation_subscription_number} ${prev_link} ${next_link} - Query Subscriptions + ${response}= Query Subscriptions ... context=${ngsild_test_suite_context} ... limit=${limit} ... offset=${offset} ... accept=${CONTENT_TYPE_LD_JSON} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot index 5527f34a24f1f10802f706f9edd34825dbfb144d..8159de2e2108e50317e0cc055fa936a85d4f1ce1 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_01.robot @@ -16,9 +16,9 @@ InvalidId [Tags] sub-retrieve 5_8_3 Retrieve Subscription With Non present Or Invalid Id [Documentation] Check that you cannot retrieve a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised [Arguments] ${id} - Retrieve Subscription ${id} - Check Response Status Code Set To 400 + ${response}= Retrieve Subscription ${id} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot index 07f3e914756de110c423214f8865bebe305e4753..438aafe4c90cf543bf04217ce5b1bccaad9f38a0 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_02.robot @@ -9,9 +9,9 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Retrieve Unknown Subscription [Documentation] Check that you cannot retrieve a subscription: If the identifier provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised [Tags] sub-retrieve 5_8_3 - Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription - Check Response Status Code Set To 404 + ${response}= Retrieve Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 95f0908865b9257c95e01ba3c0722d16c0d0c2a3..9cfdf7c147cc787b7e6163571143b977e68e006b 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -19,8 +19,8 @@ ${expectation_file_path}= subscriptions/expectations/subscriptions Retrieve Subscription [Documentation] Check that you can retrieve a subscription [Tags] sub-retrieve 5_8_3 - Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot index b3e29e80303c810e6319e6dcd7aee77cb5aaf60f..4f2e1a3e351daf96e6801cb722d9e80da58764ae 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -23,9 +23,9 @@ InvalidId [Tags] sub-update 5_8_2 Update Subscription With Non present Or Invalid Id [Documentation] Check that you cannot update a subcription: If the Subscription id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised [Arguments] ${id} - Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot index 6f036a32aed6c17d46e94d437a579eba680f66e4..a4ad298fb2748357abba28361278f472df1bd35a 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_02.robot @@ -14,12 +14,12 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Unknown Subscription [Documentation] Check that you cannot update a subscription: If the NGSI-LD System does not know about the target Subscription, because there is no existing Subscription whose id (URI) is equivalent, an error of type ResourceNotFound shall be raised [Tags] sub-update 5_8_2 - Update Subscription + ${response}= Update Subscription ... urn:ngsi-ld:Subscription:unknowSubscription ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 404 + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot index de3acfcb5e2b0a1b1aab17d0a7df48753e2e29fe..7175df757dd37ee16951c6201fb620cf8af08d53 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_03.robot @@ -19,12 +19,16 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription With Invalid Fragment [Documentation] Check that you cannot update a subcription: If the data types and restriction are not met by the Subscription Fragment, then an error of type BadRequestData shall be raised [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot index 86093c7c3d5de2d1b27c697ad9e6870f1ec50cb3..94a2b5075cfdfb71d77ca4a141415ba069fdc005 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_04.robot @@ -19,12 +19,16 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription With Null Mandatory Properties [Documentation] Check that you cannot update a subscription: Any attempt to remove (by setting them to null in the Fragment) mandatory properties of a Subscription (clause 5.2.12) shall result in an error of type BadRequestData [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index c9c78770e239d3253d0edf6830c50cb392316f67..3c571964042ace1c03dae97e61f787a1cfc3a7ac 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -21,17 +21,17 @@ ${expected_expanded_subscription_payload_file_path}= subscriptions/expectatio Update Subscription With Term to Uri Expansion [Documentation] Check that you can update a subcription: Term to URI expansion of Attribute names shall be observed [Tags] sub-update 5_8_2 - Update Subscription + ${response}= Update Subscription ... ${subscription_id} ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} context=${ngsild_test_suite_context} Check Response Body Containing Subscription element ... ${expected_subscription_payload_file_path} ... ${subscription_id} - Retrieve Subscription ${subscription_id} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing Subscription element ... ${expected_expanded_subscription_payload_file_path} ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index 0208b26798cd89c8ccd60a3bf12b0779d87e6b17..a3fcfb84e18b6bad2687c6361d3b622b74f2ece2 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -19,15 +19,15 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription [Documentation] Check that you can update a subcription: The implementation shall modify the target Subscription [Tags] sub-update 5_8_2 - Update Subscription + ${response}= Update Subscription ... ${subscription_id} ... ${subscription_update_fragment_file_path} ... ${CONTENT_TYPE_JSON} ... context=${ngsild_test_suite_context} - Check Response Status Code Set To 204 + Check Response Status Code 204 ${response.status_code} ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Subscription + ${response}= Retrieve Subscription ... ${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot index af036480a8bf7f2f11a0cd3c46d6f3af942ebc4c..9c8ef145f3d018f1238d909e86b2bf269a57e8c9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_07.robot @@ -24,9 +24,12 @@ ActiveTrue [Tags] sub-update 5_8_2 Activate Paused Subscription With isActive Member [Documentation] Check that you can update a subscription: If isActive is equal to true and expiresAt is not present, then status shall be updated to "active", if and only if, the previous value of status was different than "expired" [Arguments] ${subscription_update_fragment_file_path} - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status active Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot index fa850b10379ee64600d398cf475e495f95bf0c4c..9f07d0e558c8478ec00dd0b8a376b625e57b9418 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_08.robot @@ -25,9 +25,12 @@ ActiveTrueExpiresAt Activate Paused Subscription With isActive And ExpiresAt Members [Documentation] Check that you can update a subcription: If isActive is equal to true and expiresAt corresponds to a DateTime in the future, then status shall be updated to "active" [Arguments] ${subscription_update_fragment_file_path} - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status active Setup Initial Subscriptions diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot index 20d491299f06c4d1108a35332aabf59ef3a1910d..3b2b8fc648f89db938613b77df9b1913d3f28f39 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_09.robot @@ -19,9 +19,12 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription Status To Paused [Documentation] Check that you can update a subscription: If isActive is equal to false and expiresAt is not present, then status shall be updated to "paused", if and only if, the previous value of status was different than "expired" [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status paused diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot index 1d09768a54ccfbacbccdeb2acac0d31835559604..a82c2089a32074e944e3976575c387fb35544bc9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_10.robot @@ -25,11 +25,17 @@ Activate Expired Subscription ${update_template_fragment}= Load JSON From File ... ${EXECDIR}/data/subscriptions/fragments/subscription-expiresAt-update-sample.json ${update_fragment}= Update Value To JSON ${update_template_fragment} $..expiresAt ${in_5_seconds} - Update Subscription With Payload ${subscription_id} ${update_fragment} ${CONTENT_TYPE_JSON} + ${response}= Update Subscription With Payload + ... ${subscription_id} + ... ${update_fragment} + ... ${CONTENT_TYPE_JSON} Sleep 10s - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 204 - Retrieve Subscription ${subscription_id} + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Subscription ${subscription_id} Check Response Body Containing an Attribute set to status active diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot index 5540ede2351f89ebbc0af042bf878f4ed672b26d..64d5c3d0e544bdc39368188de73d9ac354b29b55 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_11.robot @@ -19,12 +19,16 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip Update Subscription With ExpiresAt In The Past [Documentation] Check that you cannot update a subscription: If expiresAt is included but referring to a DateTime in the past, then a BadRequestData error shall be raised [Tags] sub-update 5_8_2 - Update Subscription ${subscription_id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code Set To 400 + ${response}= Update Subscription + ... ${subscription_id} + ... ${subscription_update_fragment_file_path} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot index 69c9629ed2577f00f3be3ae07a5d3780a7f03f5b..a87d5cdb227e1e99aabd322689dbd8d770ea746d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_01.robot @@ -18,10 +18,9 @@ Create Context Source Registration With Specific Date Expiration Date ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - Retrieve Context Source Registration + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot index d996cff6780bd2a88beef659de22a4ee7a6258b3..29a3e5ef61c9898857be8548177df4d714aa4921 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_02.robot @@ -18,10 +18,10 @@ Create Context Source Registration That Never Expires ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} - Retrieve Context Source Registration + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${registration_id} ${response.headers} + ${response}= Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot index 11abfe098190bb92e6cf5ef71b01a1920a79745e..611e8a0903270a5066409825047b900af5a3e569 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_01_03.robot @@ -16,11 +16,11 @@ Create Context Source Registration Without A Sprecified ID [Documentation] Check that you can create a context source registration without specifying an ID [Tags] csr-create ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} - ${request} ${response}= Create Context Source Registration With Return ${payload} - Check Response Status Code 201 ${response['status']} - ${registration_id}= Check Response Headers ID Not Empty ${response} + ${response}= Create Context Source Registration With Return ${payload} + Check Response Status Code 201 ${response.status_code} + ${registration_id}= Check Response Headers ID Not Empty ${response.headers} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - Retrieve Context Source Registration + ${response}= Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 92f24839fff5ae2ed08f43ca1672d0cc013408f5..7e0055ca8477f0a7395857b34603d1d4ff4dd2f4 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -32,19 +32,18 @@ Create Context Source With Invalid Content ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 400 ${response['status']} - Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 400 ${response.status_code} + Check Response Headers Containing URI set to ${registration_id} ${response.headers} [Teardown] Delete Context Source Registration ${registration_id} Create a context source registration with invalid JSON file [Documentation] Create a context source registration with invalid JSON file [Tags] csr-create ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${response}= Create Context Source Registration Using Session + ${response}= Create Context Source Registration ... ${registration_payload_file_path} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} + Check Response Status Code ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Entity by Id Returning Response ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot index 8f0667b5c4d0cc83f5ae4c5518cda9f560221dcb..a035d1420b7ef005b48342321887f261a838be7d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_03.robot @@ -18,9 +18,9 @@ Create a context source registration that already exists ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 409 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 409 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot index bc2c7303b722a745fe7574a2e8c737b0de577210..d820ecaf8c723c98c1060332ceed274f60577e10 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_04.robot @@ -18,14 +18,14 @@ Create one context source registration using a provided Link header with JSON co ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 201 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building - Retrieve Context Source Registration ${registration_id} + ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ... ['information']['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot index bf8c0eaa9ca0a0fb91e19b88a1117784465bdc65..cbb25fc5e8ed503a62737709d72c6ef1c43b16ec 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_05.robot @@ -18,12 +18,12 @@ Create one context source registration using the default context with JSON conte ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] ngsi-ld:default-context/Building - Retrieve Context Source Registration ${registration_id} + ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot index 78a6639b2699da76fcbb6131ee6541e5ee8cec54..ad381cc9bba9dda1e28abcf05d2386b2ef38768e 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_06.robot @@ -18,11 +18,11 @@ Create one context source registration containing a JSON-LD @context with a JSON ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot index dcbb5536326d99c8edf0bcdc78b2306da3bb8151..98ce13ab6966b52250f9eb0f42755f379f4a94c6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_07.robot @@ -18,13 +18,13 @@ Create one context source registration using a JSON-LD @context obtained from th ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check Response Status Code 201 ${response.status_code} + ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check JSON Value In Response Body ['information']['entities'][0]['type'] Building - Retrieve Context Source Registration ${registration_id} + ${response}= Retrieve Context Source Registration ${registration_id} Check JSON Value In Response Body ... ['information']['entities'][0]['type'] ... https://ngsi-ld-test-suite/context#Building diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot index 6a305cd16b8b7ad6e92a911d44226d7acd9e9114..92bf6de34a614a491af798719f9d2b2cdb76a097 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_08.robot @@ -18,11 +18,11 @@ Create one context source registration not containing a JSON-LD @context with a ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot index 90b94a8e558a9d23f5ef641513b4cc2763e57c0f..76b18cfd630798ad17e035a90fc965b7c585436d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_09.robot @@ -18,12 +18,12 @@ Create one context source registration with a Link header and a JSON-LD content ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return + ${response}= Create Context Source Registration With Return ... ${updated_payload} ... ${CONTENT_TYPE_LD_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index b16395d0666d11f3ce6a96657ae23a7bb30dd758..1572d99676bcd06c48ea11430d9041eaa61375ff 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -18,9 +18,9 @@ Delete a context source registration by id ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Context Source Registration With Return ${registration_id} - Check Response Status Code 204 ${response['status']} - Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index c6a0411b83e20986fb75ff7e8c4ed730e78c5957..67753a4d8481b22411385313264849626a3088dd 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -28,9 +28,9 @@ Delete Context Source ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} ${response}= Delete Context Source Registration With Return ${invalid_registration_id} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot index a6ef7d32b37cccf70f2a6c3119d619f18d48b921..86205978d7ac612efbff3c0b237bdf3861eb00b0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_03.robot @@ -17,5 +17,5 @@ Delete a context source registration by id [Tags] csr-delete ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${response}= Delete Context Source Registration With Return ${registration_id} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code 404 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot index 09b5854a1be2b3094a32d39734b10412ee22b541..785cab2611f5c172f502646238b1d4230eaf8446 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_01.robot @@ -33,10 +33,10 @@ Query Context Source Registration ... ${query_param_value} ... ${expectation_file_path} ... @{expected_context_source_registration_ids} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... ${query_param_name}=${query_param_value} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot index 86577045652720af5d72f4e0d6af8f1496696f2d..2a442f8838f56316799221e10923c801fa29ac61 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_02.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Query Context Source Registrations Without Entity Types and Attribute Names [Documentation] Check that you cannot query context source registrations, if neither Entity types nor Attribute names are provided, an error of type 400 shall be raised. [Tags] csr-query 5_10_2 - Query Context Source Registrations context=${ngsild_test_suite_context} - Check Response Status Code Set To 400 + ${response}= Query Context Source Registrations context=${ngsild_test_suite_context} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot index 9b0e6584174ba34a9ed9e851a2795344bf11a6c9..a4af853237fdb0a600175e2db688c704f2d4b57a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot @@ -24,11 +24,11 @@ Invalid Temporal Query Query Context Source Registration With Invalid Query Param [Documentation] Check that you cannot query context source registrations, if the list of Entity identifiers includes a URI which it is not valid, or the query, geo-query or temporal query are not syntactically valid [Arguments] ${query_param_name} ${query_param_value} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... ${query_param_name}=${query_param_value} - Check Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot index b6be3201e2a0676728e483ddd9aefaca58045be3..25864bcb716107c8afc34166a6ff5274f8559bbd 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_04.robot @@ -19,9 +19,9 @@ ${expectation_file_path}= csourceRegistrations/exp Query Context Source Registrations Without Context [Documentation] Check that you can query context source registrations. If a JSON-LD context is not provided, then all the query terms shall be resolved against the default JSON-LD @context [Tags] csr-query 5_10_2 - Query Context Source Registrations id=${context_source_registration_id} + ${response}= Query Context Source Registrations id=${context_source_registration_id} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot index a272c716585eed65c7ac0c8ecd9555ca5370c564..b4e1c5d26ceb8a336c0a9a57385860152eb39ec9 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_05.robot @@ -29,11 +29,14 @@ Query Context Source Registration Matching EntityInfo of RegistrationInfo ${context_source_registration_payload}= Load Test Sample ... ${registration_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=name + ${response}= Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... attrs=name @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot index 0820e8382852b6fe25a73e6e6bdc3975d8bb50e8..7c8a00c3f0019a5e5e98d2750ea517026c4dc04d 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_06.robot @@ -28,9 +28,12 @@ Query Without Properties And Relationships Query Context Source Registration Matching Properties And Relationships Of RegistrationInfo [Documentation] Check that you can query context source registrations matching property and relationship names of RegistrationInfo [Arguments] ${attrs_value} ${expectation_file_path} - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building attrs=${attrs_value} + ${response}= Query Context Source Registrations + ... context=${ngsild_test_suite_context} + ... type=Building + ... attrs=${attrs_value} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot index 9a11fd2c36143cd5e1753e4ad7b456b9aee245bf..49492e94ce3dc093acceb636dd1e71700d562e4a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_07.robot @@ -27,7 +27,7 @@ Within Polygon [Tags] csr-query 5_10_2 Query Context Source Registration Matching Geoquery [Documentation] Check that you can query context source registrations. If present, the geoquery is matched against the GeoProperty programmatic parameter identified in the geoquery [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file_path} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... georel=${georel} @@ -35,7 +35,7 @@ Query Context Source Registration Matching Geoquery ... coordinates=${coordinates} ... geoproperty=${geoproperty} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot index 2300feb78da3d472d95b6823a0d23ebe49abe567..39a33d5adfb98650044db73aa8c64d0b1545145f 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_08.robot @@ -19,9 +19,9 @@ ${expectation_file_path}= csourceRegistrations/exp Query Context Source Registration Without Temporal Query [Documentation] Check that you can query context source registrations. If no temporal query is present, only Context Source Registrations for Context Sources providing latest information are considered [Tags] csr-query 5_10_2 - Query Context Source Registrations context=${ngsild_test_suite_context} type=Building + ${response}= Query Context Source Registrations context=${ngsild_test_suite_context} type=Building @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot index 29718acbab421fccd0c885b8fdc4f711fc0460f6..1173a309755ee948f3e88a38d6423c085aabed21 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_09.robot @@ -39,16 +39,16 @@ Query Context Source Registration Matching Temporal Query ${context_source_registration_payload}= Load Test Sample ... ${payload_file_path} ... ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Set Suite Variable ${context_source_registration_id} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... timeproperty=${timeproperty} ... timerel=before ... timeAt=2021-08-01T22:00:00Z @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot index b35280c73e9a726ced59cbd00033b36c78cd2257..f8e8711cb3a3dc1a11cfad309d4e0a8aa42b1065 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_10.robot @@ -37,10 +37,10 @@ Query Context Source Registration With Query Params ... ${query_param_value} ... ${expectation_file_path} ... @{expected_context_source_registration_ids} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... ${query_param_name}=${query_param_value} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Context Source Registrations elements ... ${expectation_file_path} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot index 536e6f296a5ae50c0349f4ddf13b6c3d79d5619a..e85b7ac95e286d80eae0e6c2d54e1e56e5bb675a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_11.robot @@ -33,12 +33,12 @@ Query All Subscriptions Query Context Source Registration With Limit And Page Parameters [Documentation] Check that you can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. [Arguments] ${limit} ${page} ${expected_number} ${prev_link} ${next_link} - Query Context Source Registrations + ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... limit=${limit} ... page=${page} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities ContextSourceRegistration ${expected_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot index 3794117dfc3cda379fdda7757e7a272457a2ff57..9d34f7ae6fb236cca783cba4cedef25082a69540 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_01.robot @@ -19,9 +19,9 @@ Invalid Id [Tags] csr-retrieve 5_10_1 Retrieve Context Source Registration With A Not Present Or Invalid Id [Documentation] Check that you cannot retrieve a Context Source Registration, if the context source registration id is not present or it is not a valid URI [Arguments] ${id} - Retrieve Context Source Registration ${id} - Check Response Status Code Set To 400 + ${response}= Retrieve Context Source Registration ${id} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot index a2d3a3dce1dcfbdddd2ce578df853376f96d9f48..8f23c64c7e54e368dd74553bcb9a577426a479f6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_02.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve Unknown Context Source Registration [Documentation] Check that you cannot retrieve a Context Source Registration, if the NGSI-LD endpoint does not know about the target context source registration, because there is no existing context source registration whose id (URI) is equivalent [Tags] csr-retrieve 5_10_1 - Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration - Check Response Status Code Set To 404 + ${response}= Retrieve Context Source Registration urn:ngsi-ld:ContextSourceRegistration:unknowRegistration + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot index 0d3f3d52873b1488865434c42ac0a5a29932ee4b..53055cb17ae8d8f438f6bf99a58d90a34cc7fc5b 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_03.robot @@ -19,8 +19,8 @@ ${expectation_file_path}= csourceRegistrations/exp Retrieve Context Source Registration With Default Core Context [Documentation] Check that you can retrieve a Context Source Registration. Term to URI expansion of Attribute names shall be observed. [Tags] csr-retrieve 5_10_1 - Retrieve Context Source Registration ${context_source_registration_id} - Check Response Status Code Set To 200 + ${response}= Retrieve Context Source Registration ${context_source_registration_id} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element ... ${expectation_file_path} ... ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot index 7e0772f6093d41591a2f1b047102ba213a3d4471..1a1f6757403836baaf17a6ebd38deb5a4e3ef9b1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_04.robot @@ -19,8 +19,10 @@ ${expectation_file_path}= csourceRegistrations/exp Retrieve Context Source Registration [Documentation] Check that you can retrieve a Context Source Registration [Tags] csr-retrieve 5_10_1 - Retrieve Context Source Registration ${context_source_registration_id} context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Context Source Registration + ... ${context_source_registration_id} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element ... ${expectation_file_path} ... ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot index 867c92fc8b427e2866ec57c2ac6c4911a23ed1c2..03d9fed5d4d92571e7ae32b48c888c957f992535 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RetrieveContextSourceRegistration/036_05.robot @@ -30,8 +30,8 @@ CreationTimeJsonLdContext Check JSON-LD resolution when retrieving a context source registration [Documentation] Check that the JSON-LD @context is obtained from a Link header if present and that the default JSON-LD @context is used if not present [Arguments] ${context} ${expected_payload} - Retrieve Context Source Registration ${context_source_registration_id} context=${context} - Check Response Status Code Set To 200 + ${response}= Retrieve Context Source Registration ${context_source_registration_id} context=${context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Context Source Registration element ... ${expected_payload} ... ${context_source_registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index c0db5c404d7fc98e1b462d29d8c9a8a4a753d072..7ddf99771647422fb5e29a9e852bac1fbb10b445 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -27,16 +27,16 @@ Update Context Source ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response['status']} + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${update_filename} ${registration_update_fragment}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${registration_update_fragment} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response['status']} - Retrieve Context Source Registration + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Context Source Registration ... ${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index bd157e830070a70b0b32fc91088c2f646619cc0d..c96af7875595b141c3bf1aaed775263a50a7c3f2 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -40,16 +40,16 @@ Update Context Source [Arguments] ${registration_id} ${fragment_filename} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${valid_registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${fragment_filename} ${fragment_with_id}= Update Value To JSON ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration With Return ... ${registration_id} ... ${fragment_with_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 400 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code 400 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${valid_registration_id} Update a context source registration if the request body is invalid @@ -58,13 +58,12 @@ Update a context source registration if the request body is invalid ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${updated_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} - Check Response Status Code 201 ${response['status']} - ${response}= Update Context Source Registration Using Session + ${response}= Create Context Source Registration With Return ${updated_payload} + Check Response Status Code 201 ${response.status_code} + ${response}= Update Context Source Registration ... ${registration_id} ... ${registration_payload_file_path} - ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code ${response} + Check Response Status Code ${response.json()} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot index f9f7a674f1d5ac0e0d47b780e89bd34a6a50bb28..89d5e80b3e7a6ace668e554b9a79375eeb1d6780 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_03.robot @@ -22,6 +22,6 @@ Update a context source registration by id if the id is not known to the system ... ${registration_id} ... ${fragment_with_id} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 404 ${response['status']} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Status Code 404 ${response.status_code} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} [Teardown] Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot index 3fb74d2856e39a67e15eb13e70409ef0e24a4e06..9dcaaa19f3b516ab4ed3c0e727ac242dc4319b44 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_01.robot @@ -19,10 +19,10 @@ Create Context Source Registration Subscription [Documentation] Check that you can create a minimal context source registration subscription [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve Context Source Registration Subscription + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} + ${response}= Retrieve Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot index 210f79f944f1e3a91b03c1f172ce99d9c6768ccb..7acfe0ef26938ccb8c5f796a92a3de23417658b7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_02.robot @@ -18,12 +18,12 @@ Create Context Source Registration Subscription Without An Id [Documentation] Check that you can create a context source registration subscription without providing an id and it will be automatically generated [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} ${subscription_id}= Fetch Id From Response Location Header - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Set Suite Variable ${subscription_id} - Retrieve Context Source Registration Subscription + ${response}= Retrieve Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot index b6eab9b2c76bcd64427ce35f3facb260bf6d9df4..131e2dec9c3eea1db6ccb5d0a4d8576ecea1688f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_03.robot @@ -19,10 +19,10 @@ Create Context Source Registration Subscription Without isActive Member [Documentation] Check that you can create a context source registration subscription without providing isActive member and will be active by default [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve context source registration subscription ${subscription_id} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} + ${response}= Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status active diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot index dbcfbc4c13d466ef950d68f113cfc7e992ccbd48..da1e0f8eb3d1e804b57f8bd3d047a1f6a7b05d70 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_04.robot @@ -19,10 +19,10 @@ Create Inactive Context Source Registration Subscription [Documentation] Check that you can create a context source registration subscription with isActive member set to false and it's initial status will be set to "paused" [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} - Retrieve context source registration subscription ${subscription_id} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} + ${response}= Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status paused diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot index 1c62b9ba972f1be6a502e3a25d36cfaacd9f36db..6b5603837e6f0637f875676ce75fde538d584300 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_05.robot @@ -22,11 +22,11 @@ Create Context Source Registration Subscription With expiresAt Member ${current_date}= Get Current Date time_zone=UTC result_format=${date_format} ${expiresAt}= Add Time To Date ${current_date} 10 seconds date_format=${date_format} ${subscription_payload}= Update Value To JSON ${subscription_payload_sample} $..expiresAt ${expiresAt} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} Sleep 15s - Retrieve context source registration subscription ${subscription_id} + ${response}= Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status expired diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot index 9b4e70a61ed2741bec322f709666c298977eec47..c719246cb93d3a5bfa0b001e46b7071527a9f91b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_06.robot @@ -19,12 +19,12 @@ Create Context Source Registration Subscription Without expiresAt Member [Documentation] Check that you can create a context source registration subscription without an expiresAt member and it will be considered as perpetual [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 201 - Check Response Headers Containing URI set to ${request['path']}/ ${subscription_id} ${response} + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${subscription_id} ${response.headers} # Let's say if the subscription stills active after 10s it will be considered as perpetual, but this is not enough Sleep 10s - Retrieve context source registration subscription ${subscription_id} + ${response}= Retrieve context source registration subscription ${subscription_id} Check Response Body Containing an Attribute set to status active diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot index 544a978504c384ca79fb285dbaf44b78bfdcf6e2..e930111c711167b9fd9ec0832e38bc5b37c0ea0a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_07.robot @@ -19,12 +19,13 @@ Create Existing Context Source Registration Subscription [Documentation] Check that you cannot create a context source registration subscription where another context source registration subscription whose id is equivalent exists [Tags] csrsub-create 5_11_2 ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 409 + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 409 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_ALREADY_EXISTS} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot index d9d8adee4520e7a0f0df68d6a2e3858802f43a84..eb0ea2fb9d460b37853c1db9579239cdc886af08 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_08.robot @@ -32,9 +32,9 @@ Create Invalid Context Source Registration Subscription [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${filepath} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 400 + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot index 918cfcbdcbbc87885f8a313501ab0829272c6259..6474108d2f02fcca77c5fc8df0efc6f2cf513ddf 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/CreateContextSourceRegistrationSubscription/038_09.robot @@ -17,9 +17,9 @@ Create Expired Context Source Registration Subscription [Tags] csrsub-create 5_11_2 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} - Check Response Status Code Set To 400 + ${response}= Create Context Source Registration Subscription ${subscription_payload} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot index e28f93e14b40dd4c4ad79af9f507f4cb1bbc3430..6a605539f2b9cfab878873f60b039526142523cf 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_01.robot @@ -17,9 +17,11 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample Delete Context Source Registration Subscription [Documentation] Check that you can delete a context source registration subscription [Tags] csrsub-delete 5_11_6 - Delete Context Source Registration Subscription ${subscription_id} - Check Response Status Code Set To 204 - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} + ${response}= Delete Context Source Registration Subscription ${subscription_id} + Check Response Status Code 204 ${response.status_code} + ${response}= Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} Check SUT Not Containing Resource diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot index e5b30eae2ede1b287a4ced2d32aab3b7a237eefa..87bb7e2677b78c64cd1fc9226d47597e069a3842 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_02.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Delete Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete a context source registration subscription with an invalid URI [Tags] csrsub-delete 5_11_6 - Delete Context Source Registration Subscription invalidUri - Check Response Status Code Set To 400 + ${response}= Delete Context Source Registration Subscription invalidUri + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot index ff640433766076529a8dfccefb816fb7f51e0fd1..5b2a24bb8a87e629421903e79b1be55877755ad0 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/DeleteContextSourceRegistrationSubscription/042_03.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Delete Unknown Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot delete an unknown context source registration subscription [Tags] csrsub-delete 5_11_6 - Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription - Check Response Status Code Set To 404 + ${response}= Delete Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot index fc6479516c1e990ed87161a1943f2aaa12bfee8d..feaf4e57f59f49cd523c76f11f3d21e69de766f5 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_01.robot @@ -26,7 +26,7 @@ Receive cSourceNotification Periodically And Initially On Subscription ... ${subscription_payload_file_path} ... ${subscription_id} Set Suite Variable ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} Wait for notification # Wait for 15 seconds to check if another notification was sent Wait for notification timeout=${15} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot index e806af3e64e64fc283e4a67f93aba1a2c00bf64c..3c4532d9797ee6e930f7087fd25752ae924f1355 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_02.robot @@ -27,14 +27,14 @@ Receive cSourceNotification Initially On Subscription And Whenever There Is A Ch ... ${subscription_payload_file_path} ... ${subscription_id} Set Suite Variable ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} ... ${expected_context_source_registration_ids} ... newlyMatching ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} + ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} Wait for notification and validate it ... ${subscription_id} ... ${expected_context_source_registration_ids} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot index 03b3d264ecc3399b3af53595f41dd18df596c89e..cded0e4ba3ee6c34aa34bc369bec616a6c6202c4 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_03.robot @@ -26,7 +26,7 @@ Receive cSourceNotification With Relevant Information ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} @{expected_notification_data_entities}= Create List Building Wait for notification and validate it diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot index 0256572cf873820ff437f92303a3d5f713e4beb8..007a80c4a71e001dd1380f70b03381285106a815 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_04.robot @@ -26,7 +26,7 @@ Receive cSourceNotification With Compliant Structure ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot index f2647ddd3cc7b6310fdcd080fc3e146825e688d7..71cc885df14dbfa5a7407c9f4dc878dbf605800b 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_05.robot @@ -27,9 +27,9 @@ If A cSourceNotification Is Successfully Sent The Notification Member Shall Be U ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Wait for notification - Retrieve Context Source Registration Subscription ${subscription_id} + ${response}= Retrieve Context Source Registration Subscription ${subscription_id} @{expected_notification_additional_members}= Create List lastNotification lastSuccess Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot index 839a6d0b72a2f114e7296f541bac6c9a4c93f959..7e321bf0b9e89832930dc5a9df885f2f341c3945 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_06.robot @@ -27,9 +27,9 @@ If A cSourceNotification Is Not Successfully Sent The Notification Member Shall ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Wait for no notification - Retrieve Context Source Registration Subscription ${subscription_id} + ${response}= Retrieve Context Source Registration Subscription ${subscription_id} @{expected_notification_additional_members}= Create List lastNotification lastFailure Check NotificationParams ${notification_expectation_file_path} ${expected_notification_additional_members} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot index dbf64473c0a1109f2e4a5b48b9c43e616109ccb6..b006466624fdaf280c3e565aae62cbc9d8584512 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_07.robot @@ -32,13 +32,15 @@ Do Not Receive cSourceNotification If Subscription Status Is Not Active [Documentation] Check that a cSourceNotification shall only be sent if and only if the status of the corresponding subscription is active, neither paused or expired [Arguments] ${filepath} ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + ${response}= Update Context Source Registration Subscription + ... ${subscription_id} + ... ${subscription_update_fragment} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} Wait for no notification Setup Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot index 0621ea7ed8f178f25dd486655307be58a9132352..87d358eba1835f9b8f5df94601a9e989d6acf5a6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_08.robot @@ -23,7 +23,7 @@ Receive cSourceNotification For Matching Context Source Registrations Providing [Documentation] Check if a context source registration subscription does not define a temporalQ member, a CsourceNotification will be triggered from matching context source registrations for context sources providing latest information [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} + ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot index 8cbac3c7b38ba5b36ad59c959502915dcd21df8c..c860c849d80013f1a260ae0eea39e4430bad997e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_09.robot @@ -23,7 +23,7 @@ Receive cSourceNotification For No Longer Matching Context Source Registrations [Documentation] Check if a context source registration subscription defines an "entities" member, a CsourceNotification will be triggered from context source registrations with information member matching the described "entities" [Tags] csrsub-notification 5_11_7 ${update_fragment}= Load Test Sample ${update_fragment_file_path} - Update Context Source Registration ${context_source_registration_id} ${update_fragment} + ${response}= Update Context Source Registration ${context_source_registration_id} ${update_fragment} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot index 0e040ee8f7e45cf5a6e0dbd685889ad3a70c5107..d347b1f773794c71cc19ca4624d4687d756b6afd 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_10.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Observa ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot index 92b1867b6f51ab9a017bb14923347c379d627c54..e2c586b43e3bbb1f993ae406504953726b670f97 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_11.robot @@ -30,14 +30,14 @@ Receive cSourceNotification For Matching Context Source Registrations On Managem [Arguments] ${filepath} ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Subscription Sample With Reachable Endpoint ${filepath} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} ${context_source_registration_id}= Generate Random Entity Id ${context_source_registration_id_prefix} ${context_source_registration_payload}= Load Test Sample ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot index fd6c74f13f5b3d95e1b311605488749cfb03bc85..0f858143d92c0767140a5b4c4f3ed61a29a5166f 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_12.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Watched ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot index 16272e2b42353877dedd0adbbef56f6f3cb6eeb3..54d47f0399b3025daf777e7e1623095dfd81e7ec 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_13.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Any wat ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot index dd53acce8d1fc77f7a88e7b8f9e13c720269cfc2..0ec48479ab670124dd3828be967fd7acbd300a1a 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_14.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Locatio ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot index a20cef110ddf40506b0639b81e9896ab1ddf8765..2da0eebde953ab1fc1ad3f516d306040c128b1b5 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_15.robot @@ -26,7 +26,7 @@ Receive cSourceNotification For Matching Context Source Registrations On Locatio ... ${context_source_registration_payload_file_path} ... ${context_source_registration_id} Set Suite Variable ${context_source_registration_id} - Create Context Source Registration ${context_source_registration_payload} + ${response}= Create Context Source Registration ${context_source_registration_payload} @{expected_context_source_registration_ids}= Create List ${context_source_registration_id} Wait for notification and validate it ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot index 2677278daf2872d37b1a080ae05a853913a23861..e680609dd9086f32f181d2d88ce9ca07b2b64196 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/NotificationBehaviour/047_16.robot @@ -36,7 +36,9 @@ Receive cSourceNotification For Newly Matching Context Source Registrations [Documentation] Check if you update a context source registration subscription, a CsourceNotification will be sent with all currently matching context source registrations [Arguments] ${filepath} @{notification_csr_ids} ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} + ${response}= Update Context Source Registration Subscription + ... ${subscription_id} + ... ${subscription_update_fragment} Wait for notification and validate it ${subscription_id} ${notification_csr_ids} newlyMatching Setup Initial Context Source Registrations And Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot index 2bc9864909534754005c8b30eb96302033691311..d245dd819398865f33ce94fb8efaefbf78594c07 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_01.robot @@ -20,9 +20,9 @@ ${expectation_file_path}= csourceSubscriptions/expectation Query Context Source Registration Subscriptions [Documentation] Check that you can query context source registration subscriptions [Tags] csrsub-query 5_11_5 - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} + ${response}= Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} @{subscription_ids}= Create List ${first_subscription_id} ${second_subscription_id} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing List Containing Subscription elements ... ${expectation_file_path} ... ${subscription_ids} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot index f2bf0a328195aa77d3b614c63fd411440922c810..1d1331d694d532b8c2068018f4dd12d423d4c22d 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_02.robot @@ -34,8 +34,10 @@ Query All Subscriptions Query Context Source Registration Subscriptions With Limit Parameter [Documentation] Check that you can query context source registration subscriptions with a limit parameter and it will be the maximum number of subscriptions to be retrieved [Arguments] ${limit} ${expectation_subscription_number} - Query Context Source Registration Subscriptions context=${ngsild_test_suite_context} limit=${limit} - Check Response Status Code Set To 200 + ${response}= Query Context Source Registration Subscriptions + ... context=${ngsild_test_suite_context} + ... limit=${limit} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Setup Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot index be5675b3ad499048a93d00c8fed6ec8c83f94592..5cbac8894e4a1e241b2fdd1628d08064850dd3f2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_03.robot @@ -33,11 +33,11 @@ Query All Subscriptions Query Context Source Registration Subscriptions With Limit And Page Parameters [Documentation] Check that you can query context source registration subscriptions with providing page and limit parameters for pagination [Arguments] ${limit} ${page} ${expectation_subscription_number} ${prev_link} ${next_link} - Query Context Source Registration Subscriptions + ${response}= Query Context Source Registration Subscriptions ... context=${ngsild_test_suite_context} ... limit=${limit} ... page=${page} - Check Response Status Code Set To 200 + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities Subscription ${expectation_subscription_number} Check Pagination Prev And Next Headers ${prev_link} ${next_link} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot index f4a172f6df33911c026abc83eab51ff19236e0fb..5391ec10bc6ba62144e10f3b11706f9d4ff296a7 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/QueryContextSourceRegistrationSubscriptions/041_04.robot @@ -22,9 +22,9 @@ Invalid Limit And Page Query Context Source Registration Subscriptions With Invalid Limit And Page Parameters [Documentation] Check that you cannot query context source registration subscriptions with invalid page and limit parameters [Arguments] ${limit} ${page} - Query Context Source Registration Subscriptions limit=${limit} page=${page} - Check Response Status Code Set To 400 + ${response}= Query Context Source Registration Subscriptions limit=${limit} page=${page} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot index ba1d842bf022b7d4a98e459e12fcdbc3d0918383..4990c31bb2df107bd8356be96a4c9b7863cde2e6 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_01.robot @@ -19,8 +19,10 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscr Retrieve Context Source Registration Subscription [Documentation] Check that you can retrieve a context source registration subscription [Tags] csrsub-retrieve 5_11_4 - Retrieve Context Source Registration Subscription ${subscription_id} context=${ngsild_test_suite_context} - Check Response Status Code Set To 200 + ${response}= Retrieve Context Source Registration Subscription + ... ${subscription_id} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Check Response Body Containing Subscription element ${expectation_file_path} ${subscription_id} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot index 8e4a6855497cf3145bf0684b498f8ce2cdd320ca..0387b7e805c8b6fe0c4bb86e08cd9d1516be4c4e 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_02.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve Context Source Registration Subscription With An Invalid Id [Documentation] Check that you cannot retrieve a context source registration subscription with an invalid URI, an error of type BadRequestData shall be raised [Tags] csrsub-retrieve 5_11_4 - Retrieve Context Source Registration Subscription invalidUri - Check Response Status Code Set To 400 + ${response}= Retrieve Context Source Registration Subscription invalidUri + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot index fb7d52ceae5326d90af244dc21243b1366a84d1d..f25b20eb2e1fe9185bc6de775931ddc9bf49c5b2 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/RetrieveContextSourceRegistrationSubscription/040_03.robot @@ -10,9 +10,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Retrieve Unknown Context Source Registration Subscription [Documentation] Check that you cannot retrieve an unknown context source registration subscription, an error of type ResourceNotFound shall be raised [Tags] csrsub-retrieve 5_11_4 - Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription - Check Response Status Code Set To 404 + ${response}= Retrieve Context Source Registration Subscription urn:ngsi-ld:Subscription:unknowSubscription + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot index 9035fcaa49c901f3eca6b1e77140c9e87ba22b1e..d3b9d6df76c6490aff22f7b36dcd4d3f105e5d30 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_01.robot @@ -20,10 +20,12 @@ Update Context Source Registration Subscription [Documentation] Check that you can update a context source registration subscription [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} - Check Response Status Code Set To 204 + ${response}= Update Context Source Registration Subscription + ... ${subscription_id} + ... ${subscription_update_fragment} + Check Response Status Code 204 ${response.status_code} ${subscription}= Upsert Element In Entity ${subscription_payload} ${subscription_update_fragment} - Retrieve Context Source Registration Subscription + ${response}= Retrieve Context Source Registration Subscription ... ${subscription_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot index 32ba76ba0a72d9076acdca983b0e5139deb51982..47c31636245615e6eab80e88f072f32f629ca414 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_02.robot @@ -15,9 +15,9 @@ Update Context Source Registration Subscription With Invalid Uri [Documentation] Check that you cannot update a context source registration subscription with an invalid URI [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} - Check Response Status Code Set To 400 + ${response}= Update Context Source Registration Subscription invalidUri ${subscription_update_fragment} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot index 024b5593bdc692efcfc5e2bcc17647a86de9c5cb..e7617f1d58f324c0d10aaee8c7f7b64469be8a08 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_03.robot @@ -15,11 +15,11 @@ Update Unknown Context Source Registration Subscription [Documentation] Check that you cannot update an unknown context source registration subscription [Tags] csrsub-update 5_11_3 ${subscription_update_fragment}= Load Test Sample ${subscription_update_fragment_file_path} - Update Context Source Registration Subscription + ${response}= Update Context Source Registration Subscription ... urn:ngsi-ld:Subscription:unknowSubscription ... ${subscription_update_fragment} - Check Response Status Code Set To 404 + Check Response Status Code 404 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_RESOURCE_NOT_FOUND} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot index cc767440863758ac1f05e81fd3ea7db05c00b27a..9d21c33a3a6b68735cec54dfabc1bb76882749fb 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_04.robot @@ -28,17 +28,19 @@ Update Context Source Registration Subscription With Invalid Fragment [Documentation] Check that you cannot update a context source registration subscription with a fragment that does not meet the data types and restrictions expressed by clause 5.2.12 [Arguments] ${filepath} ${subscription_update_fragment}= Load Test Sample ${filepath} - Update Context Source Registration Subscription ${subscription_id} ${subscription_update_fragment} - Check Response Status Code Set To 400 + ${response}= Update Context Source Registration Subscription + ... ${subscription_id} + ... ${subscription_update_fragment} + Check Response Status Code 400 ${response.status_code} Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} Setup Initial Context Source Registration Subscriptions ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} ${subscription_payload}= Load Test Sample ${subscription_payload_file_path} ${subscription_id} - Create Context Source Registration Subscription ${subscription_payload} + ${response}= Create Context Source Registration Subscription ${subscription_payload} Set Suite Variable ${subscription_id} Delete Initial Context Source Registration Subscriptions diff --git a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot index 7d184f53fc201aca9323fcc36e41e19ba951f3d9..1a21265273beebbd84df13dcbe3360a732c0a105 100644 --- a/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot +++ b/TP/NGSI-LD/ContextSource/RegistrationSubscription/UpdateContextSourceRegistrationSubscription/039_05.robot @@ -19,14 +19,15 @@ ${subscription_update_fragment_file_path}= csourceSubscriptions/fragments/s Update Context Source Registration Subscription With Invalid JSON Fragment [Documentation] Check that you cannot update a context source registration subscription with an invalid request body (invalid JSON document) [Tags] csrsub-update 5_11_3 - Update Context Source Registration Subscription From File + ${response}= Update Context Source Registration Subscription From File ... ${subscription_id} ... ${subscription_update_fragment_file_path} - Check RL Response Status Code Set To 400 + Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response} + ... ${response.json()} ... ${ERROR_TYPE_INVALID_REQUEST} - Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + *** Keywords *** diff --git a/libraries/logUtils.py b/libraries/logUtils.py new file mode 100644 index 0000000000000000000000000000000000000000..1de30abeed1f6908e368f960237ff399b73a68cd --- /dev/null +++ b/libraries/logUtils.py @@ -0,0 +1,48 @@ +from __future__ import unicode_literals +from __future__ import division +from pygments import highlight, lexers, formatters +from json import dumps, JSONDecodeError, loads +from robot.api import logger +from robot.api.deco import keyword + + +@keyword(name="Output", tags=("I/O",)) +def output(response, console=True): + """*Request and response are output to terminal and file (in JSON).* + ``console``: If false, the JSON is not written to terminal. Default is true. + """ + + try: + if response.request.body is None: + request_body = response.request.body + else: + request_body = loads(response.request.body) + except JSONDecodeError: + request_body = response.request.body + + try: + response_body = response.json() + except JSONDecodeError: + response_body = None + + request_json = {'method': response.request.method, 'url': response.request.url, + 'headers': dict(response.request.headers), 'body': request_body} + response_json = {'url': response.url, 'headers': dict(response.headers), 'status_code': response.status_code, + 'reason': response.reason, 'body': response_body} + + pretty_request_json = dumps(request_json, indent=4, sort_keys=False, separators=(",", ": ")) + pretty_response_json = dumps(response_json, indent=4, sort_keys=False, separators=(",", ": ")) + + logger.info(pretty_request_json) + logger.info(pretty_response_json) + + if console: + pretty_request_json_colored = highlight( + pretty_request_json, lexers.JsonLexer(), formatters.TerminalFormatter() + ) + pretty_response_json_colored = highlight( + pretty_response_json, lexers.JsonLexer(), formatters.TerminalFormatter() + ) + + logger.console(pretty_request_json_colored) + logger.console(pretty_response_json_colored) diff --git a/requirements.txt b/requirements.txt index b20e167320dca8a77f7715c9d824aa453eee748e..f6f16821fd873447e183fb7c796a1747364e13dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,7 @@ # python3.10 project robotframework==6.0.2 -RESTinstance==1.3.0 -robotframework-jsonschemalibrary==1.0 robotframework-jsonlibrary==0.5 robotframework-requests==0.9.4 deepdiff==6.3.0 robotframework-httpctrl==0.3.1 -robotframework-metrics==3.3.1 robotframework-tidy==4.2.1 diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index ef33eadbc200874205a82694e4fff568b898b3eb..863b2536572696e5e62e116cc2402558bc8635ae 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -1,6 +1,6 @@ *** Settings *** Variables ./variables.py -Library REST ${url} +Library ${EXECDIR}/libraries/logUtils.py Library RequestsLibrary Library OperatingSystem Library Collections @@ -43,16 +43,15 @@ ${response} ${EMPTY} *** Keywords *** Delete Entity by Id Returning Response [Arguments] ${id} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} - Output request - Output response + ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any + Output ${response} RETURN ${response} Delete Entity by Id [Arguments] ${id} - ${response}= REST.DELETE ${ENTITIES_ENDPOINT_PATH}${id} - Output request - Output response + ${response}= DELETE url=${url}/${ENTITIES_ENDPOINT_PATH}${id} expected_status=any + Output ${response} + RETURN ${response} Query Entity [Arguments] @@ -83,11 +82,14 @@ Query Entity Set To Dictionary ${params} options=${options} END - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} query=${params} - ${request}= Output request - Output response + ${response}= GET + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} - RETURN ${request} ${response} + Output ${response} + RETURN ${response} Query Entities [Arguments] @@ -143,10 +145,13 @@ Query Entities Set To Dictionary ${params} geometry=${geometry} END - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + ${response}= GET + ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} RETURN ${response} Query Entities Via POST @@ -176,9 +181,12 @@ Query Entities Via POST IF '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} END - ${response}= REST.POST ${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} body=${params} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} + ... json=${params} + ... headers=${headers} + ... expected_status=any + Output ${response} RETURN ${response} Retrieve Entity by Id @@ -190,10 +198,10 @@ Retrieve Entity by Id ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET ${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} - Output request - Output response + ${response}= GET url=${url}/${ENTITIES_ENDPOINT_PATH}${id} headers=${headers} expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Entity Selecting Content Type [Arguments] ${filename} ${entity_id} ${content_type} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -208,73 +216,48 @@ Create Entity Selecting Content Type ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - ${request}= Output request - Output response - RETURN ${request} ${response} + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... json=${entity} + ... headers=${headers} + ... expected_status=any + Output ${response} + RETURN ${response} Append Entity Attributes [Arguments] ${id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.POST - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ - ... body=${fragment_payload} + ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... data=${file_content} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Append Entity Attributes With Parameters [Arguments] ${id} ${fragment_filename} ${content_type} ${options} &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.POST - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} - ... body=${fragment_payload} + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} + ... json=${fragment_payload} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} -Append Entity Attributes Using Session - [Arguments] ${id} ${filename} ${content_type} ${options} - ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${filename} - Create Session OneRequest ${url} +Update Entity Attributes + [Arguments] ${id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session - ... OneRequest - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ - ... params=options=${options} - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Set Test Variable ${response} - -Update Entity Attributes Using Session - [Arguments] ${id} ${fragment_filename} ${content_type} ${options} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH On Session - ... OneRequest - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ${response}= PATCH + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response.json()} - Set Test Variable ${response} - -Update Entity Attributes - [Arguments] ${id} ${fragment_filename} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.PATCH - ... ${ENTITIES_ENDPOINT_PATH}${id}/attrs/ - ... body=${fragment_payload} - ... headers=${headers} - Output request - Output response + Output ${response} RETURN ${response} Delete Entity Attributes @@ -293,11 +276,11 @@ Delete Entity Attributes Append To List ${params} deleteAll=${deleteAll} END ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= REST.DELETE - ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} + ${response}= DELETE + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Partial Update Entity Attributes @@ -318,12 +301,12 @@ Partial Update Entity Attributes ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} - ${response}= REST.PATCH - ... ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} - ... body=${fragment_payload} + ${response}= PATCH + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} + ... json=${fragment_payload} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Retrieve Entity Types @@ -340,11 +323,14 @@ Retrieve Entity Types ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END IF ${details} Set To Dictionary ${params} details=${details} - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/ headers=${headers} query=${params} - Output request - Output response - + ${response}= GET + ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/ + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Entity Type [Arguments] ${type} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -358,11 +344,13 @@ Retrieve Entity Type ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} - Output request - Output response - + ${response}= GET + ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/${type} + ... headers=${headers} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Attributes [Arguments] ${context}=${EMPTY} ${details}=${FALSE} ${accept}=${EMPTY} @@ -378,11 +366,14 @@ Retrieve Attributes ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END IF ${details} Set To Dictionary ${params} details=${details} - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - + ${response}= GET + ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Attribute [Arguments] ${attribute_name} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -396,11 +387,13 @@ Retrieve Attribute ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} - Output request - Output response - + ${response}= GET + ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} + ... headers=${headers} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Context Source Registration With Return [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -413,57 +406,32 @@ Create Context Source Registration With Return ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.POST ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} body=${payload} headers=${headers} - ${request}= Output request - Output response - RETURN ${request} ${response} - -Create Context Source Registration Using Session - [Arguments] ${filename} ${content_type} - ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session - ... OneRequest - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} - ... data=${file_content} + ${response}= POST + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... json=${payload} ... headers=${headers} ... expected_status=any - Output ${response.json()} + Output ${response} RETURN ${response} Update Context Source Registration With Return [Arguments] ${registration_id} ${fragment} ${content_type} ${accept}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} - ${response}= REST.PATCH - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - ... body=${fragment} - ... headers=${headers} - ${request}= Output request - Output response - RETURN ${response} - -Update Context Source Registration Using Session - [Arguments] ${registration_id} ${filename} ${content_type} - ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= PATCH On Session - ... OneRequest - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - ... data=${file_content} + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... json=${fragment} ... headers=${headers} ... expected_status=any - Output request - Output response + Output ${response} RETURN ${response} Delete Context Source Registration With Return [Arguments] ${registration_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} - Output request - Output response + ${response}= DELETE + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... expected_status=any + Output ${response} RETURN ${response} Create Entity @@ -471,9 +439,13 @@ Create Entity ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST ${ENTITIES_ENDPOINT_PATH} body=${entity} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... json=${entity} + ... headers=${headers} + ... expected_status=any + Output ${response} + RETURN ${response} Create Or Update Temporal Representation Of Entity Selecting Content Type [Arguments] ${temporal_entity_representation_id} ${filename} ${content_type} ${accept}=${EMPTY} @@ -486,54 +458,37 @@ Create Or Update Temporal Representation Of Entity Selecting Content Type IF '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} END - ${response}= REST.POST - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ - ... body=${temporal_entity_representation} + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ + ... json=${temporal_entity_representation} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} -Create Temporal Representation Of Entity Selecting Content Type Using Session +Create Temporal Representation Of Entity Selecting Content Type [Arguments] ${filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} - Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session - ... OneRequest - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response.json()} Set Test Variable ${response} + Output ${response} RETURN ${response} Append Attribute To Temporal Entity [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} &{headers}= Create Dictionary Content-Type=${content_type} - ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= REST.POST - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs - ... body=${fragment_payload} - ... headers=${headers} - Output request - Output response - RETURN ${response} - -Append Attribute To Temporal Entity Using Session - [Arguments] ${temporal_entity_id} ${fragment_filename} ${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - Create Session OneRequest ${url} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= POST On Session - ... OneRequest - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs ... data=${file_content} ... headers=${headers} ... expected_status=any - Output ${response.json()} - Set Test Variable ${response} + Output ${response} RETURN ${response} Modify Attribute Instance From Temporal Entity @@ -551,12 +506,12 @@ Modify Attribute Instance From Temporal Entity ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} - ${response}= REST.PATCH - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} - ... body=${fragment_payload} + ${response}= PATCH + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ... json=${fragment_payload} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Delete Attribute From Temporal Entity @@ -581,26 +536,21 @@ Delete Attribute From Temporal Entity Append To List ${params} deleteAll=${deleteAll} END ${params_as_string}= Catenate SEPARATOR=& @{params} - ${response}= REST.DELETE - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} + ${response}= DELETE + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Delete Temporal Representation Of Entity With Returning Response [Arguments] ${temporal_entity_representation_id} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response + ${response}= DELETE + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... expected_status=any + Output ${response} RETURN ${response} -Delete Several Temporal Representations Of Entities - [Arguments] @{temporal_entity_representation_ids} - FOR ${temporal_entity_representation_id} IN @{temporal_entity_representation_ids} - Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id} - END - Get Temporal Representation Of Entity [Arguments] ... ${temporal_entity_representation_id} @@ -621,12 +571,12 @@ Get Temporal Representation Of Entity IF ${options_length}>0 Set To Dictionary ${params} options=${options} END - ${response}= REST.GET - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ${response}= GET + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... headers=${headers} - ... query=${params} - Output request - Output response + ... params=${params} + ... expected_status=any + Output ${response} RETURN ${response} Delete Attribute Instance From Temporal Entity @@ -637,11 +587,11 @@ Delete Attribute Instance From Temporal Entity ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.DELETE - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ${response}= DELETE + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Update Temporal Representation Of Entity Selecting Content Type @@ -654,12 +604,12 @@ Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_fragment}= Load JSON From File ... ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.PATCH - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} - ... body=${temporal_entity_fragment} + ${response}= PATCH + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id}/attrs/${attrId}/${instanceId} + ... json=${temporal_entity_fragment} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} RETURN ${response} Batch Create Entities @@ -678,70 +628,77 @@ Batch Create Entities ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.POST ${BATCH_CREATE_ENDPOINT_PATH} body=@{entities_to_be_created} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${url}/${BATCH_CREATE_ENDPOINT_PATH} + ... json=@{entities_to_be_created} + ... headers=${headers} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Batch Upsert Entities [Arguments] @{entities_to_be_upserted} ${update_option}=replace &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} - ... body=@{entities_to_be_upserted} + ${response}= POST + ... url=${url}/${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} + ... json=@{entities_to_be_upserted} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Batch Update Entities [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} - ... body=@{entities_to_be_updated} + ${response}= POST + ... url=${url}/${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} + ... json=@{entities_to_be_updated} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Batch Delete Entities [Arguments] @{entities_ids_to_be_deleted} ${teardown}=False &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${BATCH_DELETE_ENDPOINT_PATH} - ... body=@{entities_ids_to_be_deleted} + ${response}= POST + ... url=${url}/${BATCH_DELETE_ENDPOINT_PATH} + ... json=@{entities_ids_to_be_deleted} ... headers=${headers} - Output request - Output response + ... expected_status=any IF not ${teardown} Set Test Variable ${response} + Output ${response} + RETURN ${response} Request Entity From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - Create Session OneRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session - ... OneRequest - ... ${ENTITIES_ENDPOINT_PATH} + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Batch Request Entities From File [Arguments] ${batchOperation} ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} - Create Session BatchRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session - ... BatchRequest - ... ${endpoint_url} + ${response}= POST + ... url=${url}/${endpoint_url} ... data=${file_content} ... headers=${headers} ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Temporal Representation Of Entity [Arguments] ${filename} ${temporal_entity_representation_id} @@ -752,12 +709,13 @@ Create Temporal Representation Of Entity ... ${temporal_entity_representation_id} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH} - ... body=${temporal_entity_representation} + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... json=${temporal_entity_representation} ... headers=${headers} - Output request - Output response + ... expected_status=any + Output ${response} + RETURN ${response} Retrieve Temporal Representation Of Entity [Arguments] @@ -794,13 +752,14 @@ Retrieve Temporal Representation Of Entity END IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} - ${response}= REST.GET - ... ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ${response}= GET + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... headers=${headers} - ... query=${params} - Output request - Output response + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Query Temporal Representation Of Entities [Arguments] @@ -862,10 +821,14 @@ Query Temporal Representation Of Entities END IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response + ${response}= GET + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Query Temporal Representation Of Entities Via Post [Arguments] ${query_file_name} ${content_type}=${CONTENT_TYPE_JSON} ${context}=${EMPTY} @@ -875,45 +838,47 @@ Query Temporal Representation Of Entities Via Post ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${query_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${query_file_name} - ${response}= REST.POST - ... ${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query - ... body=${query_payload} + ${response}= POST + ... url=${url}/${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query + ... json=${query_payload} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Delete Temporal Representation Of Entity [Arguments] ${temporal_entity_representation_id} - ${response}= REST.DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response + ${response}= DELETE + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... expected_status=any + Output ${response} + RETURN ${response} Create Context Source Registration [Arguments] ${context_source_registration_payload} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= REST.POST - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} - ... body=${context_source_registration_payload} + ${response}= POST + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... json=${context_source_registration_payload} ... headers=${headers} - ${request}= Output request - Output response - - Set Suite Variable ${request} + ... expected_status=any Set Suite Variable ${response} + Output ${response} + RETURN ${response} Update Context Source Registration [Arguments] ${context_source_registration_id} ${update_fragment} - ${response}= REST.PATCH - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - ... body=${update_fragment} - Output request - Output response - + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... json=${update_fragment} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Query Context Source Registrations [Arguments] @@ -932,6 +897,7 @@ Query Context Source Registrations ... ${timeAt}=${EMPTY} ... ${limit}=${EMPTY} ... ${page}=${EMPTY} + ... ${accept}=${EMPTY} &{headers}= Create Dictionary &{params}= Create Dictionary @@ -966,20 +932,22 @@ Query Context Source Registrations IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} IF '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Delete Context Source Registration [Arguments] ${context_source_registration_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} - Output request - Output response - + ${response}= DELETE url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} Set Suite Variable ${response} + Output ${response} + RETURN ${response} Retrieve Context Source Registration [Arguments] ${context_source_registration_id} ${context}=${EMPTY} ${accept}=${EMPTY} @@ -991,13 +959,13 @@ Retrieve Context Source Registration ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET - ... ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... headers=${headers} - Output request - Output response - + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Context Source Registration Subscription [Arguments] ${subscription_payload} ${accept}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} @@ -1006,26 +974,25 @@ Create Context Source Registration Subscription IF '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} END - ${response}= REST.POST - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} - ... body=${subscription_payload} + ${response}= POST + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... json=${subscription_payload} ... headers=${headers} - ${request}= Output request - Output response - - Set Suite Variable ${request} + ... expected_status=any Set Suite Variable ${response} + Output ${response} + RETURN ${response} Update Context Source Registration Subscription [Arguments] ${subscription_id} ${subscription_update_fragment} - ${response}= REST.PATCH - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - ... body=${subscription_update_fragment} - Output request - Output response - + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... json=${subscription_update_fragment} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Context Source Registration Subscription [Arguments] ${subscription_id} ${context}=${EMPTY} ${accept}=${CONTENT_TYPE_JSON} @@ -1037,13 +1004,13 @@ Retrieve Context Source Registration Subscription ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... headers=${headers} - Output request - Output response - + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Query Context Source Registration Subscriptions [Arguments] ${context}=${EMPTY} ${limit}=${EMPTY} ${page}=${EMPTY} ${accept}=${EMPTY} @@ -1059,34 +1026,33 @@ Query Context Source Registration Subscriptions IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} IF '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= REST.GET - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} ... headers=${headers} - ... query=${params} - Output request - Output response - + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Delete Context Source Registration Subscription [Arguments] ${subscription_id} - ${response}= REST.DELETE ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - Output request - Output response - + ${response}= DELETE ${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} Set Suite Variable ${response} + Output ${response} + RETURN ${response} Update Context Source Registration Subscription From File [Arguments] ${subscription_id} ${file_path} ${file_content}= Get File ${EXECDIR}/data/${file_path} - Create Session CsrsUpdateRequest ${url} - ${response}= PATCH On Session - ... CsrsUpdateRequest - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ${response}= PATCH + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... data=${file_content} ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Create Subscription [Arguments] @@ -1106,9 +1072,12 @@ Create Subscription END ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${filename_path} ${subscription}= Update Value To JSON ${subscription_payload} $..id ${subscription_id} - ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... json=${subscription} + ... headers=${headers} + ... expected_status=any + Output ${response} RETURN ${response} Create Subscription From Subscription Payload @@ -1126,22 +1095,26 @@ Create Subscription From Subscription Payload ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.POST ${SUBSCRIPTION_ENDPOINT_PATH} body=${subscription_payload} headers=${headers} - Output request - Output response + ${response}= POST + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... json=${subscription_payload} + ... headers=${headers} + ... expected_status=any + Output ${response} + RETURN ${response} Create Subscription From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} - Create Session SubscriptionCreateRequest ${url} &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST On Session - ... SubscriptionCreateRequest - ... ${SUBSCRIPTION_ENDPOINT_PATH} + ${response}= POST + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Update Subscription [Arguments] @@ -1160,13 +1133,13 @@ Update Subscription ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END ${subscription_update_fragment}= Load JSON From File ${EXECDIR}/data/${fragment_filename} - ${response}= REST.PATCH - ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - ... body=${subscription_update_fragment} + ${response}= PATCH + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... json=${subscription_update_fragment} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} RETURN ${response} Update Subscription With Payload @@ -1180,21 +1153,20 @@ Update Subscription With Payload ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.PATCH - ... ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - ... body=${payload} + ${response}= PATCH + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... json=${payload} ... headers=${headers} - Output request - Output response + ... expected_status=any Set Test Variable ${response} + Output ${response} RETURN ${response} Delete Subscription [Arguments] ${subscription_id} - ${response}= REST.DELETE ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} - Output request - Output response + ${response}= DELETE url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} expected_status=any Set Suite Variable ${response} + Output ${response} RETURN ${response} Query Subscriptions @@ -1213,11 +1185,14 @@ Query Subscriptions Set To Dictionary ${headers} Accept ${accept} END - ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH} headers=${headers} query=${params} - Output request - Output response - + ${response}= GET + ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any Set Test Variable ${response} + Output ${response} + RETURN ${response} Retrieve Subscription [Arguments] ${id} ${accept}=${EMPTY} ${context}=${EMPTY} ${content_type}=${CONTENT_TYPE_LD_JSON} @@ -1232,117 +1207,10 @@ Retrieve Subscription ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - ${response}= REST.GET ${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} - ${request}= Output request - Output response + ${response}= GET url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${id} headers=${headers} expected_status=any Set Test Variable ${response} - RETURN ${request} ${response} - -Update Context Source Registration Subscription By Selecting Content Type - [Arguments] ${subscription_id} ${subscription_update_fragment} ${content_type} ${accept}=${EMPTY} - &{headers}= Create Dictionary Content-Type=${content_type} - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.PATCH - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} - ... body=${subscription_update_fragment} - ... headers=${headers} - Output request - Output response - RETURN ${response} - -Retrieve Entity Types With Return - [Arguments] ${accept}=${EMPTY} - &{headers}= Create Dictionary - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH} headers=${headers} - Output request - Output response - RETURN ${response} - -Retrieve Entity Type With Return - [Arguments] ${type} ${accept}=${EMPTY} - &{headers}= Create Dictionary - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.GET ${ENTITIES_TYPES_ENDPOINT_PATH}/${type} headers=${headers} - Output request - Output response - RETURN ${response} - -Retrieve Attributes With Return - [Arguments] ${accept}=${EMPTY} - &{headers}= Create Dictionary - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH} headers=${headers} - Output request - Output response - RETURN ${response} - -Retrieve Attribute With Return - [Arguments] ${attribute_name} ${accept}=${EMPTY} - &{headers}= Create Dictionary - IF '${accept}'!='' - Set To Dictionary ${headers} Accept ${accept} - END - ${response}= REST.GET ${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} headers=${headers} - Output request - Output response - RETURN ${response} - -Create Context Source Registration Subscription With Return - [Arguments] ${subscription_payload} ${content_type} - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST - ... ${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} - ... body=${subscription_payload} - ... headers=${headers} - ${request}= Output request Output ${response} - RETURN ${request} ${response} - -Batch Upsert Entities By Selecting Content Type - [Arguments] @{entities_to_be_upserted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${update_option}=replace - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST - ... ${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} - ... body=@{entities_to_be_upserted} - ... headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Batch Update Entities By Selecting Content Type - [Arguments] - ... @{entities_to_be_updated} - ... ${content_type}=${CONTENT_TYPE_LD_JSON} - ... ${overwrite_option}=overwrite - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST - ... ${BATCH_UPDATE_ENDPOINT_PATH}?options=${overwrite_option} - ... body=@{entities_to_be_updated} - ... headers=${headers} - Output request - Output response - Set Test Variable ${response} - -Batch Delete Entities By Selecting Content Type - [Arguments] @{entities_ids_to_be_deleted} ${content_type}=${CONTENT_TYPE_LD_JSON} ${teardown}=False - &{headers}= Create Dictionary Content-Type=${content_type} - ${response}= REST.POST - ... ${BATCH_DELETE_ENDPOINT_PATH} - ... body=@{entities_ids_to_be_deleted} - ... headers=${headers} - Output request - Output response - IF not ${teardown} Set Test Variable ${response} - Set Test Variable ${response} + RETURN ${response} Query Context Source Registrations With Return [Arguments] @@ -1396,10 +1264,13 @@ Query Context Source Registrations With Return IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} IF '${page}'!='' Set To Dictionary ${params} page=${page} - ${response}= REST.GET ${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} headers=${headers} query=${params} - ${request}= Output request - Output response - RETURN ${request} ${response} + ${response}= GET + ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any + Output ${response} + RETURN ${response} Query Temporal Representation Of Entities With Return [Arguments] @@ -1461,7 +1332,10 @@ Query Temporal Representation Of Entities With Return END IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} - ${response}= REST.GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} - ${request}= Output request - Output response - RETURN ${request} ${response} + ${response}= GET + ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... headers=${headers} + ... params=${params} + ... expected_status=any + Output ${response} + RETURN ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 13fe117f59406608c7e739d660380527cbfd11c1..8692bdca195d718d7313892bb708c1d9dfa9a769 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -3,7 +3,6 @@ Library ${EXECDIR}/libraries/assertionUtils.py Library RequestsLibrary Library Collections Library JSONLibrary -Library REST Library String @@ -23,24 +22,22 @@ Check Response Status Code Should Be Equal ${expected_status_code} ${response_status_code} Check Response Status Code Set To - [Arguments] ${expected_status} - ${response_status}= convert to string ${response['status']} - Should Be Equal ${response_status} ${expected_status} + [Arguments] ${expected_status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${expected_status} Check RL Response Status Code Set To - [Arguments] ${expected_status} - Status Should Be ${expected_status} ${response} + [Arguments] ${expected_status} + Status Should Be ${expected_status} ${response} Check Response Body Containing Array Of URIs set to [Arguments] @{expected_entities_ids} - Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True + Lists Should Be Equal ${expected_entities_ids} ${response.json()} ignore_order=True Check Response Body Content [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} - Output ${response_body} - Output ${entity_payload} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_payload} ... ${response_body} @@ -49,28 +46,22 @@ Check Response Body Content Check Response Headers Containing Content-Type set to [Arguments] ${response} ${expected_content_type_content} - Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} + Should Be Equal ${response['Content-Type']} ${expected_content_type_content} Check Response Headers Link Not Empty [Arguments] ${response} - Should Not Be Empty ${response['headers']['Link']} + Should Not Be Empty ${response['Link']} # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers Check Response Headers Containing URI set to - [Arguments] ${expected_path} ${expected_entity_id} ${response} + [Arguments] ${expected_entity_id} ${response} - IF 'Location' in ${response['headers']} - Should Be Equal - ... ${expected_path}${expected_entity_id} - ... ${response['headers']['Location']} - ... ignore_order=True - END - IF 'location' in ${response['headers']} - Should Be Equal - ... ${expected_path}${expected_entity_id} - ... ${response['headers']['location']} + IF 'Location' in ${response} + Should Contain + ... ${response['Location']} + ... ${expected_entity_id} ... ignore_order=True END @@ -81,34 +72,29 @@ Check Response Headers ID Not Empty [Arguments] ${response} ${location_header}= Set Variable If - ... 'Location' in ${response['headers']} - ... ${response['headers']['Location']} - ... ${response['headers']['location']} + ... 'Location' in ${response} + ... ${response['Location']} ${id}= Fetch From Right ${location_header} / Should Not Be Empty ${id} RETURN ${id} Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} ${expected_attribute_value}=${EMPTY} - Should Not Be Empty ${response['body']['${expected_attribute_name}']} + Should Not Be Empty ${response.json()['${expected_attribute_name}']} IF '${expected_attribute_value}'!='' - Should Be Equal ${response['body']['${expected_attribute_name}']} ${expected_attribute_value} + Should Be Equal ${response.json()['${expected_attribute_name}']} ${expected_attribute_value} END -Check Response Body Details Containing Information Error - [Arguments] ${expected_error_message} - Should be Equal ${expected_error_message} ${response['body']['details']} - Check Response Body Containing Batch Operation Result [Arguments] ${expected_batch_operation_result} @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success @{expected_failed_entities_ids}= Get From Dictionary ${expected_batch_operation_result} errors - @{response_errors}= Get From Dictionary ${response['body']} errors + @{response_errors}= Get From Dictionary ${response.json()} errors ${expected_failed_entities_ids_length}= Get Length ${expected_failed_entities_ids} ${response_errors_length}= Get Length ${response_errors} - Lists Should Be Equal ${expected_successful_entities_ids} ${response['body']['success']} ignore_order=True + Lists Should Be Equal ${expected_successful_entities_ids} ${response.json()['success']} ignore_order=True Should be Equal as Integers ${expected_failed_entities_ids_length} ${response_errors_length} FOR ${response_error} IN @{response_errors} List Should Contain Value ${expected_failed_entities_ids} ${response_error['entityId']} @@ -160,7 +146,7 @@ Check Response Body Containing EntityTemporal element ... ${temporal_entity_representation_id} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${temporal_entity_representation} - ... ${response['body']} + ... ${response.json()} ... ${instance_id_regex_expr} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -178,7 +164,7 @@ Check Response Body Containing List Containing EntityTemporal elements END ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${temporal_entities_representation_payload} - ... ${response['body']} + ... ${response.json()} ... ${instance_id_regex_expr} ... group_by=id Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -190,7 +176,7 @@ Check Response Body Containing Subscription element ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -208,7 +194,7 @@ Check Response Body Containing List Containing Subscription elements ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -218,20 +204,23 @@ Check Response Body Containing List Containing Subscription elements Check Response Body Containing Number Of Entities [Arguments] ${expected_entity_type} ${expected_length} - ${response_body_length}= Get Length ${response['body']} - ${is_list}= Run Keyword Evaluate type(${response['body']})==list + ${response_body_length}= Get Length ${response.json()} + ${is_list}= Run Keyword Evaluate type(${response.json()})==list IF ${is_list} Should Be Equal ${response_body_length} ${expected_length} + ELSE + Should Be Equal ${1} ${expected_length} END - Run Keyword Unless ${is_list} Should Be Equal ${1} ${expected_length} FOR ${index} IN RANGE ${expected_length} IF ${is_list} - Should Be Equal ${response['body'][${index}]['type']} ${expected_entity_type} + Should Be Equal ${response.json()[${index}]['type']} ${expected_entity_type} END END - Run Keyword Unless ${is_list} Should Be Equal ${response['body']['type']} ${expected_entity_type} + IF ${is_list} is ${FALSE} + Should Be Equal ${response.json()['type']} ${expected_entity_type} + END Check Response Body Containing Context Source Registration element [Arguments] ${expectation_filename} ${context_source_registration_id} @@ -243,7 +232,7 @@ Check Response Body Containing Context Source Registration element ${ignored_keys}= Create List ${context_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${context_source_registration} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -253,7 +242,7 @@ Check Response Body Containing EntityTypeList element ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_list_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -263,7 +252,7 @@ Check Response Body Containing EntityType element ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -273,7 +262,7 @@ Check Response Body Containing EntityTypeInfo element ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_type_info_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -283,7 +272,7 @@ Check Response Body Containing AttributeList element ${ignored_keys}= Create List ${id_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${attribute_list_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -293,7 +282,7 @@ Check Response Body Containing Attribute element ${ignored_keys}= Create List ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${attribute_payload} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -311,7 +300,7 @@ Check Response Body Containing List Containing Context Source Registrations elem END ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_context_source_registrations_payload} - ... ${response['body']} + ... ${response.json()} ... ${EMPTY} ... group_by=id Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -322,7 +311,7 @@ Check Response Body Type When Using Session Request Check Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response} ${type} - Should Be Equal ${response['body']['type']} ${type} + Should Be Equal ${response['type']} ${type} Check Response Body Title When Using Session Request [Arguments] ${response} @@ -330,32 +319,22 @@ Check Response Body Title When Using Session Request Check Response Body Containing ProblemDetails Element Containing Title Element [Arguments] ${response} - Should Not Be Empty ${response['body']['title']} + Should Not Be Empty ${response['title']} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response} ${type} - ${json_response_body}= Set Variable ${response.json()} + ${json_response_body}= Set Variable ${response} Should Be Equal ${json_response_body['type']} ${type} Check RL Response Body Containing ProblemDetails Element Containing Title Element [Arguments] ${response} - ${json_response_body}= Set Variable ${response.json()} + ${json_response_body}= Set Variable ${response} Should Not Be Empty ${json_response_body['title']} -Assert response status code - [Arguments] ${code} - Should Be Equal ${response}[status] ${code} - -Check HTTP Response Status Code Is - [Arguments] ${expected_status} - ${status}= Convert To Integer ${expected_status} - Should Be Equal ${response['status']} ${status} - Log Status code validated - Check JSON Value In Response Body [Arguments] ${json_path_expr} ${value_to_check} - Should Be Equal As Strings ${response['body']${json_path_expr}} ${value_to_check} + Should Be Equal As Strings ${response.json()${json_path_expr}} ${value_to_check} Check NotificationParams [Arguments] ${filename} ${expected_additional_members} @@ -364,12 +343,12 @@ Check NotificationParams ${ignored_keys}= Create List ${notification_timestamps_regex_expr} ${notification_endpoint_uri_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_notification} - ... ${response['body']['notification']} + ... ${response.json()['notification']} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} FOR ${expected_additional_member} IN @{expected_additional_members} - Should Not Be Empty ${response['body']['notification']['${expected_additional_member}']} + Should Not Be Empty ${response.json()['notification']['${expected_additional_member}']} END Check Pagination Prev And Next Headers @@ -377,43 +356,23 @@ Check Pagination Prev And Next Headers ${expected_links}= Create List ${prev_link} ${next_link} IF '${prev_link}'!='' and '${next_link}'!='' Lists Should Be Equal - ... ${response['headers']['Link'].replace(" ", "").split(',')} + ... ${response.headers['Link'].replace(" ", "").split(',')} ... ${expected_links} ... ignore_order=True END IF '${prev_link}'!='' and '${next_link}'=='' - Should Be Equal ${response['headers']['Link']} ${prev_link} + Should Be Equal ${response.headers['Link']} ${prev_link} END IF '${prev_link}'=='' and '${next_link}'!='' - Should Be Equal ${response['headers']['Link']} ${next_link} + Should Be Equal ${response.headers['Link']} ${next_link} END -Check Response Body Containing One Subscription element - [Arguments] ${expectation_filename} ${response_body} - ${payload}= Load JSON From File ${EXECDIR}/data/csourceSubscriptions/expectations/${expectation_filename} - ${subscription}= Update Value To JSON ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys - ... ${subscription} - ... ${response_body} - ... ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} - -Check Response Body Containing One Registration element - [Arguments] ${expectation_filename} ${response_body} - ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/expectations/${expectation_filename} - ${registration}= Update Value To JSON ${payload} $..id ${response_body['id']} - ${comparison_result}= Compare Dictionaries Ignoring Keys - ... ${registration} - ... ${response_body} - ... ${instance_id_regex_expr} - Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} - Check Resource Set To [Arguments] ${expected_resource} ${ignored_keys}=${None} ${group_by}=${None} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expected_resource} - ... ${response['body']} + ... ${response.json()} ... ${ignored_keys} ... ${group_by} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} @@ -423,13 +382,6 @@ Check Created Resource Set To Check Resource Set To ${created_resource} ${ignored_keys} -Check Subscription Failed - [Arguments] ${subscription} - - Should Be True ${sub} - - Check Resource Set To ${created_resource} ${ignored_keys} - Check Created Resources Set To [Arguments] ${expected_resources} ${ignored_keys}=${None} @@ -446,8 +398,8 @@ Check Updated Resources Set To Check Resource Set To ${updated_resources} ${ignored_keys} group_by=id Check SUT Not Containing Resource - ${response_status}= convert to string ${response['status']} + ${response_status}= convert to string ${response.status_code} Should Be Equal ${response_status} 404 Check SUT Not Containing Resources - Should Be Empty ${response['body']} + Should Be Empty ${response.json()} diff --git a/resources/HttpUtils.resource b/resources/HttpUtils.resource index 7a16eddedc618642fbfe5969bda3604d15d45112..1dab3303e4e3bd2221dbf899087e4382d3567131 100755 --- a/resources/HttpUtils.resource +++ b/resources/HttpUtils.resource @@ -5,5 +5,5 @@ Library String *** Keywords *** Fetch Id From Response Location Header - ${id}= Fetch From Right ${response['headers']['Location']} / + ${id}= Fetch From Right ${response.headers['Location']} / RETURN ${id} diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index 2a88bd8e76879ad93d453e3c56f5bd3237d136e9..82ef9dc0b068a77e89e8b9f8cd8569753d2de7de 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -19,15 +19,6 @@ Wait for redirected request Wait For Request ${timeout} Reply By 200 -Wait for redirected failed request - [Arguments] ${timeout}=${5} - # HTTP server receives it and checks incoming request for correctness - # .. "Wait For Request" - # .... This call is blocked until HTTP request arrives or timeout. - # .... Further detaills: https://annoviko.github.io/robotframework-httpctrl/server.html#Wait%20For%20Request - Wait For Request ${timeout} - Reply By 400 - Stop Context Source Mock Server # Terminate HTTP Server Stop Server