diff options
author | DR695H <dr695h@att.com> | 2019-05-08 13:55:32 -0400 |
---|---|---|
committer | DR695H <dr695h@att.com> | 2019-05-09 10:41:52 -0400 |
commit | 910097ed0b1f7922715bfead98d3be6809fe2479 (patch) | |
tree | b8700a356eaeb81f38d34a186ce0e4dbb879c790 /robot/resources/vid | |
parent | c5febc8b6264a08484b23ababec8f912cdd8f70d (diff) |
upgrade to python3 libraries
basing the code off of robot framework 3.1.1 instead of 3.0, replacing
selenium2lib with selnium lib and selenium3, replacing extendedselenium
with angularjs lib. Fixing most warnings and all errors from these moves
Change-Id: Ifed68c5b8cd28c7bbdc80ee7245860914bdee5b4
Issue-ID: TEST-151
Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robot/resources/vid')
-rw-r--r-- | robot/resources/vid/create_service_instance.robot | 6 | ||||
-rw-r--r-- | robot/resources/vid/create_vid_vnf.robot | 2 | ||||
-rw-r--r-- | robot/resources/vid/teardown_vid.robot | 13 | ||||
-rw-r--r-- | robot/resources/vid/vid_interface.robot | 8 |
4 files changed, 15 insertions, 14 deletions
diff --git a/robot/resources/vid/create_service_instance.robot b/robot/resources/vid/create_service_instance.robot index 719b85d6..112da109 100644 --- a/robot/resources/vid/create_service_instance.robot +++ b/robot/resources/vid/create_service_instance.robot @@ -3,7 +3,7 @@ Documentation Creates VID Service Instance ... ... Creates VID Service Instance -Library ExtendedSelenium2Library +Library SeleniumLibrary Library UUID Library String Library DateTime @@ -26,8 +26,8 @@ Create VID Service Instance Select From List When Enabled //select[@prompt='Select Project Name'] ${project_name} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} Select From List When Enabled //select[@prompt='Select Owning Entity'] ${owning_entity} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} Capture Page Screenshot - Xpath Should Match X Times //input[@parameter-name='Instance Name'] 1 - Focus //input[@parameter-name='Instance Name'] + Page Should Contain Element //input[@parameter-name='Instance Name'] limit=1 + Set Focus To Element //input[@parameter-name='Instance Name'] Wait Until Keyword Succeeds 120s 5s Input Text When Enabled //input[@parameter-name='Instance Name'] ${service_name} timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} Capture Page Screenshot Click On Button When Enabled //div[@class = 'buttonRow']/button[text() = 'Confirm'] diff --git a/robot/resources/vid/create_vid_vnf.robot b/robot/resources/vid/create_vid_vnf.robot index eaca637d..07de71dd 100644 --- a/robot/resources/vid/create_vid_vnf.robot +++ b/robot/resources/vid/create_vid_vnf.robot @@ -1,7 +1,7 @@ *** Settings *** Documentation Creates VID VNF Instance -Library ExtendedSelenium2Library 60 +Library SeleniumLibrary 60 Library UUID Library String Library DateTime diff --git a/robot/resources/vid/teardown_vid.robot b/robot/resources/vid/teardown_vid.robot index e1850bf6..80365a32 100644 --- a/robot/resources/vid/teardown_vid.robot +++ b/robot/resources/vid/teardown_vid.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps -Library ExtendedSelenium2Library +Library SeleniumLibrary Library Collections Library String Library StringTemplater @@ -8,6 +8,7 @@ Library UUID Resource vid_interface.robot Resource create_vid_vnf.robot Resource create_service_instance.robot +Resource ../heatbridge.robot *** Variables *** ${VID_ENV} /vid @@ -54,10 +55,10 @@ Delete Next VID Entity Select From List By Label //select[@ng-model='selectedCustomer'] ${customer} Click Button button=Submit - # When Handle alert detects a pop-up. it will return FAIL and we are done + # When Handle VID Alert detects a pop-up. it will return FAIL and we are done # Return from Keyword is required because FAIL is inored during teardown Set Test Variable ${TEARDOWN_STATUS} PASS - ${status} ${value} Run Keyword And Ignore Error Handle Alert + ${status} ${value} Run Keyword And Ignore Error Handle VID Alert Return From Keyword If '${status}' == 'FAIL' ${status} ${status} ${value} Run Keyword And Ignore Error Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} Return From Keyword If '${status}' == 'FAIL' ${status} @@ -68,7 +69,7 @@ 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} + :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' @@ -88,10 +89,10 @@ Delete Next VID Entity Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE [Return] ${vfmodule} -Handle Alert +Handle VID Alert [Documentation] When service instance has been deleted, an alert will be triggered on the search to end the loop ... The various Alert keywords did not prevent the alert exception on the Click ELement, hence this roundabout way of handling the alert Run Keyword And Ignore Error Click Element button=Submit - ${status} ${t}= Run Keyword And Ignore Error Get Alert Message + ${status} ${t}= Run Keyword And Ignore Error Handle Alert Return From Keyword If '${status}' == 'FAIL' Fail ${t} diff --git a/robot/resources/vid/vid_interface.robot b/robot/resources/vid/vid_interface.robot index 47cb7860..dd68ede8 100644 --- a/robot/resources/vid/vid_interface.robot +++ b/robot/resources/vid/vid_interface.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps -Library ExtendedSelenium2Library +Library SeleniumLibrary Library Collections Library String Library RequestsLibrary @@ -110,7 +110,7 @@ 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} + :FOR ${dict} IN @{services} \ ${uuid}= Get From DIctionary ${dict} uuid \ ${inv}= Get From DIctionary ${dict} invariantUUID \ Return From Keyword If "${invariantUUID}" == "${inv}" ${uuid} @@ -128,7 +128,7 @@ Get Module Names from VID ${modules}= Create List ${vnfs}= Get From Dictionary ${json} vnfs ${keys}= Get Dictionary Keys ${vnfs} - :for ${key} in @{keys} + :FOR ${key} IN @{keys} \ Add VFModule ${vnfs['${key}']} ${modules} [Return] ${modules} @@ -137,7 +137,7 @@ Add VFModule [Arguments] ${vnf} ${modules} ${vfModules}= Get From Dictionary ${vnf} vfModules ${keys}= Get Dictionary Keys ${vfModules} - :for ${key} in @{keys} + :FOR ${key} IN @{keys} \ ${module}= Get From Dictionary ${vfModules} ${key} \ ${dict}= Create Dictionary name=${module['name']} \ Append to List ${modules} ${dict} |