DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame^] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps |
| 3 | Library ExtendedSelenium2Library |
| 4 | Library Collections |
| 5 | Library String |
| 6 | Library StringTemplater |
| 7 | Library UUID |
| 8 | Resource vid_interface.robot |
| 9 | Resource create_vid_vnf.robot |
| 10 | Resource create_service_instance.robot |
| 11 | |
| 12 | *** Variables *** |
| 13 | ${VID_ENV} /vid |
| 14 | ${VID_SERVICE_MODELS_SEARCH_URL} ${GLOBAL_VID_SERVER}${VID_ENV}/serviceModels.htm#/instances/subdetails?selectedSubscriber=\${customer_id} |
| 15 | |
| 16 | *** Keywords *** |
| 17 | |
| 18 | Teardown VID |
| 19 | [Documentation] Teardown the VID This assumes that the any runnign stacks have been torn down |
| 20 | [Arguments] ${service_instance_id} ${lcp_region} ${tenant} |
| 21 | # Keep going to the VID service instance until all of the remove icons are goe |
| 22 | Wait Until Keyword Succeeds 300s 1s Delete VID ${service_instance_id} ${lcp_region} ${tenant} |
| 23 | |
| 24 | |
| 25 | Delete VID |
| 26 | [Documentation] Teardown the next VID entity that has a Remove icon. |
| 27 | [Arguments] ${service_instance_id} ${lcp_region} ${tenant} |
| 28 | Go To ${VID_SERVICE_MODELS_SEARCH_URL} |
| 29 | Wait Until Page Contains Please search by timeout=60s |
| 30 | Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s |
| 31 | Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s |
| 32 | |
| 33 | # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) |
| 34 | Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} |
| 35 | Click Button button=Submit |
| 36 | Wait Until Page Contains Element link=View/Edit timeout=60s |
| 37 | Click Element link=View/Edit |
| 38 | Wait Until Page Contains View/Edit Service Instance timeout=60s |
| 39 | ${status} ${data}= Run Keyword And Ignore Error Wait Until Element Is Visible xpath=//li/div/a/span[@class='glyphicon glyphicon-remove'] timeout=120s |
| 40 | Return From Keyword If '${status}' == 'FAIL' |
| 41 | |
| 42 | # At least one more Remove! |
| 43 | |
| 44 | # This list is a bit ogf a hack to determine the order of removal if there is more than one remove icon. |
| 45 | # Cannot tell how this will hold up once all of the VID removes are working for all conditions. |
| 46 | ${remove_order}= Create List Vfmodule_Ete |
| 47 | :for ${remove_first} in @{remove_order} |
| 48 | \ ${status} ${data}= Run Keyword And Ignore Error Page Should Contain Element xpath=//li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove'] |
| 49 | \ Run Keyword If '${status}' == 'PASS' Click On Element When Visible xpath=//li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove'] timeout=120s |
| 50 | \ Run Keyword If '${status}' == 'FAIL' Click On Element When Visible xpath=//li/div/a/span[@class='glyphicon glyphicon-remove'] timeout=120s |
| 51 | |
| 52 | Wait Until Page Contains Element xpath=//select[@parameter-id='lcpRegion'] |
| 53 | Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} |
| 54 | Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} |
| 55 | Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true'] |
| 56 | #//*[@id="mContent"]/div/div/div/div/table/tbody/tr/td/div/div[2]/div/div[1]/div[5]/button[1] |
| 57 | Wait Until Page Contains Status:COMPLETE - 300s |
| 58 | ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] |
| 59 | ${request_id}= Parse Request Id ${response text} |
| 60 | Click Element button=Close |
| 61 | Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE |
| 62 | Fail Successful VID Delete - continue with next delete |
| 63 | |