Cps Data csit enhanced 86/137186/1
authormpriyank <priyank.maheshwari@est.tech>
Thu, 8 Feb 2024 11:42:53 +0000 (11:42 +0000)
committermpriyank <priyank.maheshwari@est.tech>
Thu, 8 Feb 2024 11:42:58 +0000 (11:42 +0000)
- instead of relying on the sequence of elements , using the contains
  operation to assert the result

Issue-ID: CPS-2075
Change-Id: Ifbd3c601cc48148d0c4d7ce47301dbfb5184e1de
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
csit/tests/cps-data/cps-data.robot

index 61ab3dc..bcab3a6 100644 (file)
@@ -57,7 +57,12 @@ Get Updated Data Node by XPath
     ${response}=        Get On Session      CPS_URL   ${uri}   params=${params}   headers=${headers}   expected_status=200
     ${responseJson}=    Set Variable        ${response.json()['tree:nest']}
     Should Be Equal As Strings              ${responseJson['name']}   Bigger
-    Should Be Equal As Strings              ${responseJson['birds']}   ['Pigeon', 'Falcon', 'Eagle']
+    ${length_birds}=    Get Length          ${responseJson['birds']}
+    Should Be Equal As Integers             ${length_birds}   3
+    ${expected_list}=         Create List   Pigeon   Falcon   Eagle
+    FOR      ${item_to_check}     IN      @{expected_list}
+        Should Contain     ${responseJson['birds']}     ${item_to_check}
+    END
 
 Get Data Node by XPath
     ${uri}=             Set Variable        ${basePath}/v1/dataspaces/${dataspaceName}/anchors/${anchorName}/node