From 69fd079507e6a4500c2117b7dad31fa81b7e1299 Mon Sep 17 00:00:00 2001 From: Andreas Geissler Date: Tue, 5 Nov 2024 18:22:30 +0100 Subject: Update deprecated :FOR loops Update SDNC APIs Issue-ID: OOM-3301 Signed-off-by: Andreas Geissler Change-Id: I515e503abef90f3aaa3733d7518d6e738173100e --- robot/resources/vid/teardown_vid.robot | 11 ++++++----- robot/resources/vid/vid_interface.robot | 23 +++++++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) (limited to 'robot/resources/vid') diff --git a/robot/resources/vid/teardown_vid.robot b/robot/resources/vid/teardown_vid.robot index 23217704..c5fb6d41 100644 --- a/robot/resources/vid/teardown_vid.robot +++ b/robot/resources/vid/teardown_vid.robot @@ -64,11 +64,12 @@ Delete Next VID Entity Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} Wait Until Element Is Visible xpath=//a/span[@class='glyphicon glyphicon-remove'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} - :FOR ${remove_first} IN @{remove_order} - \ ${remove_xpath}= Set Variable //li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove'] - \ ${status} ${data}= Run Keyword And Ignore Error Page Should Contain Element xpath=${remove_xpath} - \ Exit For Loop If '${status}' == 'PASS' - \ ${remove_xpath}= Set Variable //li/div/a/span[@class='glyphicon glyphicon-remove'] + FOR ${remove_first} IN @{remove_order} + ${remove_xpath}= Set Variable //li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove'] + ${status} ${data}= Run Keyword And Ignore Error Page Should Contain Element xpath=${remove_xpath} + Exit For Loop If '${status}' == 'PASS' + ${remove_xpath}= Set Variable //li/div/a/span[@class='glyphicon glyphicon-remove'] + END Click On Element When Visible xpath=${remove_xpath} ${status} ${value}= Run Keyword and Ignore Error Wait Until Page Contains Element xpath=//select[@parameter-id='lcpRegion'] diff --git a/robot/resources/vid/vid_interface.robot b/robot/resources/vid/vid_interface.robot index 58ba0e56..00558fdc 100644 --- a/robot/resources/vid/vid_interface.robot +++ b/robot/resources/vid/vid_interface.robot @@ -115,10 +115,11 @@ Get Model UUID from VID ${resp}= Get Text xpath=//body/pre ${json}= To Json ${resp} ${services}= Get From Dictionary ${json} services - :FOR ${dict} IN @{services} - \ ${uuid}= Get From DIctionary ${dict} uuid - \ ${inv}= Get From DIctionary ${dict} invariantUUID - \ Return From Keyword If "${invariantUUID}" == "${inv}" ${uuid} + FOR ${dict} IN @{services} + ${uuid}= Get From DIctionary ${dict} uuid + ${inv}= Get From DIctionary ${dict} invariantUUID + Return From Keyword If "${invariantUUID}" == "${inv}" ${uuid} + END [Return] "" @@ -133,8 +134,9 @@ Get Module Names from VID ${modules}= Create List ${vnfs}= Get From Dictionary ${json} vnfs ${keys}= Get Dictionary Keys ${vnfs} - :FOR ${key} IN @{keys} - \ Add VFModule ${vnfs['${key}']} ${modules} + FOR ${key} IN @{keys} + Add VFModule ${vnfs['${key}']} ${modules} + END [Return] ${modules} Add VFModule @@ -142,7 +144,8 @@ Add VFModule [Arguments] ${vnf} ${modules} ${vfModules}= Get From Dictionary ${vnf} vfModules ${keys}= Get Dictionary Keys ${vfModules} - :FOR ${key} IN @{keys} - \ ${module}= Get From Dictionary ${vfModules} ${key} - \ ${dict}= Create Dictionary name=${module['name']} - \ Append to List ${modules} ${dict} + FOR ${key} IN @{keys} + ${module}= Get From Dictionary ${vfModules} ${key} + ${dict}= Create Dictionary name=${module['name']} + Append to List ${modules} ${dict} + END \ No newline at end of file -- cgit 1.2.3-korg