From 2d62f0ea664487ccb18aabaa9e4f37c986a08a41 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 6 May 2023 09:33:27 +0200 Subject: [PATCH] feat: clean up used libraries - Remove unused libraries (`metrics`, `JsonSchemaLibrary`, `RESTinstances`) - Use only robotframework-requests library - Remove unused function - Return always response in API Requests - Remove deprecated KeyWord `Run Keyword Unless` - Remove duplicated function (`Check Status Code Set to`) - Recreate the use of the Output keyword of REST library (pretty print HTTP request and response) --- README.md | 11 +- TP/NGSI-LD/CommonBehaviours/043.robot | 33 +- TP/NGSI-LD/CommonBehaviours/044_01.robot | 10 +- TP/NGSI-LD/CommonBehaviours/044_02.robot | 44 +- TP/NGSI-LD/CommonBehaviours/044_03.robot | 22 +- TP/NGSI-LD/CommonBehaviours/044_04.robot | 24 +- TP/NGSI-LD/CommonBehaviours/044_05.robot | 14 +- .../027_01_01.robot | 9 +- .../027_01_02.robot | 4 +- .../RetrieveAvailableAttributes/025_01.robot | 4 +- .../024_01_01.robot | 9 +- .../024_01_02.robot | 4 +- .../RetrieveAvailableEntityTypes/022_01.robot | 4 +- .../026_01.robot | 4 +- .../023_01.robot | 4 +- .../Entity/QueryEntities/019_01_01.robot | 16 +- .../Entity/QueryEntities/019_01_02.robot | 16 +- .../Entity/QueryEntities/019_01_03.robot | 12 +- .../Entity/QueryEntities/019_01_04.robot | 12 +- .../Entity/QueryEntities/019_01_05.robot | 12 +- .../Entity/QueryEntities/019_02_01.robot | 18 +- .../Entity/QueryEntities/019_02_02.robot | 18 +- .../Entity/QueryEntities/019_02_03.robot | 14 +- .../Entity/QueryEntities/019_02_04.robot | 14 +- .../Entity/QueryEntities/019_02_05.robot | 14 +- .../Entity/QueryEntities/019_03_01.robot | 14 +- .../Entity/QueryEntities/019_03_02.robot | 14 +- .../Entity/QueryEntities/019_03_03.robot | 14 +- .../Entity/QueryEntities/019_03_04.robot | 14 +- .../Entity/QueryEntities/019_03_05.robot | 14 +- .../Entity/QueryEntities/019_04.robot | 16 +- .../Entity/QueryEntities/019_05.robot | 16 +- .../Entity/QueryEntities/019_06.robot | 14 +- .../Entity/RetrieveEntity/018_01_01.robot | 10 +- .../Entity/RetrieveEntity/018_01_02.robot | 10 +- .../Entity/RetrieveEntity/018_01_03.robot | 10 +- .../Entity/RetrieveEntity/018_02.robot | 8 +- .../Entity/RetrieveEntity/018_03_01.robot | 8 +- .../Entity/RetrieveEntity/018_03_02.robot | 12 +- .../Entity/RetrieveEntity/018_04.robot | 10 +- .../Entity/RetrieveEntity/018_05.robot | 10 +- .../Entity/RetrieveEntity/018_06.robot | 6 +- .../021_01.robot | 4 +- .../021_02.robot | 4 +- .../021_03.robot | 4 +- .../021_04.robot | 4 +- .../021_05.robot | 4 +- .../021_06.robot | 4 +- .../021_07.robot | 4 +- .../021_08.robot | 4 +- .../021_09.robot | 4 +- .../021_10.robot | 5 +- .../021_11.robot | 4 +- .../021_12.robot | 9 +- .../021_13.robot | 6 +- .../020_01.robot | 4 +- .../020_02.robot | 4 +- .../020_03.robot | 4 +- .../020_04.robot | 4 +- .../020_05.robot | 4 +- .../020_06.robot | 8 +- .../020_07.robot | 8 +- .../020_08.robot | 9 +- .../020_09.robot | 8 +- .../020_10.robot | 4 +- .../CreateBatchOfEntities/003_01.robot | 8 +- .../CreateBatchOfEntities/003_02.robot | 9 +- .../CreateBatchOfEntities/003_03.robot | 8 +- .../CreateBatchOfEntities/003_04.robot | 10 +- .../CreateBatchOfEntities/003_05.robot | 10 +- .../CreateBatchOfEntities/003_06.robot | 8 +- .../CreateBatchOfEntities/003_07.robot | 10 +- .../CreateBatchOfEntities/003_08.robot | 8 +- .../CreateBatchOfEntities/003_09.robot | 8 +- .../DeleteBatchOfEntities/006_01.robot | 6 +- .../DeleteBatchOfEntities/006_02.robot | 6 +- .../DeleteBatchOfEntities/006_03.robot | 8 +- .../UpdateBatchOfEntities/005_01.robot | 6 +- .../UpdateBatchOfEntities/005_02.robot | 6 +- .../UpdateBatchOfEntities/005_03.robot | 8 +- .../UpdateBatchOfEntities/005_04.robot | 8 +- .../UpsertBatchOfEntities/004_01.robot | 8 +- .../UpsertBatchOfEntities/004_02.robot | 8 +- .../UpsertBatchOfEntities/004_03.robot | 6 +- .../UpsertBatchOfEntities/004_04.robot | 8 +- .../UpsertBatchOfEntities/004_05.robot | 8 +- .../UpsertBatchOfEntities/004_06.robot | 8 +- .../Entities/CreateEntity/001_01.robot | 13 +- .../Entities/CreateEntity/001_02.robot | 8 +- .../Entities/CreateEntity/001_03.robot | 12 +- .../Entities/CreateEntity/001_04.robot | 8 +- .../Entities/CreateEntity/001_05.robot | 11 +- .../Entities/CreateEntity/001_06.robot | 8 +- .../Entities/CreateEntity/001_07.robot | 8 +- .../Entities/CreateEntity/001_08.robot | 8 +- .../Entities/CreateEntity/001_09.robot | 8 +- .../Entities/DeleteEntity/002_01.robot | 8 +- .../Entities/DeleteEntity/002_02.robot | 6 +- .../Entities/DeleteEntity/002_03.robot | 6 +- .../AppendEntityAttributes/010_01.robot | 24 +- .../AppendEntityAttributes/010_02.robot | 19 +- .../AppendEntityAttributes/010_03.robot | 7 +- .../DeleteEntityAttribute/013_01.robot | 11 +- .../DeleteEntityAttribute/013_02.robot | 6 +- .../DeleteEntityAttribute/013_03.robot | 6 +- .../PartialAttributeUpdate/012_01.robot | 11 +- .../PartialAttributeUpdate/012_02.robot | 10 +- .../PartialAttributeUpdate/012_03.robot | 10 +- .../UpdateEntityAttributes/011_01.robot | 13 +- .../UpdateEntityAttributes/011_02.robot | 19 +- .../UpdateEntityAttributes/011_03.robot | 8 +- .../007_01.robot | 6 +- .../007_02.robot | 6 +- .../009_01.robot | 6 +- .../009_02.robot | 6 +- .../009_03.robot | 6 +- .../008_01.robot | 6 +- .../AppendAttributes/014_01.robot | 6 +- .../AppendAttributes/014_02.robot | 10 +- .../AppendAttributes/014_03.robot | 4 +- .../DeleteAttribute/015_01.robot | 6 +- .../DeleteAttribute/015_02.robot | 8 +- .../DeleteAttribute/015_03.robot | 8 +- .../DeleteAttributeInstance/017_01.robot | 10 +- .../DeleteAttributeInstance/017_02.robot | 6 +- .../DeleteAttributeInstance/017_03.robot | 6 +- .../ModifyAttributeInstance/016_01.robot | 12 +- .../ModifyAttributeInstance/016_02.robot | 6 +- .../ModifyAttributeInstance/016_03.robot | 6 +- .../CreateSubscription/028_01.robot | 7 +- .../CreateSubscription/028_02.robot | 8 +- .../CreateSubscription/028_03.robot | 6 +- .../CreateSubscription/028_04.robot | 11 +- .../DeleteSubscription/032_01.robot | 8 +- .../DeleteSubscription/032_02.robot | 8 +- .../DeleteSubscription/032_03.robot | 6 +- .../Subscription/Notification/046_01.robot | 3 +- .../Subscription/Notification/046_02.robot | 4 +- .../Subscription/Notification/046_03.robot | 3 +- .../Subscription/Notification/046_04.robot | 3 +- .../Subscription/Notification/046_05.robot | 3 +- .../Subscription/Notification/046_06.robot | 4 +- .../Subscription/Notification/046_07.robot | 3 +- .../Subscription/Notification/046_08.robot | 4 +- .../Subscription/Notification/046_09.robot | 2 +- .../Subscription/Notification/046_10.robot | 2 +- .../Subscription/Notification/046_11.robot | 8 +- .../Subscription/Notification/046_12.robot | 7 +- .../Subscription/Notification/046_13.robot | 5 +- .../Subscription/Notification/046_14.robot | 2 +- .../QuerySubscriptions/031_01.robot | 4 +- .../QuerySubscriptions/031_02.robot | 4 +- .../RetrieveSubscription/030_01.robot | 8 +- .../RetrieveSubscription/030_02.robot | 8 +- .../RetrieveSubscription/030_03.robot | 4 +- .../UpdateSubscription/029_01.robot | 8 +- .../UpdateSubscription/029_02.robot | 8 +- .../UpdateSubscription/029_03.robot | 12 +- .../UpdateSubscription/029_04.robot | 12 +- .../UpdateSubscription/029_05.robot | 8 +- .../UpdateSubscription/029_06.robot | 6 +- .../UpdateSubscription/029_07.robot | 9 +- .../UpdateSubscription/029_08.robot | 9 +- .../UpdateSubscription/029_09.robot | 9 +- .../UpdateSubscription/029_10.robot | 14 +- .../UpdateSubscription/029_11.robot | 12 +- .../033_01_01.robot | 7 +- .../033_01_02.robot | 8 +- .../033_01_03.robot | 8 +- .../033_02.robot | 11 +- .../033_03.robot | 10 +- .../033_04.robot | 8 +- .../033_05.robot | 8 +- .../033_06.robot | 8 +- .../033_07.robot | 8 +- .../033_08.robot | 8 +- .../033_09.robot | 8 +- .../035_01.robot | 8 +- .../035_02.robot | 8 +- .../035_03.robot | 4 +- .../037_01.robot | 4 +- .../037_02.robot | 8 +- .../037_03.robot | 8 +- .../037_04.robot | 4 +- .../037_05.robot | 9 +- .../037_06.robot | 7 +- .../037_07.robot | 4 +- .../037_08.robot | 4 +- .../037_09.robot | 6 +- .../037_10.robot | 4 +- .../037_11.robot | 4 +- .../036_01.robot | 8 +- .../036_02.robot | 8 +- .../036_03.robot | 4 +- .../036_04.robot | 6 +- .../036_05.robot | 4 +- .../034_01.robot | 8 +- .../034_02.robot | 17 +- .../034_03.robot | 4 +- .../038_01.robot | 8 +- .../038_02.robot | 8 +- .../038_03.robot | 8 +- .../038_04.robot | 8 +- .../038_05.robot | 8 +- .../038_06.robot | 8 +- .../038_07.robot | 9 +- .../038_08.robot | 8 +- .../038_09.robot | 8 +- .../042_01.robot | 8 +- .../042_02.robot | 8 +- .../042_03.robot | 8 +- .../NotificationBehaviour/047_01.robot | 2 +- .../NotificationBehaviour/047_02.robot | 4 +- .../NotificationBehaviour/047_03.robot | 2 +- .../NotificationBehaviour/047_04.robot | 2 +- .../NotificationBehaviour/047_05.robot | 4 +- .../NotificationBehaviour/047_06.robot | 4 +- .../NotificationBehaviour/047_07.robot | 6 +- .../NotificationBehaviour/047_08.robot | 2 +- .../NotificationBehaviour/047_09.robot | 2 +- .../NotificationBehaviour/047_10.robot | 2 +- .../NotificationBehaviour/047_11.robot | 4 +- .../NotificationBehaviour/047_12.robot | 2 +- .../NotificationBehaviour/047_13.robot | 2 +- .../NotificationBehaviour/047_14.robot | 2 +- .../NotificationBehaviour/047_15.robot | 2 +- .../NotificationBehaviour/047_16.robot | 4 +- .../041_01.robot | 4 +- .../041_02.robot | 6 +- .../041_03.robot | 4 +- .../041_04.robot | 8 +- .../040_01.robot | 6 +- .../040_02.robot | 8 +- .../040_03.robot | 8 +- .../039_01.robot | 8 +- .../039_02.robot | 8 +- .../039_03.robot | 8 +- .../039_04.robot | 12 +- .../039_05.robot | 9 +- libraries/logUtils.py | 48 ++ requirements.txt | 3 - resources/ApiUtils.resource | 760 ++++++++---------- resources/AssertionUtils.resource | 150 ++-- resources/HttpUtils.resource | 2 +- resources/MockServerUtils.resource | 9 - 245 files changed, 1405 insertions(+), 1482 deletions(-) create mode 100644 libraries/logUtils.py diff --git a/README.md b/README.md index 5c314cd0..b4925e6f 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 3643488a..62b9ef0a 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 32b3ecf9..279678cd 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 475f6508..f8e87f4b 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 f0b61393..306335d6 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 1f8b1b7e..b0670b2a 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 20f32c37..c7bd6dcc 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 cf01a312..889a5c5e 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 c2fb7083..1a2f0f77 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 17bb74b3..c611457b 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 2ba0b2bf..f45a563b 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 761260d9..33d7f30e 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 22b2d42a..0089b75b 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 77ac8a2d..ff3c6511 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 3f76ca0e..b725e55a 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 6a44b0d9..d09a2f72 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 a33dd671..5656a2ff 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 e4dece98..fbd38643 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 1cdc121f..064080b4 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 754d15c2..84abf539 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 f27065ef..dbb050fb 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 854ba8a4..edf911ad 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 32450318..6643c88e 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 bc09646d..90fbe9b1 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 b4d9dfe6..9b5473cf 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 1538368d..23f067ac 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 c6e8d8d2..e324a597 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 2ab80b97..64d4749a 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 12ab098d..3e1334d6 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 1f1255e1..a3bc3987 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 9cb3a2af..fdf6a3b9 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 b903862f..65a42cff 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 7d239a29..449cd3a9 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 98120195..aa405bc9 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 88ea67fa..b7fbc456 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 2b311a5a..a8fa27b2 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 2ba3ed12..b8ab4a7e 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 56ef5bb5..f73abb0f 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 630c6754..1e3d05d1 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 1370d9c2..75c6fd20 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 5d5eb854..45cfc1e8 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 40246d08..00915f13 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 1d280eb4..2501434a 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 73695a9d..af1dd099 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 b48e938e..0fbed90c 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 8ad92735..30a92bf3 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 f6809bec..1d6c2d16 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 67c5a413..59e25190 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 c6ef14aa..b4075e65 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 8ea5288c..4d1efb4d 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 7d2f24ab..5269eb39 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 544dc923..062f404f 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 2b30e80d..5e0e25de 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 dfed8f79..d52e17b8 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 2f865194..54963f57 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 884d2046..95c4e17b 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 bd965bf3..0d3d4f9b 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 16ad9623..b4d586e0 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 8e5789b9..d1ecd7b6 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 274a150b..0a07a3ac 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 7cfec33b..01262715 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 1d44b0f5..6e6a1d42 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 a56bd842..35b573da 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 b8b5ce55..c536d78b 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 0cea8d05..d982aaa5 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 d79401ef..3961c29c 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 9f0e90eb..383d98fd 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 afbc5db4..980c579e 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 f78f2faa..58d817e6 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 de136701..a16bb2ca 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 538c0f8d..390ff2bf 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 9aa8dc7a..00dc0dbc 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 9926817d..bc106ed5 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 53810f46..cde6b9e3 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 917b0813..17b0c552 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 abe62e7e..c408657c 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 c36cc59e..77423e96 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 9cd6e877..a6150c46 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 005e8145..d307e90c 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 9cfe8864..51137694 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 e00b0a4e..c450dcab 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 7901378a..a8b6abab 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 b41d692c..afcab510 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 882bab4d..de53092e 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 9673baf0..47681f62 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 b66d407e..678baa02 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 1b8c9cc3..75fcacdd 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 a2a680ab..4b83df49 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 061bdd72..1971ddbe 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 c5dc1981..c100cba8 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 3c5d816c..bfbca10a 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 826c6940..4c44f76b 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 5b39952d..333b91ee 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 4e40f111..c2fda435 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 51efb05e..c2834df6 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 e48f067a..4c4940b6 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 1a5a555f..235d5953 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 a3b5e073..62beb73d 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 fc9f8d10..d6b35cba 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 345f90e0..5f2d95f2 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 79a09e95..63d6fb86 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 caecdd7d..f363e0a3 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 3dd3b1ca..8e90be9d 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 094b3eaa..5a665fbe 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 9d2c56c4..d41856d2 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 e8117d22..f62936e2 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 2195665d..626ec9ba 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 5eda275e..cc3175e2 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 af12e56b..9c1abaf8 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 c786688c..ba193571 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 4fed6327..2a355c98 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 409b05be..d78353d6 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 53d97144..f90979e2 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 d03e8368..cd263d54 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 c9c03003..f5208af7 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 5f2a3cf7..95f5bf07 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 c2042366..8e2dd36c 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 7331164d..b510e97a 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 3360b677..93e28938 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 2f50f7ca..c1d3a16a 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 94a7fd93..88c24a25 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 f6d074b4..def7efd2 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 918a4a95..7ae8d891 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 ccfbb73a..ccdb46d9 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 79f7aea0..6909b2a6 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 59d1a523..8629a98d 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 10f330e2..fc7f9636 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 133be618..0fd7114a 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 9c805e2d..0433ba9d 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 24f69dd4..e5e8f6de 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 6fdab2c6..ac0eefe6 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 b2d0a297..906c79f2 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 6683c91b..379e27e8 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 4c86e30a..eb799b7f 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 930dbf02..d9f6c5b9 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 f6ded38a..7a12cff9 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 c366b8b6..371d868d 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 0a9bc524..9459cae7 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 bef47b8a..9378e768 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 bd71d44b..fa8745c9 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 83d3bcdb..15198461 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 d47618f9..a0072675 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 a6c1e607..9bd99774 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 0c52a261..33a1751c 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 94f38d3f..588e9d48 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 8b91cbdb..5b74fc30 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 3867b044..d9d7b847 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 44160ead..9a7ecead 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 d3e13671..1cb6c606 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 b4601190..dcb7ec3d 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 124aac46..757768a1 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 3cd655f2..c8c763a1 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 5527f34a..8159de2e 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 07f3e914..438aafe4 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 95f09088..9cfdf7c1 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 b3e29e80..4f2e1a3e 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 6f036a32..a4ad298f 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 de3acfcb..7175df75 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 86093c7c..94a2b507 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 c9c78770..3c571964 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 0208b267..a3fcfb84 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 af036480..9c8ef145 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 fa850b10..9f07d0e5 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 20d49129..3b2b8fc6 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 1d09768a..a82c2089 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 5540ede2..64d5c3d0 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 69c9629e..a87d5cdb 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 d996cff6..29a3e5ef 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 11abfe09..611e8a09 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 92f24839..7e0055ca 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 8f0667b5..a035d142 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 bc2c7303..d820ecaf 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 bf8c0eaa..cbb25fc5 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 78a6639b..ad381cc9 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 dcbb5536..98ce13ab 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 6a305cd1..92bf6de3 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 90b94a8e..76b18cfd 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 b16395d0..1572d996 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 c6a0411b..67753a4d 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 a6ef7d32..86205978 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 09b5854a..785cab26 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 86577045..2a442f88 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 9b0e6584..a4af8532 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 b6be3201..25864bcb 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 a272c716..b4e1c5d2 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 0820e838..7c8a00c3 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 9a11fd2c..49492e94 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 2300feb7..39a33d5a 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 29718acb..1173a309 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 b35280c7..f8e8711c 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 536e6f29..e85b7ac9 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 3794117d..9d34f7ae 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 a2d3a3dc..8f23c64c 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 0d3f3d52..53055cb1 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 7e0772f6..1a1f6757 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 867c92fc..03d9fed5 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 c0db5c40..7ddf9977 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 bd157e83..c96af787 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 f9f7a674..89d5e80b 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 3fb74d28..9dcaaa19 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 210f79f9..7acfe0ef 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 b6eab9b2..131e2dec 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 dbcfbc4c..da1e0f8e 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 1c62b9ba..6b560383 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 9b4e70a6..c719246c 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 544a9785..e930111c 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 d9d8adee..eb0ea2fb 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 918cfcbd..6474108d 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 e28f93e1..6a605539 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 e5b30eae..87bb7e26 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 ff640433..5b2a24bb 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 fc647951..feaf4e57 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 e806af3e..3c4532d9 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 03b3d264..cded0e4b 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 0256572c..007a80c4 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 f2647ddd..71cc885d 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 839a6d0b..7e321bf0 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 dbf64473..b0064666 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 0621ea7e..87d358eb 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 8cbac3c7..c860c849 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 0e040ee8..d347b1f7 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 92b1867b..e2c586b4 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 fd6c74f1..0f858143 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 16272e2b..54d47f03 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 dd53acce..0ec48479 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 a20cef11..2da0eebd 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 2677278d..e680609d 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 2bc98649..d245dd81 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 f2bf0a32..1d1331d6 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 be5675b3..5cbac889 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 f4a172f6..5391ec10 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 ba1d842b..4990c31b 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 8e4a6855..0387b7e8 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 fb7d52ce..f25b20eb 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 9035fcaa..d3b9d6df 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 32ba76ba..47c31636 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 024b5593..e7617f1d 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 cc767440..9d21c33a 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 7d184f53..1a212652 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 00000000..1de30abe --- /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 b20e1673..f6f16821 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 ef33eadb..863b2536 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 13fe117f..8692bdca 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 7a16edde..1dab3303 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 2a88bd8e..82ef9dc0 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 -- GitLab