From e58a81297e04b23821d4294aa81594a48cd7d09b Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 28 Aug 2023 08:54:17 +0200 Subject: [PATCH] fix: ensure tags are set on Test Cases and not on Keywords #27 - Tags are ignored when set on Keywords --- TP/NGSI-LD/CommonBehaviours/044_04.robot | 2 +- .../BatchEntities/CreateBatchOfEntities/003_01.robot | 3 ++- .../Provision/Entities/CreateEntity/001_01.robot | 5 ++++- .../Provision/Entities/CreateEntity/001_02.robot | 4 +++- .../Provision/Entities/DeleteEntity/002_02.robot | 3 ++- .../CreateContextSourceRegistration/033_02.robot | 4 +++- .../DeleteContextSourceRegistration/035_02.robot | 3 ++- .../QueryContextSourceRegistrations/037_03.robot | 9 ++++++--- .../UpdateContextSourceRegistration/034_01.robot | 3 ++- .../UpdateContextSourceRegistration/034_02.robot | 6 +++++- 10 files changed, 30 insertions(+), 12 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index b0670b2a..33028c39 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -47,7 +47,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 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 + [Tags] csrsub-query 6_3_4 Query Context Source Registration Subscriptions accept=${accept} Check Response Status Code ${status_code} ${response.status_code} 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 e47d2862..e8fc355e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_01.robot @@ -14,7 +14,8 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME -MinimalEntity [Tags] be-create 5_6_7 +MinimalEntity + [Tags] be-create 5_6_7 building-minimal-sample.jsonld EntityWithSimpleProperties [Tags] be-create 5_6_7 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 4305ae59..abdeaf33 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -15,19 +15,22 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** FILENAME CONTENT_TYPE 001_01_01_MinimalEntity + [Tags] e-create 5_6_1 building-minimal-without-context-sample.jsonld application/json 001_01_02_EntityWithSimpleProperties + [Tags] e-create 5_6_1 building-simple-attributes-sample.jsonld application/ld+json 001_01_03_EntityWithRelationshipsProperties + [Tags] e-create 5_6_1 building-relationship-of-property-sample.jsonld application/ld+json 001_01_04_EntityWithLocationAttribute + [Tags] e-create 5_6_1 building-location-attribute-sample.jsonld application/ld+json *** Keywords *** Create Entity Scenarios [Documentation] Check that you can create an entity - [Tags] e-create 5_6_1 [Arguments] ${filename} ${content_type} ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Test Variable ${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 1971ddbe..c662a2b1 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -9,17 +9,19 @@ Test Template Create Entity With Invalid Request Scenarios *** Test Cases *** FILENAME ERROR_TYPE 001_02_01_InvalidJson + [Tags] e-create 5_6_1 invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 001_02_02_EmptyJson + [Tags] e-create 5_6_1 empty-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} 001_02_03_EntityWithNoContext + [Tags] e-create 5_6_1 building-minimal-without-context-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** 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} ${response}= Request Entity From File ${filename} Check Response Status Code 400 ${response.status_code} 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 62beb73d..78df6b9e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -10,15 +10,16 @@ Test Template Delete Entity Scenarios *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE 002_02_01_Delete an entity if the Entity Id is not present + [Tags] e-delete 5_6_6 ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 002_02_02_Delete an entity if the Entity Id is not a valid URI + [Tags] e-delete 5_6_6 thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Entity Scenarios [Documentation] Check that you cannot delete an entity with invalid/missing id - [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_code} diff --git a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot index 7e0055ca..97fda2bb 100644 --- a/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/CreateContextSourceRegistration/033_02.robot @@ -13,13 +13,16 @@ ${registration_payload_file_path}= context-source-registration-invalid-samp *** Test Cases *** 033_02_01_Create a context source registration with invalid JSON file + [Tags] csr-create 5_9_2 Create a context source registration with invalid JSON file 033_02_02_Create a context source registration with a different data structure than CsourRegistration data type + [Tags] csr-create 5_9_2 Create Context Source With Invalid Content ... csourceRegistrations/context-source-registration-invalid-structure-sample.jsonld 033_02_03_Create a context source registration with a date in the past + [Tags] csr-create 5_9_2 Create Context Source With Invalid Content ... csourceRegistrations/context-source-registration-past-expiration-sample.jsonld @@ -27,7 +30,6 @@ ${registration_payload_file_path}= context-source-registration-invalid-samp *** Keywords *** Create Context Source With Invalid Content [Documentation] Check that you cannot create a context source with invalid content - [Tags] csr-create [Arguments] ${filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} ${payload}= Load JSON From File ${EXECDIR}/data/${filename} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot index b2990bd1..803bb0a4 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_02.robot @@ -16,15 +16,16 @@ ${filename}= context-source-registration-simple-sample.jsonld *** Test Cases *** INVALID_REGISTRATION_ID 035_02_01_Delete a Context Source Registration if the Id is not present + [Tags] csr-delete 5_9_4 ${EMPTY} 035_02_02_Delete a Context Source Registration if the Id is not a valid URI + [Tags] csr-delete 5_9_4 invalidURI *** Keywords *** Delete Context Source [Documentation] Check that you cannot delete a context source registration under some conditions - [Tags] csr-delete [Arguments] ${invalid_registration_id} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Test Variable ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot index a4af8532..295a264f 100644 --- a/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/QueryContextSourceRegistrations/037_03.robot @@ -9,11 +9,14 @@ Test Template Query Context Source Registration With Invalid Query Param *** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE -Invalid URI [Tags] csr-query 5_10_2 +Invalid URI + [Tags] csr-query 5_10_2 id invalidUri -Invalid Query [Tags] csr-query 5_10_2 +Invalid Query + [Tags] csr-query 5_10_2 q invalidQuery -Invalid GeoQuery [Tags] csr-query 5_10_2 +Invalid GeoQuery + [Tags] csr-query 5_10_2 georel within Invalid Temporal Query [Tags] csr-query 5_10_2 diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot index 97c3c5d8..b79d46b0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot @@ -15,15 +15,16 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Cases *** FILENAME UPDATE_FILENAME 034_01_01_Update a context source registration by id + [Tags] csr-update 5_9_3 context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld 034_01_02_Update a context source registration to never expire + [Tags] csr-update 5_9_3 context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld *** Keywords *** Update Context Source [Documentation] Check that you can update a context source registration by id - [Tags] csr-update [Arguments] ${filename} ${update_filename} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Test Variable ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot index c96af787..799ff6f6 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_02.robot @@ -16,27 +16,31 @@ ${registration_payload_file_path}= context-source-registration-invalid-samp *** Test Cases *** 034_02_01_Update a context source registration by id if the Id is not present + [Tags] csr-update 5_9_3 Update Context Source ${EMPTY} fragments/context-source-registration-different-type-sample.jsonld 034_02_02_Update a context source registration by id if the Id is not a valid URI + [Tags] csr-update 5_9_3 Update Context Source invalidURI fragments/context-source-registration-different-type-sample.jsonld 034_02_03_Update a context source registration if the request body is not of the same data type + [Tags] csr-update 5_9_3 Update Context Source ... ${valid_registration_id} ... fragments/context-source-registration-different-type-sample.jsonld 034_02_04_Update a context source registration if you attempt to remove a mandatory property + [Tags] csr-update 5_9_3 Update Context Source ${valid_registration_id} context-source-registration-invalid-structure-sample.jsonld 034_02_05_Update a context source registration if the request body is invalid + [Tags] csr-update 5_9_3 Update a context source registration if the request body is invalid *** Keywords *** Update Context Source [Documentation] Check that you cannot update a context source registration under some conditions - [Tags] csr-update [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} -- GitLab