From 1ca28c84b604752ac650a6edd35035fa92fa81d2 Mon Sep 17 00:00:00 2001 From: Giuseppe Tropea Date: Fri, 29 Sep 2023 11:16:19 +0000 Subject: [PATCH 1/7] added statistics of failed/successful parsing of testcases --- doc/statisticsDocumentationData.py | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/statisticsDocumentationData.py diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py new file mode 100644 index 00000000..7c212b10 --- /dev/null +++ b/doc/statisticsDocumentationData.py @@ -0,0 +1,35 @@ +from generateDocumentationData import create_json_of_robotfile +from os.path import dirname +from os import walk + +if __name__ == "__main__": + basedir = dirname(dirname(__file__)) + statistics = dict() + number_of_failures = 0 + number_of_testcases = 0 + + fullpath = basedir+"/TP/NGSI-LD" + for root, dirs, files in walk(fullpath): + for filename in files: + if filename.endswith(".robot"): + number_of_testcases += 1 + name_of_test_case = filename[:-6] + json_of_test_case = create_json_of_robotfile(name_of_test_case) + statistics[name_of_test_case] = dict() + strippedpath = root[len(fullpath)+1:] + statistics[name_of_test_case]["path"] = strippedpath + if "error_while_parsing" in json_of_test_case and json_of_test_case["error_while_parsing"] == True: + statistics[name_of_test_case]["failed"] = True + number_of_failures += 1 + else: + statistics[name_of_test_case]["failed"] = False + + print() + print() + print() + print("THE FOLLOWING TESTCASES FAILED PARSING:") + for testcasename, testcaseresult in statistics.items(): + if testcaseresult["failed"] == True: + print(testcasename+" "+testcaseresult["path"]) + + print("Out of "+str(number_of_testcases)+" testcases, "+str(number_of_failures)+" of them failed to be correctly parsed") -- GitLab From be3008bd884d77dc041bcc847b64554c3ddcc821 Mon Sep 17 00:00:00 2001 From: Giuseppe Tropea Date: Fri, 29 Sep 2023 11:23:53 +0000 Subject: [PATCH 2/7] align testsuitedata-statistics with testsuitedata --- TP/NGSI-LD/CommonBehaviours/044_01.robot | 4 +- TP/NGSI-LD/CommonBehaviours/044_02.robot | 8 +- TP/NGSI-LD/CommonBehaviours/044_03.robot | 12 +- TP/NGSI-LD/CommonBehaviours/044_04.robot | 12 +- .../{027_01_01.robot => 027_01.robot} | 2 +- .../{027_01_02.robot => 027_02.robot} | 2 +- .../{024_01_01.robot => 024_01.robot} | 2 +- .../{024_01_02.robot => 024_02.robot} | 2 +- .../Entity/QueryEntities/019_01_01.robot | 4 +- .../Entity/QueryEntities/019_01_02.robot | 2 +- .../Entity/QueryEntities/019_01_03.robot | 4 +- .../Entity/QueryEntities/019_01_04.robot | 6 +- .../Entity/QueryEntities/019_01_05.robot | 4 +- .../Entity/QueryEntities/019_02_01.robot | 4 +- .../Entity/QueryEntities/019_02_02.robot | 4 +- .../Entity/QueryEntities/019_02_03.robot | 4 +- .../Entity/QueryEntities/019_02_04.robot | 4 +- .../Entity/QueryEntities/019_02_05.robot | 8 +- .../Entity/QueryEntities/019_03_01.robot | 2 +- .../Entity/QueryEntities/019_03_02.robot | 2 +- .../Entity/QueryEntities/019_03_03.robot | 2 +- .../Entity/QueryEntities/019_03_04.robot | 2 +- .../Entity/QueryEntities/019_03_05.robot | 6 +- .../Entity/QueryEntities/019_04.robot | 4 +- .../Entity/QueryEntities/019_05.robot | 4 +- .../Entity/QueryEntities/019_06.robot | 2 +- .../Entity/RetrieveEntity/018_01_01.robot | 2 +- .../Entity/RetrieveEntity/018_01_02.robot | 2 +- .../Entity/RetrieveEntity/018_01_03.robot | 2 +- .../Entity/RetrieveEntity/018_02.robot | 4 +- .../Entity/RetrieveEntity/018_03_01.robot | 2 +- .../Entity/RetrieveEntity/018_03_02.robot | 2 +- .../Entity/RetrieveEntity/018_04.robot | 2 +- .../Entity/RetrieveEntity/018_05.robot | 2 +- .../Entity/RetrieveEntity/018_06.robot | 4 +- .../021_01.robot | 4 +- .../021_02.robot | 2 +- .../021_03.robot | 2 +- .../021_04.robot | 2 +- .../021_05.robot | 2 +- .../021_06.robot | 2 +- .../021_07.robot | 2 +- .../021_08.robot | 2 +- .../021_09.robot | 4 +- .../021_10.robot | 2 +- .../021_12.robot | 2 +- .../020_01.robot | 2 +- .../020_02.robot | 2 +- .../020_03.robot | 2 +- .../020_06.robot | 2 +- .../020_07.robot | 2 +- .../020_08.robot | 2 +- .../020_10.robot | 2 +- doc/analysis/checks.py | 20 +- doc/analysis/generaterobotdata.py | 40 ++- doc/analysis/parseapiutilsfile.py | 14 +- doc/analysis/parserobotfile.py | 51 +-- doc/analysis/parsevariablesfile.py | 24 ++ doc/analysis/requests.py | 320 ++++++++++++++++-- doc/files/019_01_01.json | 34 ++ doc/files/019_01_03.json | 34 ++ doc/files/019_01_04.json | 34 ++ doc/files/019_02_01.json | 34 ++ doc/files/019_02_03.json | 34 ++ doc/files/019_03_01.json | 34 ++ doc/files/019_03_02.json | 34 ++ doc/files/019_03_03.json | 34 ++ doc/files/019_04.json | 34 ++ doc/files/019_05.json | 34 ++ doc/files/021_02.json | 35 ++ doc/files/024_01.json | 35 ++ doc/files/024_02.json | 35 ++ doc/files/027_01.json | 35 ++ doc/files/027_02.json | 35 ++ doc/files/044_01.json | 49 --- doc/files/{ => CommonBehaviours}/043_01.json | 8 +- doc/files/CommonBehaviours/044_01.json | 51 +++ doc/files/CommonBehaviours/044_02.json | 83 +++++ doc/files/CommonBehaviours/044_03.json | 116 +++++++ doc/files/CommonBehaviours/044_04.json | 98 ++++++ doc/files/CommonBehaviours/044_05.json | 67 ++++ doc/generateDocumentationData.py | 54 +-- doc/tests/test_CommonBehaviours.py | 41 ++- .../test_ContextInformation_Consumption.py | 279 +++++++++++++++ requirements.txt | 2 +- 85 files changed, 1759 insertions(+), 247 deletions(-) rename TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/{027_01_01.robot => 027_01.robot} (95%) rename TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/{027_01_02.robot => 027_02.robot} (95%) rename TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/{024_01_01.robot => 024_01.robot} (95%) rename TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/{024_01_02.robot => 024_02.robot} (96%) create mode 100644 doc/analysis/parsevariablesfile.py create mode 100644 doc/files/019_01_01.json create mode 100644 doc/files/019_01_03.json create mode 100644 doc/files/019_01_04.json create mode 100644 doc/files/019_02_01.json create mode 100644 doc/files/019_02_03.json create mode 100644 doc/files/019_03_01.json create mode 100644 doc/files/019_03_02.json create mode 100644 doc/files/019_03_03.json create mode 100644 doc/files/019_04.json create mode 100644 doc/files/019_05.json create mode 100644 doc/files/021_02.json create mode 100644 doc/files/024_01.json create mode 100644 doc/files/024_02.json create mode 100644 doc/files/027_01.json create mode 100644 doc/files/027_02.json delete mode 100644 doc/files/044_01.json rename doc/files/{ => CommonBehaviours}/043_01.json (97%) create mode 100644 doc/files/CommonBehaviours/044_01.json create mode 100644 doc/files/CommonBehaviours/044_02.json create mode 100644 doc/files/CommonBehaviours/044_03.json create mode 100644 doc/files/CommonBehaviours/044_04.json create mode 100644 doc/files/CommonBehaviours/044_05.json create mode 100644 doc/tests/test_ContextInformation_Consumption.py diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 279678cd..bda9e724 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -17,7 +17,7 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp *** Test Cases *** -044_01_01_endpoint /entities/{entityId}/attrs/{attrId} +044_01_01 endpoint /entities/{entityId}/attrs/{attrId} [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} @@ -35,7 +35,7 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp Check Response Status Code 204 ${response.status_code} [Teardown] Delete Entity by Id ${entity_id} -044_01_02_endpoint /subscriptions/{subscriptionId} +044_01_02 endpoint /subscriptions/{subscriptionId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] sub-update 6_3_4 ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 8f634d61..08f3134c 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -21,7 +21,7 @@ ${content_type}= application/json *** Test Cases *** -044_02_01_endpoint /entities/{entityId} +044_02_01 endpoint /entities/{entityId} [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} @@ -36,7 +36,7 @@ ${content_type}= application/json Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Entity by Id Returning Response ${id} -044_02_02_endpoint /subscriptions/{subscriptionId} +044_02_02 endpoint /subscriptions/{subscriptionId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} @@ -48,7 +48,7 @@ ${content_type}= application/json Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Subscription ${id} -044_02_03_endpoint /csourceRegistrations/ +044_02_03 endpoint /csourceRegistrations/ [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/) [Tags] csr-query 6_3_4 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} @@ -66,7 +66,7 @@ ${content_type}= application/json Check Response Headers Link Not Empty ${response.headers} [Teardown] Delete Context Source Registration ${registration_id} -044_02_04_endpoint /temporal/entities +044_02_04 endpoint /temporal/entities [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities) [Tags] te-query 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index 306335d6..c819f18e 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -22,7 +22,7 @@ ${content_type}= application/xml *** Test Cases *** -044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} +044_03_01 endpoint patch /entities/{entityId}/attrs/{attrId} [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} @@ -39,7 +39,7 @@ ${content_type}= application/xml Check Response Status Code 415 ${response.status_code} [Teardown] Delete Entity by Id Returning Response ${entity_id} -044_03_02_endpoint patch /subscriptions/{subscriptionId} +044_03_02 endpoint patch /subscriptions/{subscriptionId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /subscriptions/{subscriptionId}) [Tags] sub-update 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} @@ -49,7 +49,7 @@ ${content_type}= application/xml Check Response Status Code 415 ${response.status_code} [Teardown] Delete Subscription ${id} -044_03_03_endpoint post /entities/ +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} @@ -60,7 +60,7 @@ ${content_type}= application/xml Check Response Status Code 415 ${response.status_code} [Teardown] Delete Entity by Id ${entity_id} -044_03_04_endpoint post /subscriptions/ +044_03_04 endpoint post /subscriptions/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) [Tags] sub-create 6_3_4 ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} @@ -68,7 +68,7 @@ ${content_type}= application/xml Check Response Status Code 415 ${response.status_code} [Teardown] Delete Subscription ${subscriptions_id} -044_03_05_endpoint post /entityOperations/create +044_03_05 endpoint post /entityOperations/create [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) [Tags] be-create 6_3_4 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -81,7 +81,7 @@ ${content_type}= application/xml Check Response Status Code 415 ${response.status_code} [Teardown] Batch Delete Entities @{expected_entities_ids} -044_03_06_endpoint post /temporal/entities/ +044_03_06 endpoint post /temporal/entities/ [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) [Tags] te-create 6_3_4 ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index b0670b2a..cb71c747 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -16,7 +16,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld *** Test Cases *** -044_04_01_endpoint get /entities/{entityId} +044_04_01 endpoint get /entities/{entityId} [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} @@ -29,7 +29,7 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 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} +044_04_02 endpoint get /subscriptions/{subscriptionId} [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 /subscriptions/{subscriptionId}) [Tags] sub-retrieve 6_3_4 ${id}= Generate Random Entity Id ${subscription_id_prefix} @@ -39,19 +39,19 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld Check Response Status Code ${status_code} ${response.status_code} [Teardown] Delete Subscription ${id} -044_04_03_endpoint get /csourceRegistrations/ +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 ${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/ +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} + ${response}= Query Context Source Registration Subscriptions accept=${accept} Check Response Status Code ${status_code} ${response.status_code} -044_04_05_endpoint get /temporal/entities +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 diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot index aaeb8c8c..365f40cc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot @@ -16,7 +16,7 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** -Retrieve Detailed Representation Of Available Attribute Without Context +027_01_01 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 ${response}= Retrieve Attribute attribute_name=airQualityLevel diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot index 5c3c7b09..5e8ef772 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot @@ -17,7 +17,7 @@ ${expectation_file}= types/expectations/attribute-027-01-expectation.json *** Test Cases *** -Retrieve Detailed Representation Of Available Attribute +027_02_01 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 ${response}= Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot similarity index 95% rename from TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot index e9544039..32b3781a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot @@ -16,7 +16,7 @@ ${filename}= building-simple-attributes-sample.json *** Test Cases *** -Retrieve Detailed Representation Of Available Entity Type Without Context +024_01_01 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 ${response}= Retrieve Entity Type type=Building diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot similarity index 96% rename from TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot rename to TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot index e147d6cc..35b58a15 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot @@ -17,7 +17,7 @@ ${expectation_file}= types/expectations/entity-type-info-024-01-expectati *** Test Cases *** -Retrieve Detailed Representation Of Available Entity Type +024_02_01 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 ${response}= Retrieve Entity Type type=Building context=${ngsild_test_suite_context} 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 6e4586ae..7f99c790 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 @@ -17,7 +17,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** -Query several entities based on ids +019_01_01 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} @@ -48,7 +48,7 @@ Query several entities based on ids ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 e2c6e344..f7c95ec2 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 @@ -23,7 +23,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** -Query several entities based on the entities types +019_01_02 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} 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 982470b9..6c4dfaff 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 @@ -18,7 +18,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** -Query several entities based on the given id pattern +019_01_03 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} @@ -41,7 +41,7 @@ Query several entities based on the given id pattern ... entity_id_pattern=${entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 636d6416..4f049e05 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 @@ -20,7 +20,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego *** Test Cases *** -Query several entities based on attribute names +019_01_04 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} @@ -44,13 +44,13 @@ Query several entities based on attribute names @{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_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 8ff94d0f..612d7c81 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 @@ -18,7 +18,7 @@ ${geometry_property}= location *** Test Cases *** -Query several entities based on a list of properties +019_01_05 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} @@ -43,7 +43,7 @@ Query several entities based on a list of properties ... geoproperty=${geometry_property} ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 88d825e1..9d3ea8fa 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 @@ -17,7 +17,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** -Query several entities via POST Interaction based on ids +019_02_01 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} @@ -53,7 +53,7 @@ Query several entities via POST Interaction based on ids ... entity_ids=${entities_ids_to_be_retrieved} ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 4f129cb3..719f9c7f 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 @@ -23,7 +23,7 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** -Query several entities via POST Interaction based on the entities types +019_02_02 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} @@ -51,7 +51,7 @@ Query several entities via POST Interaction based on the entities types ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${vehicle_entity_type} ${parking_entity_type} ${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 + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entity_types_to_be_compared} ... ${response.json()} 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 5f5d50b7..501cf462 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 @@ -18,7 +18,7 @@ ${entity_id_pattern}= urn:ngsi-ld:Building:.* *** Test Cases *** -Query several entities via POST Interaction based on the given id pattern +019_02_03 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} @@ -41,7 +41,7 @@ Query several entities via POST Interaction based on the given id pattern ... entity_id_pattern=${entity_id_pattern} ... entity_types=${entity_types_to_be_retrieved} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 0e204199..5e621262 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 @@ -18,7 +18,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego *** Test Cases *** -Query several entities via POST Interaction based on attribute names +019_02_04 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} @@ -42,7 +42,7 @@ Query several entities via POST Interaction based on attribute names @{entities_ids_to_be_retrieved}= Create List ${first_entity_id} ${second_entity_id} ${response}= Query Entities attrs=${attributes_to_be_retrieved} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_retrieved} ... ${response.json()} 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 1efb21bb..717c4787 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 @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you can query entitites via POST Interaction based on a list of properties +Documentation Check that you can query entities via POST Interaction based on a list of properties Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption/ApiUtils.resource # Resource ${EXECDIR}/resources/ApiUtils.resource @@ -18,8 +18,8 @@ ${geometry_property}= location *** Test Cases *** -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 +019_02_05 Query several entities via POST Interaction based on a list of properties + [Documentation] Check that you can query entities 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} Set Suite Variable ${first_entity_id} @@ -41,7 +41,7 @@ Query several entities via POST Interaction based on a list of properties ... entity_types=${entity_types_to_be_retrieved} ... geoproperty=${geometry_property} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 b912976e..95f6cd63 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 @@ -18,7 +18,7 @@ ${entity_invalid_id_two}= thisisaninvaliduri2 *** Test Cases *** -Query entities based on incorrect ids +019_03_01 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} 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 cfd1b652..58a859e0 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 @@ -19,7 +19,7 @@ ${invalid_entity_type_two}= invalid_entity_type_two *** Test Cases *** -Query entities based on incorrect entity types +019_03_02 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} 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 f091a50b..89300600 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 @@ -17,7 +17,7 @@ ${invalid_entity_id_pattern}= invalid_entity_id_pattern** *** Test Cases *** -Query several entities based on incorrect id pattern +019_03_03 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} 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 f329c08a..8e6ab34b 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 @@ -18,7 +18,7 @@ ${invalid_attribute_two}= type *** Test Cases *** -Query several entities based on incorrect attribute names +019_03_04 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} 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 998771c7..b9d48478 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 @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that you cannot query entitites if the request has a wrong geometryProperty +Documentation Check that you cannot query entities if the request has a wrong geometryProperty Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption/ApiUtils.resource # Resource ${EXECDIR}/resources/ApiUtils.resource @@ -20,8 +20,8 @@ ${geoproperty}= location *** Test Cases *** -Query entitites when the request has a wrong geometryProperty - [Documentation] Check that you cannot query entitites if the request has a wrong geometryProperty +019_03_05 Query entities when the request has a wrong geometryProperty + [Documentation] Check that you cannot query entities if the request has a wrong geometryProperty [Tags] e-query 5_7_2 ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_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 2895591a..c6204e70 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot @@ -18,7 +18,7 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** -Query entities in a simplified representation +019_04_01 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} @@ -50,7 +50,7 @@ Query entities in a simplified representation ... entity_types=${entity_types_to_be_retrieved} ... options=${options_parameter} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 7e9a8ac6..37fdd035 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -18,7 +18,7 @@ ${accept_header}= application/geo+json *** Test Cases *** -Get an entity by id that can be returned in a geoJSON format +019_05_01 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} @@ -50,7 +50,7 @@ Get an entity by id that can be returned in a geoJSON format ... entity_types=${entity_types_to_be_retrieved} ... accept=${accept_header} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing List Containing Entity elements + Check Response Body Containing List Containing Entity Elements ... ${expectation_filename} ... ${entities_ids_to_be_compared} ... ${response.json()} 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 6aae3100..5a472f4c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_06.robot @@ -17,7 +17,7 @@ ${limit}= 2 *** Test Cases *** -Query entities specifying a maximum number of results +019_06_01 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} 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 f2596be6..3a71217d 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 @@ -16,7 +16,7 @@ ${expectation_filename}= building-simple-attributes-expectation.jsonld *** Test Cases *** -018_01_01_Get an entity by id +018_01_01 Get an entity by id [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} 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 93fe8fa9..9644d32e 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 @@ -18,7 +18,7 @@ ${attribute_subcategory}= https://ngsi-ld-test-suite/context#subCatego *** Test Cases *** -018_01_02_Query some attributes from an entity +018_01_02 Query some attributes from an entity [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} 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 18e91571..49bc76a4 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 @@ -17,7 +17,7 @@ ${geometry_property}= location *** Test Cases *** -018_01_03_Query the geometry property from an entity +018_01_03 Query the geometry property from an entity [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} 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 a5a655c6..6500df58 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -9,9 +9,9 @@ Test Template Get Entity With Invalid/Missing Id *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -018_02_01_Get an entity if the Entity Id is not present +018_02_01 Get an entity if the Entity Id is not present ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -018_02_02_Get an entity if the Entity Id is not a valid URI +018_02_02 Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 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 c06471a1..2ce7aa0d 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 @@ -12,7 +12,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Cases *** -Get an entity if the Entity Id is not known to the system +018_03_01 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_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} 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 1d1784ae..598b79ed 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 @@ -16,7 +16,7 @@ ${attribute_not_known}= property_not_found *** Test Cases *** -Get an entity if an attribute is not known to the system +018_03_02 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_7_1 ${entity_id}= Generate Random Entity Id ${building_id_prefix} 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 8692a820..810eef74 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -17,7 +17,7 @@ ${options_parameter}= keyValues *** Test Cases *** -Get an entity in a simplified representation +018_04_01 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} 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 406eebf2..8a995df0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -18,7 +18,7 @@ ${accept_header}= application/geo+json *** Test Cases *** -Get an entity by id that can be returned in a geoJSON format +018_05_01 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} 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 acacf50d..b1589499 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_06.robot @@ -19,10 +19,10 @@ ${creation_jsonld_expectation_filename}= building-simple-attributes-sample-co *** Test Cases *** CONTEXT EXPECTED_PAYLOAD -EmptyJsonLdContext +018_06_01 EmptyJsonLdContext [Tags] e-retrieve 6_3_5 ${EMPTY} ${empty_jsonld_expectation_filename} -CreationTimeJsonLdContext +018_06_02 CreationTimeJsonLdContext [Tags] e-retrieve 6_3_5 ${ngsild_test_suite_context} ${creation_jsonld_expectation_filename} 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 8e7af978..c71f7929 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -19,9 +19,9 @@ ${bus_payload_file}= 2020-08-bus-temporal-representation-sample.j *** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE -After [Tags] te-query 5_7_4 +021_01_01 After [Tags] te-query 5_7_4 after 2020-08-01T12:04:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld -Before [Tags] te-query 5_7_4 +021_01_02 Before [Tags] te-query 5_7_4 before 2020-09-01T13:06:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld 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 58cc6a91..baf110a4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -17,7 +17,7 @@ ${expectation_file}= vehicles-temporal-representation-021-02-expe *** Test Cases *** -Query the temporal evolution of certain attributes of entities +021_02_01 Query the temporal evolution of certain attributes of entities [Documentation] Check that you can query the temporal evolution of certain attributes of entities [Tags] te-query 5_7_4 ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle 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 81629935..d5d247ae 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -17,7 +17,7 @@ ${expectation_file}= vehicles-temporal-representation-021-03-expe *** Test Cases *** -Query the temporal evolution of the last N instances of entities attributes +021_03_01 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 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 6bab8c04..0bf4cc60 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -17,7 +17,7 @@ ${expectation_file}= vehicles-temporal-representation-021-04-expe *** Test Cases *** -Query the temporal evolution of entities using a context +021_04 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 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 57300cf3..ec356ffe 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -18,7 +18,7 @@ ${expectation_file}= vehicles-temporal-representation-021-05-expectation. *** Test Cases *** -Query the temporal evolution of entities matching the given type(s) +021_05_01 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 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 5d94d9bf..5eef64e1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -17,7 +17,7 @@ ${expectation_file}= vehicles-temporal-representation-021-06-expe *** Test Cases *** -Query the temporal evolution of entities matching the given identifier(s) +021_06_01 Query the temporal evolution of entities matching the given identifier(s) [Documentation] Check that you can 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 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 4fca7480..f36be849 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -17,7 +17,7 @@ ${expectation_file}= vehicles-temporal-representation-021-07-expe *** Test Cases *** -Query the temporal evolution of entities matching the given id pattern +021_07_01 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 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 c49aaa1a..e9bb4619 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -17,7 +17,7 @@ ${expectation_file}= vehicles-temporal-representation-021-08-expe *** Test Cases *** -Query the temporal evolution of entities matching the given NGSI-LD query +021_08_01 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 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 bc439716..eb5c8f27 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -18,9 +18,9 @@ ${expectation_file}= vehicles-temporal-representation-021-09-expe *** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE -Near Point [Tags] te-query 5_7_4 +021_09_01 Near Point [Tags] te-query 5_7_4 near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld -Within Polygon [Tags] te-query 5_7_4 +021_09_02 Within Polygon [Tags] te-query 5_7_4 contains Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]] location vehicles-temporal-representation-021-09-02-expectation.jsonld 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 13ee2575..63e9df2e 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_10.robot @@ -17,7 +17,7 @@ ${context_source_url}= http://${context_source_ *** Test Cases *** -Query the temporal evolution of entities matching the given NGSI-LD context source filter +021_10_01 Query the temporal evolution of entities matching the given NGSI-LD context source filter [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 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 459ed342..6a12d51f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_12.robot @@ -15,7 +15,7 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json *** Test Cases *** -Query the temporal evolution of entities with an invalid request +021_12_01 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 ${response}= Query Temporal Representation Of Entities 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 688ffda7..1767587b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -16,7 +16,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectati *** Test Cases *** -Retrieve the temporal evolution of an entity +020_01_01 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 ${response}= Retrieve Temporal Representation Of Entity ${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 db67528d..3a36ea28 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -16,7 +16,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectati *** Test Cases *** -Retrieve the temporal evolution of an entity using a context +020_02_01 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 ${response}= Retrieve Temporal Representation Of Entity 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 d6ffa927..fa2b9792 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -16,7 +16,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectati *** Test Cases *** -Retrieve the temporal evolution of certain attributes of an entity +020_03_01 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 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 01262715..150e8417 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Cases *** -Retrieve the temporal evolution of an entity with an invalid id +020_06_01 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 ${response}= Retrieve Temporal Representation Of Entity invalidUri 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 6e6a1d42..c7abd006 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -7,7 +7,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Test Cases *** -Retrieve the temporal evolution of a non-existing entity +020_07_01 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 ${response}= Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity 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 e457cb4c..8c62989f 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -15,7 +15,7 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.json *** Test Cases *** -Retrieve the temporal evolution of non-existing entity attributes +020_08_01 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 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 69e8d9f6..2e50888c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -16,7 +16,7 @@ ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectati *** Test Cases *** -Retrieve the temporal evolution of an entity with the simplified temporal representation +020_10_01 Retrieve the temporal evolution of an entity with the simplified temporal representation [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 diff --git a/doc/analysis/checks.py b/doc/analysis/checks.py index f0518e7b..613a1721 100644 --- a/doc/analysis/checks.py +++ b/doc/analysis/checks.py @@ -91,16 +91,16 @@ class Checks: }, 'Check Response Headers Containing Content-Type set to': { 'params': ['content_type'], - 'position': [] + 'position': [1] }, 'Check Response Body Containing an Attribute set to': { 'params': ['attribute_name'], 'position': [] }, 'Check Response Body Containing List Containing EntityTemporal elements': { - 'params': ['timeRel', 'timeAt'], - 'position': [] - }, + 'params': ['filename', 'entity_ids'], + 'position': [1, 2] + }, 'Check Response Body Containing List Containing Subscription elements': { 'params': ['number'], 'position': [] @@ -212,7 +212,7 @@ class Checks: @staticmethod def check_response_body_containing_list_containing_entity_elements(kwargs: list) -> str: - return 'Response Body containing a list containing Entity elements, containing ${value} provided' + return 'Response Body containing a list containing Entity Elements, containing ${value} provided' @staticmethod def check_response_body_containing_list_containing_entity_elements_with_different_types(kwargs: list) -> str: @@ -226,12 +226,12 @@ class Checks: @staticmethod def check_response_body_containing_list_containing_entitytemporal_elements(kwargs: list) -> str: - if "timeRel" in kwargs and "timeAt" in kwargs: - return (f"Response Body containing a list containing EntityTemporal elements containing entity type in the " - f"list of entity types provided and entity id matching id pattern provided and attribute instances " - f"'{kwargs['timeRel']}' '{kwargs['timeAt']}'") + if 'filename' in kwargs and 'entity_ids' in kwargs: + return (f"Request response body containing a list that contains Entity Temporal Elements\n" + f" compared with file '{kwargs['filename']}'\n" + f" and using the list of entity ids define in '{kwargs['entity_ids']}'") else: - raise Exception(f'ERROR, timeRel and/or timeAt attributes were not provided, but received: {kwargs}') + raise Exception(f"ERROR, expected parameters 'filename' and 'entity_ids', but received '{kwargs}'") @staticmethod def check_response_body_containing_subscription_element(kwargs: list) -> str: diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 98fe9bba..234597fd 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -1,13 +1,18 @@ from os.path import dirname from robot.api import TestSuiteBuilder -from doc.analysis.parserobotfile import ParseRobotFile -from doc.analysis.parseapiutilsfile import ParseApiUtilsFile +from analysis.parserobotfile import ParseRobotFile +from analysis.parseapiutilsfile import ParseApiUtilsFile +from analysis.parsevariablesfile import ParseVariablesFile import re class GenerateRobotData: def __init__(self, robot_file: str, execdir: str): - self.robot = ParseRobotFile(filename=robot_file, execdir=execdir) + self.robot_file = robot_file + self.execdir = execdir + + self.config_variables = ParseVariablesFile() + self.robot = ParseRobotFile(filename=robot_file, execdir=execdir, config_file=self.config_variables) self.apiutil = ParseApiUtilsFile(filename=self.robot.resource_file) self.robot.set_apiutils(self.apiutil) @@ -22,9 +27,13 @@ class GenerateRobotData: 'ContextInformation': 'CI', 'CommonBehaviours': 'CB', 'Consumption': 'Cons', + 'Provision': 'Prov', + 'Discovery/RetrieveAvailableAttributeInformation': 'DISC', + 'Discovery/RetrieveAvailableEntityTypeInformation': 'DISC', 'Entity/RetrieveEntity': 'E', 'Entities/CreateEntity': 'E', - 'Provision': 'Prov' + 'Entity/QueryEntities': 'E', + 'TemporalEntity/QueryTemporalEvolutionOfEntities': 'TE' } self.references = { 'v1.3.1': 'ETSI GS CIM 009 V1.3.1 [], clause ' @@ -44,6 +53,9 @@ class GenerateRobotData: self.base_TP_id = str() def get_info(self): + self.test_suite['robotpath'] = (self.robot_file.replace(f'{self.execdir}/TP/NGSI-LD/', '') + .replace(f'/{self.robot.test_suite}.robot', '')) + self.test_suite['robotfile'] = self.robot.test_suite return self.test_suite def parse_robot(self): @@ -66,15 +78,17 @@ class GenerateRobotData: return keys_with_different_values - def get_params(self, string: str): + def get_params(self, test_case: str): # New content - test_case = self.robot.test_cases[string] + # test_case = self.robot.test_cases[string] lines_starting_response = re.findall(r'^\s*\$\{response\}.*', test_case, re.MULTILINE) # If there is more than one line, it means that the test case has several operations, all of them to # create the environment content to execute the last one, which is the correct one to test the Test Case if len(lines_starting_response) > 1: + # The last one corresponds to the execution of the test, the rest corresponds to the initial condition of + # test case... response_to_check = lines_starting_response[-1] else: response_to_check = lines_starting_response[0] @@ -102,8 +116,8 @@ class GenerateRobotData: break else: # the attributes are in the same line - regex = r"\s*\$\{response\}=\s{4}(.*)\n" - matches = re.finditer(regex, string, re.MULTILINE) + regex = r"\s*\$\{response\}=\s{4}(.*)" + matches = re.finditer(regex, response_to_check, re.MULTILINE) request = aux[0].split(' ')[2] # We have two options from here, or the parameters are defined in the same line or the parameters are defined in @@ -115,16 +129,18 @@ class GenerateRobotData: # Get the list of keys params = aux.split(' ')[1:] + print(params) else: - raise Exception(f"Error, unexpected format, received: '{string}'") + raise Exception(f"Error, unexpected format, received: '{response_to_check}'") return request, params def get_step_data(self, test: str): - string = self.robot.get_substring(initial_string=test, final_string=self.suite.name, include=False) + # string = self.robot.get_substring(initial_string=test, final_string=self.suite.name, include=False) + string = self.robot.test_cases[test] # request, params = self.get_params(string=string) - request, params = self.get_params(string=test) + request, params = self.get_params(test_case=string) #self.check_header_parameters(params=params, test=test) @@ -249,7 +265,7 @@ class GenerateRobotData: 'config_id': '', 'parent_release': version, 'pics_selection': pics, - 'keywords': list(self.suite.keywords), + 'keywords': [str(x) for x in self.suite.keywords], 'teardown': str(self.suite.teardown), 'initial_condition': self.suite.setup, 'test_cases': list() diff --git a/doc/analysis/parseapiutilsfile.py b/doc/analysis/parseapiutilsfile.py index 098e8185..fd61be0d 100644 --- a/doc/analysis/parseapiutilsfile.py +++ b/doc/analysis/parseapiutilsfile.py @@ -23,12 +23,13 @@ class ParseApiUtilsFile: index = None for i, item in enumerate(string): if 'response' in item: - regex = "\s{4}\$\{response\}=\s{4}(.*)" + regex = "\s{4}\$\{response\}=\s{4}(POST|GET|PUT|PATCH|DELETE).*" match = re.match(pattern=regex, string=item) if match: verb = match.groups()[0] - elif 'url' in item: + + if 'url' in item: #url = item.split('/')[1] url = self.get_url_request(url=item) @@ -36,7 +37,14 @@ class ParseApiUtilsFile: @staticmethod def get_url_request(url: str) -> list: - regex = r"\s*\.{3}\s*url=\$\{url\}\/(.*)" + # We have two options, the url is defined in the same line of the response or it is defined in the following + # lines with '...' + keys = list() + + if 'response' in url: + url = [x for x in url.split(' ') if 'url' in x][0] + + regex = r"\s*\.*\s*url=\$\{url\}\/(.*)" match = re.match(pattern=regex, string=url) if match: diff --git a/doc/analysis/parserobotfile.py b/doc/analysis/parserobotfile.py index f9000cac..d16ce897 100644 --- a/doc/analysis/parserobotfile.py +++ b/doc/analysis/parserobotfile.py @@ -1,11 +1,11 @@ import re import os -from doc.analysis.checks import Checks -from doc.analysis.requests import Requests +from analysis.checks import Checks +from analysis.requests import Requests class ParseRobotFile: - def __init__(self, filename: str, execdir: str): + def __init__(self, filename: str, execdir: str, config_file): self.test_suite = os.path.basename(filename).split('.')[0] with open(filename, 'r') as file: @@ -21,6 +21,8 @@ class ParseRobotFile: self.get_apiutils_path() self.get_test_cases() + self.config_file = config_file + def set_apiutils(self, apiutils): self.apiutils = apiutils @@ -37,19 +39,6 @@ class ParseRobotFile: else: raise Exception("Error, the variable is not following the format ${thing} = ") - # def get_expected_status_code(self, keyword: str): - # # Check Response Status Code ${expected_status_code} ${response.status_code} - # # Check Response Body Containing ProblemDetails Element Containing Type Element set to - # # ... ${response.json()} - # # ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} - # string = self.get_substring(initial_string=keyword, final_string='\n', include=True) - # expected_status_code = string.split(' ')[1] - # - # if expected_status_code.isdigit(): - # return expected_status_code - # else: - # return self.variables[expected_status_code] - def get_apiutils_path(self): string = self.get_substring(initial_string='Resource', final_string='*** Variables ***', include=True) result = [item for item in string.split('\n') if 'ApiUtils.resource' in item and item[0] != '#'] @@ -90,16 +79,30 @@ class ParseRobotFile: indexes = list() self.test_case_names = list() - for match in matches: - name = match.strip() - self.test_case_names.append(name) - indexes.append(string.find(name)) + if matches: + for match in matches: + name = match.strip() + self.test_case_names.append(name) + indexes.append(string.find(name)) + else: + # The test case has the same id. number as the test suite + pattern = f'{self.test_suite}\s.*' + matches = re.findall(pattern=pattern, string=string) + + for match in matches: + name = match.strip() + self.test_case_names.append(name) + indexes.append(string.find(name)) self.test_cases = dict() for i in range(0, len(indexes)-1): self.test_cases[self.test_case_names[i]] = string[indexes[i]:indexes[i+1]] - self.test_cases[self.test_case_names[-1]] = string[indexes[-1]:] + try: + self.test_cases[self.test_case_names[-1]] = string[indexes[-1]:] + except IndexError: + raise Exception(f"ERROR, List index out of range, " + f"probably the name of the Test Case is not following the pattern '{pattern}'") def get_checks(self, test_name, apiutils): data = Checks() @@ -136,8 +139,9 @@ class ParseRobotFile: return new_list def get_request(self, test_name): - print(test_name) - data = Requests(variables=self.variables, apiutils_variables=self.apiutils.variables) + data = Requests(variables=self.variables, + apiutils_variables=self.apiutils.variables, + config_file=self.config_file) description = data.get_description(string=self.test_cases[test_name]) return description @@ -212,7 +216,6 @@ class ParseRobotFile: for i in range(0, len(position_params['position'])): param_key = position_params['params'][i] param_position = position_params['position'][i] - # param_value = self.variables[params[param_position]-1] param_value = self.get_param_value(position=params[param_position-1]) param[param_key] = param_value diff --git a/doc/analysis/parsevariablesfile.py b/doc/analysis/parsevariablesfile.py new file mode 100644 index 00000000..f56bd51c --- /dev/null +++ b/doc/analysis/parsevariablesfile.py @@ -0,0 +1,24 @@ +from os.path import dirname + + +class ParseVariablesFile: + def __init__(self): + folder = dirname(dirname(dirname(__file__))) + filename = f'{folder}/resources/variables.py' + self.variables = dict() + + with open(filename, 'r') as file: + # Read the contents of the file + file_content = file.read() + + file_content = file_content.split('\n') + file_content = [x.split('=') for x in file_content if x != ''] + + self.variables = {x[0].strip(): x[1].replace("'", "").strip() for x in file_content} + + def get_variable(self, variable: str) -> str: + # We request the variable in the form '${...}' + variable = variable.strip('${}') + value = self.variables[variable] + + return value diff --git a/doc/analysis/requests.py b/doc/analysis/requests.py index 7899f8ef..dffec4f6 100644 --- a/doc/analysis/requests.py +++ b/doc/analysis/requests.py @@ -2,30 +2,78 @@ import re class Requests: - def __init__(self, variables, apiutils_variables): + def __init__(self, variables, apiutils_variables, config_file): self.op = { 'Create Entity Selecting Content Type': { - 'positions': [1, 3], + 'positions': [0, 2], 'params': ['filename', 'content_type'] }, 'Create Subscription': { - 'positions': [2, 3], + 'positions': [1, 2], 'params': ['filename', 'content_type'] }, 'Create Or Update Temporal Representation Of Entity Selecting Content Type': { - 'positions': [2, 3], + 'positions': [1, 2], 'params': ['filename', 'content_type'] }, 'Batch Create Entities': { - 'positions': [2], + 'positions': [1], 'params': ['content_type'] }, 'Create Context Source Registration With Return': { - 'positions': [1], + 'positions': [0], 'params': ['filename'] + }, + 'Query Entity': { + 'positions': [1, 1], + 'params': ['context', 'accept'] + }, + 'Retrieve Subscription': { + 'positions': [1], + 'params': ['accept'] + }, + 'Query Context Source Registrations With Return': { + 'positions': [0, 1], + 'params': ["type", "accept"] + }, + 'Query Temporal Representation Of Entities With Return': { + 'positions': [], + 'params': [] + }, + 'Partial Update Entity Attributes': { + 'positions': [2, 3, 4], + 'params': ['filename', "content", "context"] + }, + 'Update Subscription': { + 'positions': [1, 2, 3], + 'params': ['filename', 'content', 'context'] + }, + 'Query Context Source Registration Subscriptions': { + 'positions': [0], + 'params': ['accept'] + }, + 'Query Temporal Representation Of Entities': { + 'positions': [0, 1, 2, 3], + 'params': ['entity_types', 'timerel', 'timeAt', 'accept'] + }, + 'Retrieve Attribute': { + 'positions': [0], + 'params': ['attribute_name'] + }, + 'Retrieve Entity Type': { + 'positions': [0, 1], + 'params': ['type', 'context'] + }, + 'Query Entities': { + 'positions': [0, 1], + 'params': ['entity_ids', 'entity_types', 'accepts'] + }, + 'Retrieve Temporal Representation Of Entity': { + 'params': ['entity_ids', 'entity_types', 'accepts'] } } + self.description = { 'Create Entity Selecting Content Type': Requests.create_entity_selecting_content_type, @@ -36,33 +84,93 @@ class Requests: 'Batch Create Entities': Requests.batch_create_entities, 'Create Context Source Registration With Return': - Requests.create_context_source_registration_with_return - } + Requests.create_context_source_registration_with_return, + 'Query Entity': + Requests.query_entity, + 'Retrieve Subscription': + Requests.retrieve_subscription, + 'Query Context Source Registrations With Return': + Requests.query_context_source_registrations_with_return, + 'Query Temporal Representation Of Entities With Return': + Requests.query_temporal_representation_of_entities_with_return, + 'Partial Update Entity Attributes': + Requests.partial_update_entity_attributes, + 'Update Subscription': + Requests.update_subscription, + 'Query Context Source Registration Subscriptions': + Requests.query_context_source_registration_subscriptions, + 'Query Temporal Representation Of Entities': + Requests.query_temporal_representation_of_entities, + 'Retrieve Attribute': + Requests.retrieve_attribute, + 'Retrieve Entity Type': + Requests.retrieve_entity_type, + 'Query Entities': + Requests.query_entities + } + self.variables = variables self.apiutils_variables = apiutils_variables + self.config_file = config_file def get_description(self, string): keys = self.op.keys() params = dict() - index = None - for k in keys: - index = string.find(k) - if index != -1: - break + # New version + lines_starting_response = re.findall(r'^\s*\$\{response\}.*', string, re.MULTILINE) - pattern = f"^.*{k}.*\n" - lines_starting_with_request = re.findall(pattern, string, re.MULTILINE) - for line in lines_starting_with_request: - data = line.strip().split(" ") - if len(data) == 2: - # We are in multiline definition - params = self.find_attributes_next_line(string=string, position=index, request_name=k) - else: - # The definition of the request is in the same line - params = self.find_attributes_in_the_same_line(request_name=k, params=data[1:]) + # If there is more than one line, it means that the test case has several operations, all of them to + # create the environment content to execute the last one, which is the correct one to test the Test Case + if len(lines_starting_response) > 1: + # The last one corresponds to the execution of the test, the rest corresponds to the initial condition of + # test case... + response_to_check = lines_starting_response[-1] + else: + response_to_check = lines_starting_response[0] + + index = string.find(response_to_check) + aux = string[index:].split('\n') + + params = list() + request = str() + + # Get the list of params of the function, they are the keys + if ' ... ' in aux[1]: + request = aux[0].split(' ')[2] + # We are in the case that the attributes are in following lines + for i in range(1, len(aux)): + if ' ... ' in aux[i]: + regex = '\s{4}\.{3}\s{4}(.*)' + param = re.match(pattern=regex, string=aux[i]) + if aux: + params.append(param.groups()[0]) + else: + break + + #params = self.find_attributes_next_lines(string=string, position=index, request_name=request) + params = self.find_attributes_in_the_same_line(request_name=request, params=params) + else: + # the attributes are in the same line + regex = r"\s*\$\{response\}=\s{4}(.*)" + matches = re.finditer(regex, response_to_check, re.MULTILINE) + request = aux[0].split(' ')[2] + + # We have two options from here, or the parameters are defined in the same line or the parameters are defined in + # following lines, next lines + for match in matches: + # Check that we have 1 group matched + if len(match.groups()) == 1: + aux = match.group(1) - description = self.description[k](params) + # Get the list of keys + params = aux.split(' ')[1:] + else: + raise Exception(f"Error, unexpected format, received: '{response_to_check}'") + + params = self.find_attributes_in_the_same_line(request_name=request, params=params) + + description = self.description[request](params) return description def find_attributes_in_the_same_line(self, request_name, params): @@ -70,12 +178,12 @@ class Requests: for i in range(0, len(self.op[request_name]['positions'])): param_position = self.op[request_name]['positions'][i] param_key = self.op[request_name]['params'][i] - param_value = self.get_value(params=params, param_position=param_position) + param_value = self.get_value(params=params, param_position=param_position, param_key=param_key) param[param_key] = param_value return param - def find_attributes_next_line(self, string, position, request_name): + def find_attributes_next_lines(self, string, position, request_name): aux = string[position+len(request_name)+1:].split('\n') params = list() @@ -90,8 +198,8 @@ class Requests: for i in range(0, len(self.op[request_name]['positions'])): print(i) param_position = self.op[request_name]['positions'][i] - 1 - param_value = self.get_value(params=params, param_position=param_position) param_key = self.op[request_name]['params'][i] + param_value = self.get_value(params=params, param_position=param_position, param_key=param_key) param[param_key] = param_value return param @@ -123,13 +231,163 @@ class Requests: else: raise Exception(f"ERROR, expected filename attribute, but received {kwargs}") - def get_value(self, params, param_position): + @staticmethod + def query_entity(kwargs) -> str: + result = '' + if 'context' in kwargs and kwargs['context'] != '': + result = f"Request Header['Link'] contain the context {kwargs['context']}" + + if 'accept' in kwargs: + result = f"{result}\nHeader['Accept'] set to {kwargs['accept']}" + + if 'context' not in kwargs and 'accept' not in kwargs: + raise Exception(f"ERROR, expected context attribute, but received {kwargs}") + + return result + + @staticmethod + def retrieve_subscription(kwargs) -> str: + if 'accept' in kwargs: + return f"Request a subscription\nHeader['Accept'] set to '{kwargs['accept']}'" + else: + return "Request a subscription" + + def query_context_source_registrations_with_return(kwargs) -> str: + if 'type' in kwargs and 'accept' in kwargs: + result = "Request a Context Source Registration with Return" + + if kwargs['type'] != '': + result = f"{result}\nEntity Type set to '{kwargs['type']}'" + + if kwargs['accept'] != '': + result = f"{result}\nHeader['Accept'] set to '{kwargs['accept']}'" + else: + result = "Request a Context Source Registration with Return" + + return result + + def query_temporal_representation_of_entities_with_return(kwargs) -> str: + return "Request a Temporal Representation of Entities with Return" + + def partial_update_entity_attributes(kwargs) -> str: + if 'context' in kwargs and 'content' in kwargs and 'filename' in kwargs: + context = kwargs['context'] + if context == '': + return (f"Request Partial Update Entity Attributes and \n" + f"Header['Content-Type'] set to '{kwargs['content']}' and\n" + f"Payload defined in file '{kwargs['filename']}'") + else: + return (f"Request Partial Update Entity Attributes and \n" + f"Header['Link'] contain the context '{kwargs['context']}' and \n" + f"Header['Content-Type'] set to '{kwargs['content']}' and\n" + f"Payload defined in file '{kwargs['filename']}'") + else: + raise Exception(f"ERROR, expected context attribute, but received {kwargs}") + + def update_subscription(kwargs) -> str: + if 'context' in kwargs and 'content' in kwargs and 'filename' in kwargs: + context = kwargs['context'] + if context == '': + return (f"Request Update Subscription and \n" + f"Header['Content-Type'] set to '{kwargs['content']}' and\n" + f"Payload defined in file '{kwargs['filename']}'") + else: + return (f"Request Update Subscription and \n" + f"Header['Link'] contain the context '{kwargs['context']}' and\n" + f"Header['Content-Type'] set to '{kwargs['content']}' and\n" + f"Payload defined in file '{kwargs['filename']}'") + else: + raise Exception(f"ERROR, expected context attribute, but received {kwargs}") + + @staticmethod + def query_context_source_registration_subscriptions(kwargs) -> str: + if 'accept' in kwargs: + return (f"Request Context Source Registration Subscriptions\n" + f"Header['Accept'] set to '{kwargs['accept']}'") + else: + raise Exception(f"ERROR, expected accept attribute, but received {kwargs}") + + @staticmethod + def query_temporal_representation_of_entities(kwargs) -> str: + expected_parameters = ['entity_types', 'timerel', 'timeAt', 'accept'] + result = [x for x in expected_parameters if x not in kwargs] + + if len(result) == 0: + response = ("Response containing:\n" + f" * Entity-Type is equal to '{kwargs['entity_types']}'\n" + f" * timeRel is equal to '{kwargs['timerel']}'\n" + f" * timeAt is equal to '{kwargs['timeAt']}'\n" + f" * Accept is equal to '{kwargs['accept']}'") + return response + else: + raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " + f"'{expected_parameters}', but received: {kwargs}") + + @staticmethod + def retrieve_attribute(kwargs) -> str: + if 'attribute_name' in kwargs: + return f"Retrieve Attribute with attributeName set to '{kwargs['attribute_name']}'" + + @staticmethod + def retrieve_entity_type(kwargs) -> str: + result = "Retrieve Entity Type" + if 'type' in kwargs: + result = f"{result}, with type set to '{kwargs['type']}'" + + if 'context' in kwargs and kwargs['context'] != '': + result = f"{result}, with Header['Link'] containing '{kwargs['context']}'" + + if 'type' not in kwargs or 'context' not in kwargs: + raise Exception(f"ERROR, expected type or context attributes, received '{kwargs}'") + + return result + + @staticmethod + def query_entities(kwargs) -> str: + result = "Request Query Entities" + if 'entity_ids' in kwargs and kwargs['entity_ids'] != '': + result = f"{result} with entity_ids set to '{kwargs['entity_ids']}'" + + if 'entity_types' in kwargs and kwargs['entity_types'] != '': + result = f"{result} with entity_types set to '{kwargs['entity_types']}" + + if 'accept' in kwargs and kwargs['accept'] != '': + result = f"{result} with Header['Accept'] set to '{kwargs['accept']}'" + + return result + + def get_value(self, params, param_position, param_key): + data = [x for x in params if f'{param_key}=' in x] + + if len(data) == 1: + # The name of the attribute is passed to the function in the form attribute=value + data = data[0] + data = data.split('=') + if data[0] != param_key: + return '' + + data = data[1] + elif len(data) == 0: + # There is no attribute=something therefore we have to apply the position + try: + data = params[param_position] + + # Workaround + if 'accept' in data and param_key != 'accept': + data = '' + except IndexError: + return '' + try: - value = self.variables[params[param_position]] + value = self.variables[data] return value except KeyError: try: - value = self.apiutils_variables[params[param_position]] + value = self.apiutils_variables[data] return value except KeyError: - return params[param_position] + try: + value = self.config_file.get_variable(variable=data) + return value + except KeyError: + return data diff --git a/doc/files/019_01_01.json b/doc/files/019_01_01.json new file mode 100644 index 00000000..9c1d3532 --- /dev/null +++ b/doc/files/019_01_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_01", + "test_objective": "Check that you can query several entities based on ids", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_01_01 Query several entities based on ids", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_01", + "doc": "Check that you can query several entities based on ids", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_01_01" +} \ No newline at end of file diff --git a/doc/files/019_01_03.json b/doc/files/019_01_03.json new file mode 100644 index 00000000..5158e2d9 --- /dev/null +++ b/doc/files/019_01_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_03", + "test_objective": "Check that you can query several entities based on the given id pattern", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_01_03 Query several entities based on the given id pattern", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_03", + "doc": "Check that you can query several entities based on the given id pattern", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'entity_id_pattern=${entity_id_pattern}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_01_03" +} \ No newline at end of file diff --git a/doc/files/019_01_04.json b/doc/files/019_01_04.json new file mode 100644 index 00000000..b6e04430 --- /dev/null +++ b/doc/files/019_01_04.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_04", + "test_objective": "Check that you can query several entities based on attribute names", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_01_04 Query several entities based on attribute names", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_04", + "doc": "Check that you can query several entities based on attribute names", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'attrs=${attributes_to_be_retrieved}'", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_01_04" +} \ No newline at end of file diff --git a/doc/files/019_02_01.json b/doc/files/019_02_01.json new file mode 100644 index 00000000..02569888 --- /dev/null +++ b/doc/files/019_02_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_01", + "test_objective": "Check that you can query several entities via POST Interaction based on ids", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_02_01 Query several entities via POST Interaction based on ids", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_01", + "doc": "Check that you can query several entities via POST Interaction based on ids", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_02_01" +} \ No newline at end of file diff --git a/doc/files/019_02_03.json b/doc/files/019_02_03.json new file mode 100644 index 00000000..9042909e --- /dev/null +++ b/doc/files/019_02_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_03", + "test_objective": "Check that you can query several entities via POST Interaction based on the given id pattern", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_02_03 Query several entities via POST Interaction based on the given id pattern", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_03", + "doc": "Check that you can query several entities via POST Interaction based on the given id pattern", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'entity_id_pattern=${entity_id_pattern}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_02_03" +} \ No newline at end of file diff --git a/doc/files/019_03_01.json b/doc/files/019_03_01.json new file mode 100644 index 00000000..9f31585b --- /dev/null +++ b/doc/files/019_03_01.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_01", + "test_objective": "Check that you cannot query entities if the requested ids are incorrect", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_03_01 Query entities based on incorrect ids", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_01", + "doc": "Check that you cannot query entities if the requested ids are incorrect", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Response body containing 'title' element and\n Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_03_01" +} \ No newline at end of file diff --git a/doc/files/019_03_02.json b/doc/files/019_03_02.json new file mode 100644 index 00000000..3250d0df --- /dev/null +++ b/doc/files/019_03_02.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_02", + "test_objective": "Check that you cannot query entities if the requested entity types are incorrect", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_03_02 Query entities based on incorrect entity types", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_02", + "doc": "Check that you cannot query entities if the requested entity types are incorrect", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Response body containing 'title' element and\n Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'entity_types=${entity_types_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_03_02" +} \ No newline at end of file diff --git a/doc/files/019_03_03.json b/doc/files/019_03_03.json new file mode 100644 index 00000000..0d03de11 --- /dev/null +++ b/doc/files/019_03_03.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_03", + "test_objective": "Check that you cannot query entities if the requested id pattern is incorrect", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_2", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_03_03 Query several entities based on incorrect id pattern", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_03", + "doc": "Check that you cannot query entities if the requested id pattern is incorrect", + "tags": [ + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Response body containing 'title' element and\n Response Status Code set to 400\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'entity_id_pattern=${invalid_entity_id_pattern}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_03_03" +} \ No newline at end of file diff --git a/doc/files/019_04.json b/doc/files/019_04.json new file mode 100644 index 00000000..244d6875 --- /dev/null +++ b/doc/files/019_04.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_04", + "test_objective": "Check that the queried entities by Id can be returned in a simplified representation", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_7", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_04_01 Query entities in a simplified representation", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_04_01", + "doc": "Check that the queried entities by Id can be returned in a simplified representation", + "tags": [ + "6_3_7", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_04" +} \ No newline at end of file diff --git a/doc/files/019_05.json b/doc/files/019_05.json new file mode 100644 index 00000000..2dc50499 --- /dev/null +++ b/doc/files/019_05.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_05", + "test_objective": "Check that the queried entities by id can be returned in a geoJSON format", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_7", + "keywords": [ + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "019_05_01 Get an entity by id that can be returned in a geoJSON format", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_05_01", + "doc": "Check that the queried entities by id can be returned in a geoJSON format", + "tags": [ + "6_3_7", + "e-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_05" +} \ No newline at end of file diff --git a/doc/files/021_02.json b/doc/files/021_02.json new file mode 100644 index 00000000..a4c7f0eb --- /dev/null +++ b/doc/files/021_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_02", + "test_objective": "Check that you can query the temporal evolution of certain attributes of entities", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_4", + "keywords": [ + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "021_02_01 Query the temporal evolution of certain attributes of entities", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_02_01", + "doc": "Check that you can query the temporal evolution of certain attributes of entities", + "tags": [ + "5_7_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-02-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}' and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Response containing:\n * Entity-Type is equal to '${entity_types_to_be_retrieved}'\n * timeRel is equal to 'after'\n * timeAt is equal to '2020-07-01T12:05:00Z'\n * Accept is equal to 'attrs=${temporal_attributes_to_be_retrieved}'", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_02" +} \ No newline at end of file diff --git a/doc/files/024_01.json b/doc/files/024_01.json new file mode 100644 index 00000000..c66a70b3 --- /dev/null +++ b/doc/files/024_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_01", + "test_objective": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_7", + "keywords": [ + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "024_01_01 Retrieve Detailed Representation Of Available Entity Type Without Context", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_01_01", + "doc": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type", + "tags": [ + "5_7_7", + "ed-type" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Response body containing 'title' element and\n Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types/{type}'\n method set to 'GET'\n Retrieve Entity Type, with type set to 'Building'", + "http_verb": "GET", + "endpoint": "types/{type}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation", + "robotfile": "024_01" +} \ No newline at end of file diff --git a/doc/files/024_02.json b/doc/files/024_02.json new file mode 100644 index 00000000..ebce59c0 --- /dev/null +++ b/doc/files/024_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02", + "test_objective": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_7", + "keywords": [ + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "024_02_01 Retrieve Detailed Representation Of Available Entity Type", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02_01", + "doc": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type", + "tags": [ + "5_7_7", + "ed-type" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing an Entity Type Info and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types/{type}'\n method set to 'GET'\n Retrieve Entity Type, with type set to 'Building', with Header['Link'] containing 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'", + "http_verb": "GET", + "endpoint": "types/{type}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation", + "robotfile": "024_02" +} \ No newline at end of file diff --git a/doc/files/027_01.json b/doc/files/027_01.json new file mode 100644 index 00000000..b75b35f4 --- /dev/null +++ b/doc/files/027_01.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_01", + "test_objective": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_10", + "keywords": [ + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "027_01_01 Retrieve Detailed Representation Of Available Attribute Without Context", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_01_01", + "doc": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute", + "tags": [ + "5_7_10", + "ed-attr" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Response body containing 'title' element and\n Response Status Code set to 404\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to 'airQualityLevel'", + "http_verb": "GET", + "endpoint": "attributes/{attribute_name}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation", + "robotfile": "027_01" +} \ No newline at end of file diff --git a/doc/files/027_02.json b/doc/files/027_02.json new file mode 100644 index 00000000..6401e71b --- /dev/null +++ b/doc/files/027_02.json @@ -0,0 +1,35 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02", + "test_objective": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_10", + "keywords": [ + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "027_02_01 Retrieve Detailed Representation Of Available Attribute", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02_01", + "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "tags": [ + "5_7_10", + "ed-attr" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing an array of Attributes and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to 'airQualityLevel'", + "http_verb": "GET", + "endpoint": "attributes/{attribute_name}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation", + "robotfile": "027_02" +} \ No newline at end of file diff --git a/doc/files/044_01.json b/doc/files/044_01.json deleted file mode 100644 index 515f5ad5..00000000 --- a/doc/files/044_01.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CB/044_01", - "test_objective": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_6_3_4", - "keywords": [], - "teardown": "None", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "044_01_01 endpoint /entities/{entityId}/attrs/{attrId}", - "permutation_tp_id": "TP/NGSI-LD/CB/044_01_01", - "doc": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", - "tags": [ - "6_3_4", - "ea-partial-update" - ], - "setup": null, - "teardown": "Delete Entity by Id", - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 204\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'vehicle-simple-attributes-sample.jsonld'", - "http_verb": "PATCH", - "endpoint": "entities/{entityId}/attrs/{attributeId}" - }, - { - "name": "044_01_02 endpoint /subscriptions/{subscriptionId}", - "permutation_tp_id": "TP/NGSI-LD/CB/044_01_02", - "doc": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", - "tags": [ - "6_3_4", - "sub-update" - ], - "setup": null, - "teardown": "Delete Subscription", - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 204\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'subscriptions/subscription-sample.jsonld'", - "http_verb": "PATCH", - "endpoint": "subscriptions/{subscription_id}" - } - ], - "permutations": [ - "endpoint", - "when" - ] -} \ No newline at end of file diff --git a/doc/files/043_01.json b/doc/files/CommonBehaviours/043_01.json similarity index 97% rename from doc/files/043_01.json rename to doc/files/CommonBehaviours/043_01.json index 476e460b..05efa025 100644 --- a/doc/files/043_01.json +++ b/doc/files/CommonBehaviours/043_01.json @@ -69,7 +69,7 @@ "teardown": "Batch Delete Entities", "template": null, "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/LdContextNotAvailable' and\n Response body containing 'title' element and\n Response Status Code set to 503\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'content_type=${CONTENT_TYPE_LD_JSON}' and\n payload set to a list of entities to be created", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload set to a list of entities to be created", "http_verb": "POST", "endpoint": "entityOperations/create" }, @@ -91,8 +91,10 @@ } ], "permutations": [ - "when", "endpoint", + "when", "then" - ] + ], + "robotpath": "CommonBehaviours", + "robotfile": "043" } \ No newline at end of file diff --git a/doc/files/CommonBehaviours/044_01.json b/doc/files/CommonBehaviours/044_01.json new file mode 100644 index 00000000..e9ee7848 --- /dev/null +++ b/doc/files/CommonBehaviours/044_01.json @@ -0,0 +1,51 @@ +{ + "tp_id": "TP/NGSI-LD/CB/044_01", + "test_objective": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "044_01_01 endpoint /entities/{entityId}/attrs/{attrId}", + "permutation_tp_id": "TP/NGSI-LD/CB/044_01_01", + "doc": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", + "tags": [ + "6_3_4", + "ea-partial-update" + ], + "setup": null, + "teardown": "Delete Entity by Id", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 204\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and \nHeader['Link'] contain the context 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and \nHeader['Content-Type'] set to 'application/merge-patch+json' and\nPayload defined in file 'vehicle-brandname-fragment.json'", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "044_01_02 endpoint /subscriptions/{subscriptionId}", + "permutation_tp_id": "TP/NGSI-LD/CB/044_01_02", + "doc": "Verify that PATCH HTTP requests can be done with \"application/merge-patch+json\" as Content-Type", + "tags": [ + "6_3_4", + "sub-update" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 204\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Link'] contain the context 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\nHeader['Content-Type'] set to 'application/merge-patch+json' and\nPayload defined in file 'subscriptions/fragments/subscription-update-sample.json'", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + } + ], + "permutations": [ + "when", + "endpoint" + ], + "robotpath": "CommonBehaviours", + "robotfile": "044_01" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/044_02.json b/doc/files/CommonBehaviours/044_02.json new file mode 100644 index 00000000..c81d0211 --- /dev/null +++ b/doc/files/CommonBehaviours/044_02.json @@ -0,0 +1,83 @@ +{ + "tp_id": "TP/NGSI-LD/CB/044_02", + "test_objective": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "044_02_01 endpoint /entities/{entityId}", + "permutation_tp_id": "TP/NGSI-LD/CB/044_02_01", + "doc": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed (/entities/{entityId})", + "tags": [ + "6_3_4", + "e-query" + ], + "setup": null, + "teardown": "Delete Entity by Id Returning Response", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Header: Content-Type set to application/json and\n Response Header: Link is not Empty and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Request Header['Link'] contain the context https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld\nHeader['Accept'] set to */*", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "044_02_02 endpoint /subscriptions/{subscriptionId}", + "permutation_tp_id": "TP/NGSI-LD/CB/044_02_02", + "doc": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed (/subscriptions/{subscriptionId})", + "tags": [ + "6_3_4", + "sub-retrieve" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Header: Content-Type set to application/json and\n Response Header: Link is not Empty and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Request a subscription\nHeader['Accept'] set to '*/*'", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + }, + { + "name": "044_02_03 endpoint /csourceRegistrations/", + "permutation_tp_id": "TP/NGSI-LD/CB/044_02_03", + "doc": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed (/csourceRegistrations/)", + "tags": [ + "6_3_4", + "csr-query" + ], + "setup": null, + "teardown": "Delete Context Source Registration", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Header: Content-Type set to application/json and\n Response Header: Link is not Empty and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Request a Context Source Registration with Return\nEntity Type set to 'Vehicle'\nHeader['Accept'] set to '*/*'", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "044_02_04 endpoint /temporal/entities", + "permutation_tp_id": "TP/NGSI-LD/CB/044_02_04", + "doc": "Verify that on a GET HTTP request if nothing is specified on the Accept header, \"application/json\" is assumed (/temporal/entities)", + "tags": [ + "6_3_4", + "te-query" + ], + "setup": null, + "teardown": "Delete Temporal Representation Of Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Header: Content-Type set to application/json and\n Response Header: Link is not Empty and\n Response Status Code set to 200\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Request a Temporal Representation of Entities with Return", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "endpoint", + "when" + ], + "robotpath": "CommonBehaviours", + "robotfile": "044_02" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/044_03.json b/doc/files/CommonBehaviours/044_03.json new file mode 100644 index 00000000..01db0ed9 --- /dev/null +++ b/doc/files/CommonBehaviours/044_03.json @@ -0,0 +1,116 @@ +{ + "tp_id": "TP/NGSI-LD/CB/044_03", + "test_objective": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "044_03_01 endpoint patch /entities/{entityId}/attrs/{attrId}", + "permutation_tp_id": "TP/NGSI-LD/CB/044_03_01", + "doc": "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": [ + "6_3_4", + "ea-partial-update" + ], + "setup": null, + "teardown": "Delete Entity by Id Returning Response", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and \nHeader['Content-Type'] set to 'application/xml' and\nPayload defined in file 'vehicle-brandname-fragment.jsonld'", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + }, + { + "name": "044_03_02 endpoint patch /subscriptions/{subscriptionId}", + "permutation_tp_id": "TP/NGSI-LD/CB/044_03_02", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (patch /subscriptions/{subscriptionId})", + "tags": [ + "6_3_4", + "sub-update" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{subscription_id}'\n method set to 'PATCH'\n Request Update Subscription and \nHeader['Content-Type'] set to 'application/xml' and\nPayload defined in file 'csourceSubscriptions/fragments/subscription-update-sample.jsonld'", + "http_verb": "PATCH", + "endpoint": "subscriptions/{subscription_id}" + }, + { + "name": "044_03_03 endpoint post /entities/", + "permutation_tp_id": "TP/NGSI-LD/CB/044_03_03", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (post /entities/)", + "tags": [ + "6_3_4", + "e-create" + ], + "setup": null, + "teardown": "Delete Entity by Id", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/xml' and\n payload defined in file: 'building-simple-attributes-sample.jsonld'", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "044_03_04 endpoint post /subscriptions/", + "permutation_tp_id": "TP/NGSI-LD/CB/044_03_04", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (post /subscriptions/)", + "tags": [ + "6_3_4", + "sub-create" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/xml' and\n payload defined in file: 'csourceSubscriptions/subscription-sample.jsonld'", + "http_verb": "POST", + "endpoint": "subscriptions/" + }, + { + "name": "044_03_05 endpoint post /entityOperations/create", + "permutation_tp_id": "TP/NGSI-LD/CB/044_03_05", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (post /entityOperations/create)", + "tags": [ + "6_3_4", + "be-create" + ], + "setup": null, + "teardown": "Batch Delete Entities", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/create'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/xml' and\n payload set to a list of entities to be created", + "http_verb": "POST", + "endpoint": "entityOperations/create" + }, + { + "name": "044_03_06 endpoint post /temporal/entities/", + "permutation_tp_id": "TP/NGSI-LD/CB/044_03_06", + "doc": "Verify throwing 415 HTTP status code (Unsupported Media Type) if \"Content-Type\" header is not \"application/json\" or \"application/ld+json\" (post /temporal/entities/)", + "tags": [ + "6_3_4", + "te-create" + ], + "setup": null, + "teardown": "Delete Temporal Representation Of Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 415\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/xml' and\n payload defined in file: 'vehicle-temporal-representation-sample.jsonld'", + "http_verb": "POST", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "endpoint", + "http_verb", + "when" + ], + "robotpath": "CommonBehaviours", + "robotfile": "044_03" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/044_04.json b/doc/files/CommonBehaviours/044_04.json new file mode 100644 index 00000000..bd14baf7 --- /dev/null +++ b/doc/files/CommonBehaviours/044_04.json @@ -0,0 +1,98 @@ +{ + "tp_id": "TP/NGSI-LD/CB/044_04", + "test_objective": "Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the \"Accept\" header does not imply \"application/json\" nor \"application/ld+json\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "044_04_01 endpoint get /entities/{entityId}", + "permutation_tp_id": "TP/NGSI-LD/CB/044_04_01", + "doc": "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": [ + "6_3_4", + "e-query" + ], + "setup": null, + "teardown": "Delete Entity by Id Returning Response", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n \nHeader['Accept'] set to application/xml", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "044_04_02 endpoint get /subscriptions/{subscriptionId}", + "permutation_tp_id": "TP/NGSI-LD/CB/044_04_02", + "doc": "Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the \"Accept\" header does not imply \"application/json\" nor \"application/ld+json\" (get /subscriptions/{subscriptionId})", + "tags": [ + "6_3_4", + "sub-retrieve" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Request a subscription\nHeader['Accept'] set to 'application/xml'", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + }, + { + "name": "044_04_03 endpoint get /csourceRegistrations/", + "permutation_tp_id": "TP/NGSI-LD/CB/044_04_03", + "doc": "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": [ + "6_3_4", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Request a Context Source Registration with Return\nEntity Type set to 'Building'\nHeader['Accept'] set to 'application/xml'", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + }, + { + "name": "044_04_04 endpoint get /csourceSubscriptions/", + "permutation_tp_id": "TP/NGSI-LD/CB/044_04_04", + "doc": "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" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceSubscriptions'\n method set to 'GET'\n Request Context Source Registration Subscriptions\nHeader['Accept'] set to 'application/xml'", + "http_verb": "GET", + "endpoint": "csourceSubscriptions" + }, + { + "name": "044_04_05 endpoint get /temporal/entities", + "permutation_tp_id": "TP/NGSI-LD/CB/044_04_05", + "doc": "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": [ + "6_3_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Response containing:\n * Entity-Type is equal to '${entity_types_to_be_retrieved}'\n * timeRel is equal to 'after'\n * timeAt is equal to '2020-08-01T12:05:00Z'\n * Accept is equal to 'application/xml'", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when", + "endpoint" + ], + "robotpath": "CommonBehaviours", + "robotfile": "044_04" +} \ No newline at end of file diff --git a/doc/files/CommonBehaviours/044_05.json b/doc/files/CommonBehaviours/044_05.json new file mode 100644 index 00000000..eb808692 --- /dev/null +++ b/doc/files/CommonBehaviours/044_05.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CB/044_05", + "test_objective": "Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the \"Accept\" header is \"application/geo+json\" for operations different than \"Retrieve Entity\" and \"Query Entity\"", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_6_3_4", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT in the \"initial state\"\n}", + "test_cases": [ + { + "name": "044_05_01 Retrieve subscription by id", + "permutation_tp_id": "TP/NGSI-LD/CB/044_05_01", + "doc": "Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the \"Accept\" header does not imply \"application/json\" nor \"application/ld+json\" (get /subscriptions/{subscriptionId})", + "tags": [ + "6_3_4", + "sub-retrieve" + ], + "setup": null, + "teardown": "Delete Subscription", + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/subscriptions/{id}'\n method set to 'GET'\n Request a subscription\nHeader['Accept'] set to 'application/geo+json'", + "http_verb": "GET", + "endpoint": "subscriptions/{id}" + }, + { + "name": "044_05_02 Query temporal entities", + "permutation_tp_id": "TP/NGSI-LD/CB/044_05_02", + "doc": "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": [ + "6_3_4", + "te-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Response containing:\n * Entity-Type is equal to '${entity_types_to_be_retrieved}'\n * timeRel is equal to 'after'\n * timeAt is equal to '2020-08-01T12:05:00Z'\n * Accept is equal to 'application/geo+json'", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "044_05_03 Query context source registration", + "permutation_tp_id": "TP/NGSI-LD/CB/044_05_03", + "doc": "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": [ + "6_3_4", + "csr-query" + ], + "setup": null, + "teardown": null, + "template": null, + "then": "then {\n the SUT sends a valid Response containing:\n Response Status Code set to 406\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'GET'\n Request a Context Source Registration with Return\nEntity Type set to 'Building'\nHeader['Accept'] set to 'application/geo+json'", + "http_verb": "GET", + "endpoint": "csourceRegistrations" + } + ], + "permutations": [ + "endpoint", + "when" + ], + "robotpath": "CommonBehaviours", + "robotfile": "044_05" +} \ No newline at end of file diff --git a/doc/generateDocumentationData.py b/doc/generateDocumentationData.py index 0573fb3c..fc46923f 100644 --- a/doc/generateDocumentationData.py +++ b/doc/generateDocumentationData.py @@ -1,39 +1,49 @@ -from doc.analysis.generaterobotdata import GenerateRobotData -import json -import sys +from analysis.generaterobotdata import GenerateRobotData +from json import dump +from sys import argv from os.path import dirname, exists -from os import makedirs +from os import makedirs, walk -def create_json_of_robotfile(robot_path_to_be_processed: str, robot_file_to_be_processed: str): + +def create_json_of_robotfile(robot_file_to_be_processed: str): folder_test_suites = dirname(dirname(__file__)) + folder_result_path = f'{folder_test_suites}/doc/results' result_file = f'{folder_result_path}/{robot_file_to_be_processed}.json' - robot_file = f'{folder_test_suites}/TP/NGSI-LD/{robot_path_to_be_processed}/{robot_file_to_be_processed}.robot' + robot_path_to_be_processed, robot_file = find_robot_file(basedir=folder_test_suites, + filename=robot_file_to_be_processed) # Check that the folder '/results' exists and if not, create it if not exists(folder_result_path): makedirs(folder_result_path) - try: - data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites) - data.parse_robot() - info = data.get_info() - except Exception as e: - print("WHILE GENERATING ROBOT DATA:", e) - info = {} - info["error_while_parsing"] = True - - info["robotpath"] = robot_path_to_be_processed - info["robotfile"] = robot_file_to_be_processed + #try: + data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites) + data.parse_robot() + info = data.get_info() + #except Exception as e: + # print("WHILE GENERATING ROBOT DATA:", e) + # info = dict() + # info["error_while_parsing"] = True with open(result_file, 'w') as fp: - json.dump(obj=info, indent=4, fp=fp) + dump(obj=info, indent=2, fp=fp) return info + +def find_robot_file(basedir: str, filename: str): + filename = f'{filename}.robot' + for root, dirs, files in walk(basedir): + if filename in files: + return root.replace(f'{basedir}/TP/NGSI-LD', ''), f'{root}/{filename}' + + return None, None + + if __name__ == "__main__": - args = sys.argv[1:] - robot_path_tbp = args[0] - robot_file_tbp = args[1] - resulting_json = create_json_of_robotfile(robot_path_tbp, robot_file_tbp) + # Call with the folder below /TP/NGSI-LD which contains the robot file with name args[0] + args = argv[1:] + robot_file_tbp = args[0] + resulting_json = create_json_of_robotfile(robot_file_tbp) print("Correctly exiting") diff --git a/doc/tests/test_CommonBehaviours.py b/doc/tests/test_CommonBehaviours.py index f29ccf1d..13f714f0 100644 --- a/doc/tests/test_CommonBehaviours.py +++ b/doc/tests/test_CommonBehaviours.py @@ -8,9 +8,10 @@ from os import listdir, remove, makedirs class TestCommonBehaviours(TestCase): - def setUp(self) -> None: - self.folder_test_suites = dirname(dirname(dirname(__file__))) - folder_results = f'{self.folder_test_suites}/doc/results' + @classmethod + def setUpClass(cls): + TestCommonBehaviours.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCommonBehaviours.folder_test_suites}/doc/results' # Check that the folder '/results' exists and if not, create it if not exists(folder_results): @@ -19,6 +20,9 @@ class TestCommonBehaviours(TestCase): # Delete the /results folder [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + def common_function(self, robot_file, expected_value, difference_file): data = GenerateRobotData(robot_file=robot_file, execdir=self.folder_test_suites) @@ -39,15 +43,42 @@ class TestCommonBehaviours(TestCase): def test_043_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/043.robot' - expected_value = f'{self.folder_test_suites}/doc/files/043_01.json' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/043_01.json' difference_file = f'{self.folder_test_suites}/doc/results/out_043_01.json' self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) def test_044_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/044_01.robot' - expected_value = f'{self.folder_test_suites}/doc/files/044_01.json' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/044_01.json' difference_file = f'{self.folder_test_suites}/doc/results/out_044_01.json' self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_044_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/044_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/044_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_044_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_044_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/044_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/044_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_044_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_044_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/044_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/044_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_044_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_044_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/CommonBehaviours/044_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/CommonBehaviours/044_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_044_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py new file mode 100644 index 00000000..99bd21e6 --- /dev/null +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -0,0 +1,279 @@ +#!/usr/bin/env python +from unittest import TestCase +from doc.analysis.generaterobotdata import GenerateRobotData +from json import load, dump +from deepdiff import DeepDiff +from os.path import dirname, exists +from os import listdir, remove, makedirs + + +class TestCIConsumptions(TestCase): + @classmethod + def setUpClass(cls): + # TODO: Test Suites checked until 019_01_01 + TestCIConsumptions.folder_test_suites = dirname(dirname(dirname(__file__))) + folder_results = f'{TestCIConsumptions.folder_test_suites}/doc/results' + + # Check that the folder '/results' exists and if not, create it + if not exists(folder_results): + makedirs(folder_results) + else: + # Delete the /results folder + [remove(f'{folder_results}/{x}') for x in listdir(folder_results) if x.startswith('out')] + + def setUp(self) -> None: + self.folder_test_suites = dirname(dirname(dirname(__file__))) + + def common_function(self, robot_file, expected_value, difference_file): + data = GenerateRobotData(robot_file=robot_file, + execdir=self.folder_test_suites) + data.parse_robot() + obtained_response = data.get_info() + + with open(expected_value, 'r') as file: + expected_response = load(file) + + result = DeepDiff(t1=obtained_response, t2=expected_response, ignore_order=True) + + if len(result) != 0: + # There are some differences + with open(difference_file, 'w') as fp: + dump(obj=obtained_response, indent=2, fp=fp) + + assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}' + + def test_027_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/027_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_027_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_027_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/027_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_027_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_025_01(self): + self.fail("(025_01) Test Suite with Test Template, not yet implemented") + + def test_022_01(self): + self.fail("(022_01) Test Suite with Test Template, not yet implemented") + + def test_026_01(self): + self.fail("(026_01) Test Suite with Test Template, not yet implemented") + + def test_023_01(self): + self.fail("(023_01) Test Suite with Test Template, not yet implemented") + + def test_024_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/024_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_024_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_024_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/024_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_024_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_01_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_01_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_02(self): + self.fail("(019_01_02) Problems with Request parameters") + + def test_019_01_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_01_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_01_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_01_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_01_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_01_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_01_05(self): + self.fail("(019_01_05) Problems with Request parameters") + + def test_019_02_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_02_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_02_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_02_02(self): + self.fail("(019_02_02) Problems with Request parameters") + + def test_019_02_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_02_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_02_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_02_04(self): + self.fail("(019_02_04) Problems with Request parameters") + + def test_019_02_05(self): + self.fail("(019_02_05) Problems with Request parameters") + + def test_019_03_01(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_01.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_03_01.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_03_01.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_03_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_03_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_03_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_03_03(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_03.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_03_03.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_03_03.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_03_04(self): + self.fail("(019_03_04) Problems with Request parameters") + + def test_019_03_05(self): + self.fail("(019_03_04) Problems with Request parameters") + + def test_019_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + self.fail("(019_04) Problems with Request parameters, Query Entities missing options parameter") + + def test_019_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/019_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + self.fail("(019_04) Problems with Request parameters, Query Entities missing accept parameter") + + def test_019_06(self): + self.fail("(019_06) Problems with 'Check Response Body Containing Number Of Entities'") + + def test_018_01_01(self): + self.fail("(018_01_01) Problems with Query Entity, context-type information used for Link information") + + def test_018_01_02(self): + self.fail("(018_01_02) Problems with Query Entity") + + def test_018_01_03(self): + self.fail("(018_01_03) Problems with Query Entity") + + def test_018_02(self): + self.fail("(018_02) Test Suite with Test Template, not yet implemented") + + def test_018_03_01(self): + self.fail("(018_03_01) Problems with Query Entity") + + def test_018_03_02(self): + self.fail("(018_03_02) Problems with Query Entity") + + def test_018_04(self): + self.fail("(018_04) Problems with Request parameters, Query Entity missing options parameter") + + def test_018_05(self): + self.fail("(018_05) Problems with Request parameters, Query Entity missing options parameter") + + def test_018_06(self): + self.fail("(018_06) Test Suite with Test Template, not yet implemented") + + def test_021_01(self): + self.fail("(021_01) Test Suite with Test Template, not yet implemented") + + def test_021_02(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot' + expected_value = f'{self.folder_test_suites}/doc/files/021_02.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_02.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_03(self): + self.fail("(021_03) Problems with Request parameters, 'Query Temporal Representation Of Entities'") + + def test_021_04(self): + self.fail("(021_04) Problems with Request parameters, 'Query Temporal Representation Of Entities'") + + def test_021_05(self): + self.fail("(021_05) Problems with Request parameters, 'Query Temporal Representation Of Entities'") + + def test_021_06(self): + self.fail("(021_06) Problems with Request parameters, 'Query Temporal Representation Of Entities'") + + def test_021_07(self): + self.fail("(021_07) Problems with Request parameters, 'Query Temporal Representation Of Entities'") + + def test_021_08(self): + self.fail("(021_08) Problems with Request parameters, 'Query Temporal Representation Of Entities'") + + def test_021_09(self): + self.fail("(021_09) Test Suite with Test Template, not yet implemented") + + def test_021_10(self): + self.fail("(021_10) Problems with Request parameters, 'Query Temporal Representation Of Entities'") + + def test_021_11(self): + self.fail("(021_11) Test Suite with Test Template, not yet implemented") + + def test_021_12(self): + self.fail("(021_12) Problems with Request parameters, 'Query Temporal Representation Of Entities'") + + def test_021_13(self): + self.fail("(021_13) Test Suite with Test Template, not yet implemented") + + def test_020_01(self): + self.fail("(020_01) Problems with Request parameters, 'Retrieve Temporal Representation Of Entity'") + + def test_020_02(self): + self.fail("(020_02) Problems with Request parameters, 'Retrieve Temporal Representation Of Entity'") + + def test_020_03(self): + self.fail("(020_03) Problems with Request parameters, 'Retrieve Temporal Representation Of Entity'") + + def test_020_04(self): + self.fail("(020_04) Test Suite with Test Template, not yet implemented") + + def test_020_05(self): + self.fail("(020_05) Test Suite with Test Template, not yet implemented") + + def test_020_06(self): + self.fail("(020_06) Problems with Request parameters, 'Retrieve Temporal Representation Of Entity'") + + def test_020_07(self): + self.fail("(020_07) Problems with Request parameters, 'Retrieve Temporal Representation Of Entity'") + + def test_020_08(self): + self.fail("(020_08) Problems with Request parameters, 'Retrieve Temporal Representation Of Entity'") + + def test_020_09(self): + self.fail("(020_09) Test Suite with Test Template, not yet implemented") + + def test_020_10(self): + self.fail("(020_10) Test Suite with Test Template, not yet implemented") diff --git a/requirements.txt b/requirements.txt index 686ff92b..c0fe3567 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ robotframework==6.1.1 robotframework-jsonlibrary==0.5 robotframework-requests==0.9.5 -deepdiff==6.3.1 +deepdiff==6.5.0 prettydiff==0.1.0 robotframework-httpctrl==0.3.1 robotframework-tidy==4.5.0 -- GitLab From f6334b2dfb1d0e7036b37edac9931e9c1934cb98 Mon Sep 17 00:00:00 2001 From: Giuseppe Tropea Date: Fri, 29 Sep 2023 11:25:47 +0000 Subject: [PATCH 3/7] re-enabled try/catch to see if test failed parsing --- doc/generateDocumentationData.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/doc/generateDocumentationData.py b/doc/generateDocumentationData.py index fc46923f..1281d079 100644 --- a/doc/generateDocumentationData.py +++ b/doc/generateDocumentationData.py @@ -17,14 +17,18 @@ def create_json_of_robotfile(robot_file_to_be_processed: str): if not exists(folder_result_path): makedirs(folder_result_path) - #try: - data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites) - data.parse_robot() - info = data.get_info() - #except Exception as e: - # print("WHILE GENERATING ROBOT DATA:", e) - # info = dict() - # info["error_while_parsing"] = True + try: + data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites) + data.parse_robot() + info = data.get_info() + except Exception as e: + print("WHILE GENERATING ROBOT DATA:", e) + info = dict() + info["error_while_parsing"] = True + info["robotfile"] = robot_file_to_be_processed + if(robot_path_to_be_processed.startswith("/")): + robot_path_to_be_processed = robot_path_to_be_processed[1:] + info["robotpath"] = robot_path_to_be_processed with open(result_file, 'w') as fp: dump(obj=info, indent=2, fp=fp) -- GitLab From caf82b037088f7614f999a635afd57abd2e4862e Mon Sep 17 00:00:00 2001 From: Giuseppe Tropea Date: Fri, 29 Sep 2023 11:50:33 +0000 Subject: [PATCH 4/7] added flag to skip try/catch --- doc/generateDocumentationData.py | 26 ++++++++++++++++---------- doc/statisticsDocumentationData.py | 4 ++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/doc/generateDocumentationData.py b/doc/generateDocumentationData.py index 1281d079..9b314e26 100644 --- a/doc/generateDocumentationData.py +++ b/doc/generateDocumentationData.py @@ -5,7 +5,7 @@ from os.path import dirname, exists from os import makedirs, walk -def create_json_of_robotfile(robot_file_to_be_processed: str): +def create_json_of_robotfile(robot_file_to_be_processed: str, computestatistics: bool=False): folder_test_suites = dirname(dirname(__file__)) folder_result_path = f'{folder_test_suites}/doc/results' @@ -17,18 +17,24 @@ def create_json_of_robotfile(robot_file_to_be_processed: str): if not exists(folder_result_path): makedirs(folder_result_path) - try: + if computestatistics: + try: + data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites) + data.parse_robot() + info = data.get_info() + except Exception as e: + print("WHILE GENERATING ROBOT DATA:", e) + info = dict() + info["error_while_parsing"] = True + info["robotfile"] = robot_file_to_be_processed + if(robot_path_to_be_processed.startswith("/")): + robot_path_to_be_processed = robot_path_to_be_processed[1:] + info["robotpath"] = robot_path_to_be_processed + else: data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites) data.parse_robot() info = data.get_info() - except Exception as e: - print("WHILE GENERATING ROBOT DATA:", e) - info = dict() - info["error_while_parsing"] = True - info["robotfile"] = robot_file_to_be_processed - if(robot_path_to_be_processed.startswith("/")): - robot_path_to_be_processed = robot_path_to_be_processed[1:] - info["robotpath"] = robot_path_to_be_processed + with open(result_file, 'w') as fp: dump(obj=info, indent=2, fp=fp) diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py index 7c212b10..84d7dead 100644 --- a/doc/statisticsDocumentationData.py +++ b/doc/statisticsDocumentationData.py @@ -14,7 +14,7 @@ if __name__ == "__main__": if filename.endswith(".robot"): number_of_testcases += 1 name_of_test_case = filename[:-6] - json_of_test_case = create_json_of_robotfile(name_of_test_case) + json_of_test_case = create_json_of_robotfile(name_of_test_case, True) statistics[name_of_test_case] = dict() strippedpath = root[len(fullpath)+1:] statistics[name_of_test_case]["path"] = strippedpath @@ -32,4 +32,4 @@ if __name__ == "__main__": if testcaseresult["failed"] == True: print(testcasename+" "+testcaseresult["path"]) - print("Out of "+str(number_of_testcases)+" testcases, "+str(number_of_failures)+" of them failed to be correctly parsed") + print("Out of "+str(number_of_testcases)+" testcases, "+str(number_of_failures)+" of them failed to be correctly parsed") \ No newline at end of file -- GitLab From e7dffdc4571618be0302d40df8fe01291a84cdfe Mon Sep 17 00:00:00 2001 From: Giuseppe Tropea Date: Fri, 6 Oct 2023 12:50:39 +0200 Subject: [PATCH 5/7] output testcases.json in handlebars friendly format --- doc/statisticsDocumentationData.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py index 84d7dead..1050d2cf 100644 --- a/doc/statisticsDocumentationData.py +++ b/doc/statisticsDocumentationData.py @@ -1,18 +1,21 @@ from generateDocumentationData import create_json_of_robotfile from os.path import dirname from os import walk +from json import dump if __name__ == "__main__": basedir = dirname(dirname(__file__)) statistics = dict() + testcases = [] number_of_failures = 0 - number_of_testcases = 0 + number_of_all_testcases = 0 + number_of_successes = 0 fullpath = basedir+"/TP/NGSI-LD" for root, dirs, files in walk(fullpath): for filename in files: if filename.endswith(".robot"): - number_of_testcases += 1 + number_of_all_testcases += 1 name_of_test_case = filename[:-6] json_of_test_case = create_json_of_robotfile(name_of_test_case, True) statistics[name_of_test_case] = dict() @@ -23,6 +26,8 @@ if __name__ == "__main__": number_of_failures += 1 else: statistics[name_of_test_case]["failed"] = False + number_of_successes += 1 + testcases.append(json_of_test_case) print() print() @@ -32,4 +37,7 @@ if __name__ == "__main__": if testcaseresult["failed"] == True: print(testcasename+" "+testcaseresult["path"]) - print("Out of "+str(number_of_testcases)+" testcases, "+str(number_of_failures)+" of them failed to be correctly parsed") \ No newline at end of file + print("Out of "+str(number_of_all_testcases)+" testcases, "+str(number_of_failures)+" of them failed to be correctly parsed") + + with open("testcases.json", 'w') as fp: + dump(obj=testcases, indent=2, fp=fp) \ No newline at end of file -- GitLab From c1883be63026d6e7f76068de90cb4cedb0bf8b65 Mon Sep 17 00:00:00 2001 From: Giuseppe Tropea Date: Fri, 6 Oct 2023 15:33:49 +0200 Subject: [PATCH 6/7] deleted old jsons in wrong folder --- doc/files/019_01_01.json | 34 ---------------------------------- doc/files/019_01_03.json | 34 ---------------------------------- doc/files/019_01_04.json | 34 ---------------------------------- doc/files/019_02_01.json | 34 ---------------------------------- doc/files/019_02_03.json | 34 ---------------------------------- doc/files/019_03_01.json | 34 ---------------------------------- doc/files/019_03_02.json | 34 ---------------------------------- doc/files/019_03_03.json | 34 ---------------------------------- doc/files/019_04.json | 34 ---------------------------------- doc/files/019_05.json | 34 ---------------------------------- doc/files/021_02.json | 35 ----------------------------------- doc/files/024_01.json | 35 ----------------------------------- doc/files/024_02.json | 35 ----------------------------------- doc/files/027_01.json | 35 ----------------------------------- doc/files/027_02.json | 35 ----------------------------------- 15 files changed, 515 deletions(-) delete mode 100644 doc/files/019_01_01.json delete mode 100644 doc/files/019_01_03.json delete mode 100644 doc/files/019_01_04.json delete mode 100644 doc/files/019_02_01.json delete mode 100644 doc/files/019_02_03.json delete mode 100644 doc/files/019_03_01.json delete mode 100644 doc/files/019_03_02.json delete mode 100644 doc/files/019_03_03.json delete mode 100644 doc/files/019_04.json delete mode 100644 doc/files/019_05.json delete mode 100644 doc/files/021_02.json delete mode 100644 doc/files/024_01.json delete mode 100644 doc/files/024_02.json delete mode 100644 doc/files/027_01.json delete mode 100644 doc/files/027_02.json diff --git a/doc/files/019_01_01.json b/doc/files/019_01_01.json deleted file mode 100644 index 9c1d3532..00000000 --- a/doc/files/019_01_01.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_01", - "test_objective": "Check that you can query several entities based on ids", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_2", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_01_01 Query several entities based on ids", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_01", - "doc": "Check that you can query several entities based on ids", - "tags": [ - "5_7_2", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_01_01" -} \ No newline at end of file diff --git a/doc/files/019_01_03.json b/doc/files/019_01_03.json deleted file mode 100644 index 5158e2d9..00000000 --- a/doc/files/019_01_03.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_03", - "test_objective": "Check that you can query several entities based on the given id pattern", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_2", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_01_03 Query several entities based on the given id pattern", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_03", - "doc": "Check that you can query several entities based on the given id pattern", - "tags": [ - "5_7_2", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'entity_id_pattern=${entity_id_pattern}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_01_03" -} \ No newline at end of file diff --git a/doc/files/019_01_04.json b/doc/files/019_01_04.json deleted file mode 100644 index b6e04430..00000000 --- a/doc/files/019_01_04.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_04", - "test_objective": "Check that you can query several entities based on attribute names", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_2", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_01_04 Query several entities based on attribute names", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_04", - "doc": "Check that you can query several entities based on attribute names", - "tags": [ - "5_7_2", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'attrs=${attributes_to_be_retrieved}'", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_01_04" -} \ No newline at end of file diff --git a/doc/files/019_02_01.json b/doc/files/019_02_01.json deleted file mode 100644 index 02569888..00000000 --- a/doc/files/019_02_01.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_01", - "test_objective": "Check that you can query several entities via POST Interaction based on ids", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_2", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_02_01 Query several entities via POST Interaction based on ids", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_01", - "doc": "Check that you can query several entities via POST Interaction based on ids", - "tags": [ - "5_7_2", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_02_01" -} \ No newline at end of file diff --git a/doc/files/019_02_03.json b/doc/files/019_02_03.json deleted file mode 100644 index 9042909e..00000000 --- a/doc/files/019_02_03.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_03", - "test_objective": "Check that you can query several entities via POST Interaction based on the given id pattern", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_2", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_02_03 Query several entities via POST Interaction based on the given id pattern", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_03", - "doc": "Check that you can query several entities via POST Interaction based on the given id pattern", - "tags": [ - "5_7_2", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'entity_id_pattern=${entity_id_pattern}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_02_03" -} \ No newline at end of file diff --git a/doc/files/019_03_01.json b/doc/files/019_03_01.json deleted file mode 100644 index 9f31585b..00000000 --- a/doc/files/019_03_01.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_01", - "test_objective": "Check that you cannot query entities if the requested ids are incorrect", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_2", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_03_01 Query entities based on incorrect ids", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_01", - "doc": "Check that you cannot query entities if the requested ids are incorrect", - "tags": [ - "5_7_2", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Response body containing 'title' element and\n Response Status Code set to 400\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_03_01" -} \ No newline at end of file diff --git a/doc/files/019_03_02.json b/doc/files/019_03_02.json deleted file mode 100644 index 3250d0df..00000000 --- a/doc/files/019_03_02.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_02", - "test_objective": "Check that you cannot query entities if the requested entity types are incorrect", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_2", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_03_02 Query entities based on incorrect entity types", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_02", - "doc": "Check that you cannot query entities if the requested entity types are incorrect", - "tags": [ - "5_7_2", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Response body containing 'title' element and\n Response Status Code set to 400\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'entity_types=${entity_types_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_03_02" -} \ No newline at end of file diff --git a/doc/files/019_03_03.json b/doc/files/019_03_03.json deleted file mode 100644 index 0d03de11..00000000 --- a/doc/files/019_03_03.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_03", - "test_objective": "Check that you cannot query entities if the requested id pattern is incorrect", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_2", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_03_03 Query several entities based on incorrect id pattern", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_03_03", - "doc": "Check that you cannot query entities if the requested id pattern is incorrect", - "tags": [ - "5_7_2", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/BadRequestData' and\n Response body containing 'title' element and\n Response Status Code set to 400\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to 'entity_id_pattern=${invalid_entity_id_pattern}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_03_03" -} \ No newline at end of file diff --git a/doc/files/019_04.json b/doc/files/019_04.json deleted file mode 100644 index 244d6875..00000000 --- a/doc/files/019_04.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_04", - "test_objective": "Check that the queried entities by Id can be returned in a simplified representation", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.7", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_6_3_7", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_04_01 Query entities in a simplified representation", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_04_01", - "doc": "Check that the queried entities by Id can be returned in a simplified representation", - "tags": [ - "6_3_7", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_04" -} \ No newline at end of file diff --git a/doc/files/019_05.json b/doc/files/019_05.json deleted file mode 100644 index 2dc50499..00000000 --- a/doc/files/019_05.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/E/019_05", - "test_objective": "Check that the queried entities by id can be returned in a geoJSON format", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 6.3.7", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_6_3_7", - "keywords": [ - "Delete Entities" - ], - "teardown": "Delete Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "019_05_01 Get an entity by id that can be returned in a geoJSON format", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_05_01", - "doc": "Check that the queried entities by id can be returned in a geoJSON format", - "tags": [ - "6_3_7", - "e-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing a list containing Entity Elements, containing ${value} provided and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Request Query Entities with entity_ids set to '${entities_ids_to_be_retrieved}' with entity_types set to '${entity_types_to_be_retrieved}", - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", - "robotfile": "019_05" -} \ No newline at end of file diff --git a/doc/files/021_02.json b/doc/files/021_02.json deleted file mode 100644 index a4c7f0eb..00000000 --- a/doc/files/021_02.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_02", - "test_objective": "Check that you can query the temporal evolution of certain attributes of entities", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_4", - "keywords": [ - "Setup Initial Entities", - "Delete Initial Entities" - ], - "teardown": "Delete Initial Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "021_02_01 Query the temporal evolution of certain attributes of entities", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_02_01", - "doc": "Check that you can query the temporal evolution of certain attributes of entities", - "tags": [ - "5_7_4", - "te-query" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-02-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}' and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Response containing:\n * Entity-Type is equal to '${entity_types_to_be_retrieved}'\n * timeRel is equal to 'after'\n * timeAt is equal to '2020-07-01T12:05:00Z'\n * Accept is equal to 'attrs=${temporal_attributes_to_be_retrieved}'", - "http_verb": "GET", - "endpoint": "temporal/entities" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", - "robotfile": "021_02" -} \ No newline at end of file diff --git a/doc/files/024_01.json b/doc/files/024_01.json deleted file mode 100644 index c66a70b3..00000000 --- a/doc/files/024_01.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_01", - "test_objective": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_7", - "keywords": [ - "Setup Initial Entities", - "Delete Initial Entities" - ], - "teardown": "Delete Initial Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "024_01_01 Retrieve Detailed Representation Of Available Entity Type Without Context", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_01_01", - "doc": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD entity type", - "tags": [ - "5_7_7", - "ed-type" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Response body containing 'title' element and\n Response Status Code set to 404\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types/{type}'\n method set to 'GET'\n Retrieve Entity Type, with type set to 'Building'", - "http_verb": "GET", - "endpoint": "types/{type}" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation", - "robotfile": "024_01" -} \ No newline at end of file diff --git a/doc/files/024_02.json b/doc/files/024_02.json deleted file mode 100644 index ebce59c0..00000000 --- a/doc/files/024_02.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02", - "test_objective": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_7", - "keywords": [ - "Setup Initial Entities", - "Delete Initial Entities" - ], - "teardown": "Delete Initial Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "024_02_01 Retrieve Detailed Representation Of Available Entity Type", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02_01", - "doc": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type", - "tags": [ - "5_7_7", - "ed-type" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing an Entity Type Info and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types/{type}'\n method set to 'GET'\n Retrieve Entity Type, with type set to 'Building', with Header['Link'] containing 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'", - "http_verb": "GET", - "endpoint": "types/{type}" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation", - "robotfile": "024_02" -} \ No newline at end of file diff --git a/doc/files/027_01.json b/doc/files/027_01.json deleted file mode 100644 index b75b35f4..00000000 --- a/doc/files/027_01.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_01", - "test_objective": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_10", - "keywords": [ - "Setup Initial Entities", - "Delete Initial Entities" - ], - "teardown": "Delete Initial Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "027_01_01 Retrieve Detailed Representation Of Available Attribute Without Context", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_01_01", - "doc": "Check that you cannot retrieve a detailed representation of an unknown NGSI-LD attribute", - "tags": [ - "5_7_10", - "ed-attr" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing the type 'https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound' and\n Response body containing 'title' element and\n Response Status Code set to 404\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to 'airQualityLevel'", - "http_verb": "GET", - "endpoint": "attributes/{attribute_name}" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation", - "robotfile": "027_01" -} \ No newline at end of file diff --git a/doc/files/027_02.json b/doc/files/027_02.json deleted file mode 100644 index 6401e71b..00000000 --- a/doc/files/027_02.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02", - "test_objective": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10", - "config_id": "", - "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_10", - "keywords": [ - "Setup Initial Entities", - "Delete Initial Entities" - ], - "teardown": "Delete Initial Entities", - "initial_condition": "with {\n the SUT in the \"initial state\"\n}", - "test_cases": [ - { - "name": "027_02_01 Retrieve Detailed Representation Of Available Attribute", - "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02_01", - "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", - "tags": [ - "5_7_10", - "ed-attr" - ], - "setup": null, - "teardown": null, - "template": null, - "then": "then {\n the SUT sends a valid Response containing:\n Response Body containing an array of Attributes and\n Response Status Code set to 200\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to 'airQualityLevel'", - "http_verb": "GET", - "endpoint": "attributes/{attribute_name}" - } - ], - "permutations": [], - "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation", - "robotfile": "027_02" -} \ No newline at end of file -- GitLab From c7fbec826a3f26914f69343d1327f392d65b9670 Mon Sep 17 00:00:00 2001 From: Giuseppe Tropea Date: Fri, 6 Oct 2023 15:52:08 +0200 Subject: [PATCH 7/7] cleared hardwired ".robot" string and len --- doc/statisticsDocumentationData.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py index 1050d2cf..e3fb0c3d 100644 --- a/doc/statisticsDocumentationData.py +++ b/doc/statisticsDocumentationData.py @@ -10,13 +10,14 @@ if __name__ == "__main__": number_of_failures = 0 number_of_all_testcases = 0 number_of_successes = 0 + ROBOT_FILE_EXTENSION = ".robot" fullpath = basedir+"/TP/NGSI-LD" for root, dirs, files in walk(fullpath): for filename in files: - if filename.endswith(".robot"): + if filename.endswith(ROBOT_FILE_EXTENSION): number_of_all_testcases += 1 - name_of_test_case = filename[:-6] + name_of_test_case = filename[:-len(ROBOT_FILE_EXTENSION)] json_of_test_case = create_json_of_robotfile(name_of_test_case, True) statistics[name_of_test_case] = dict() strippedpath = root[len(fullpath)+1:] -- GitLab