summaryrefslogtreecommitdiffstats
path: root/csit/tests/cps-data-operations
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2024-08-14 15:02:45 +0100
committermpriyank <priyank.maheshwari@est.tech>2024-08-15 15:49:49 +0100
commita4a559133591b5204ec0c16f61da9d45f139390d (patch)
tree94ca8299691228e1c38b0c1fa622b6eadc6f70d7 /csit/tests/cps-data-operations
parent48ee3f5ef9d78bfd7b01995293725913c20a37d8 (diff)
Rearrange CSIT test order
- Waiting for Cmhandle to be ready before fetching the modules in the CSIT. - Added condition to check size of the json array if it atleast has one item Issue-ID: CPS-2313 Change-Id: Ib4f08069780c55a758ba976db5b96239c83ac990 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'csit/tests/cps-data-operations')
-rw-r--r--csit/tests/cps-data-operations/cps-data-operations.robot9
1 files changed, 9 insertions, 0 deletions
diff --git a/csit/tests/cps-data-operations/cps-data-operations.robot b/csit/tests/cps-data-operations/cps-data-operations.robot
index 85e8a2a857..8f1d71aa7b 100644
--- a/csit/tests/cps-data-operations/cps-data-operations.robot
+++ b/csit/tests/cps-data-operations/cps-data-operations.robot
@@ -26,6 +26,7 @@ Library OperatingSystem
Library RequestsLibrary
Library BuiltIn
Library ConfluentKafkaLibrary
+Library String
Suite Setup Create Session CPS_URL http://${CPS_CORE_HOST}:${CPS_CORE_PORT}
@@ -79,12 +80,20 @@ Is CM Handle READY
[Arguments] ${uri} ${headers} ${cmHandle}
${response}= GET On Session CPS_URL ${uri} headers=${headers}
Should Be Equal As Strings ${response.status_code} 200
+ ${number_of_items}= Count Items In JSON Response ${response}
+ Should Be True ${number_of_items} > 0
FOR ${item} IN ${response.json()}
IF "${item['cmHandle']}" == "${cmHandle}"
Should Be Equal As Strings ${item['state']['cmHandleState']} READY
END
END
+Count Items In JSON Response
+ [Arguments] ${response}
+ ${json_data}= Evaluate json.loads('${response.content.decode("utf-8")}') json
+ ${number_of_items}= Get Length ${json_data}
+ RETURN ${number_of_items}
+
Basic Teardown
[Arguments] ${group_id}
Unsubscribe ${group_id}