blob: b57cd1d44b5875aff47b9de6991c61c99fd034e6 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with VID. It handles low level stuff like managing the selenium request library and VID required steps
3Library ExtendedSelenium2Library
4Library Collections
5Library String
6Library StringTemplater
Jerry Floodf67ce0e2017-03-20 16:59:23 -04007Library UUID
DR695Hccff30b2017-02-17 18:44:24 -05008Resource vid_interface.robot
9Resource create_vid_vnf.robot
10Resource create_service_instance.robot
11
12*** Variables ***
13${VID_ENV} /vid
jf986075010a42017-02-22 16:52:54 -050014${VID_SERVICE_MODELS_SEARCH_CUST} ${GLOBAL_VID_SERVER}${VID_ENV}/serviceModels.htm#/instances/subdetails?selectedSubscriber=\${customer_id}
15${VID_SERVICE_MODELS_SEARCH_URL} ${GLOBAL_VID_SERVER}${VID_ENV}/serviceModels.htm#/instances/services
DR695Hccff30b2017-02-17 18:44:24 -050016*** Keywords ***
Jerry Floodf67ce0e2017-03-20 16:59:23 -040017
18Teardown VID
DR695Hccff30b2017-02-17 18:44:24 -050019 [Documentation] Teardown the VID This assumes that the any runnign stacks have been torn down
Jerry Floodf67ce0e2017-03-20 16:59:23 -040020 [Arguments] ${service_instance_id} ${lcp_region} ${tenant}
21 Return From Keyword If len('${service_instance_id}') == 0
jf986075010a42017-02-22 16:52:54 -050022 # Keep going to the VID service instance until we get the pop-up alert that there is no service instance
DR695Hccff30b2017-02-17 18:44:24 -050023 Wait Until Keyword Succeeds 300s 1s Delete VID ${service_instance_id} ${lcp_region} ${tenant}
DR695Hccff30b2017-02-17 18:44:24 -050024
Jerry Floodf67ce0e2017-03-20 16:59:23 -040025
26Delete VID
DR695Hccff30b2017-02-17 18:44:24 -050027 [Documentation] Teardown the next VID entity that has a Remove icon.
jf986075010a42017-02-22 16:52:54 -050028 [Arguments] ${service_instance_id} ${lcp_region} ${tenant}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040029 # For vLB closed loop, we may have 2 vf modules and the vDNS one needs to be removed first.
jf986075010a42017-02-22 16:52:54 -050030 ${remove_order}= Create List vDNS_Ete Vfmodule_Ete
Jerry Floodf67ce0e2017-03-20 16:59:23 -040031
jf986075010a42017-02-22 16:52:54 -050032 # FAIL status is returned in ${vfmodule} because FAIL are ignored during teardown
33 ${status} ${vfmodule}= Run Keyword and Ignore Error Delete Next VID Entity ${service_instance_id} ${lcp_region} ${tenant} ${remove_order}
34 Return From Keyword If '${status}' == 'FAIL'
35 Return From Keyword If '${vfmodule}' == 'FAIL'
36 # After tearing down a VF module, execute the reverse HB for it to remove the references from A&AI
37 Run Keyword If 'Vfmodule_Ete' in '${vfmodule}' Execute Reverse Heatbridge
38 Fail Continue with Next Remove
39
Jerry Floodf67ce0e2017-03-20 16:59:23 -040040Delete Next VID Entity
jf986075010a42017-02-22 16:52:54 -050041 [Documentation] Teardown the next VID entity that has a Remove icon.
Jerry Floodf67ce0e2017-03-20 16:59:23 -040042 [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${remove_order}
jf986075010a42017-02-22 16:52:54 -050043 ${vfmodule}= Catenate
DR695Hccff30b2017-02-17 18:44:24 -050044 Go To ${VID_SERVICE_MODELS_SEARCH_URL}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040045 Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
46 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
47 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
48
49 # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
DR695Hccff30b2017-02-17 18:44:24 -050050 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
jf986075010a42017-02-22 16:52:54 -050051
52 # When Handle alert detects a pop-up. it will return FAIL and we are done
53 # Return from Keyword is required because FAIL is inored during teardown
54 ${status} ${value} Run Keyword And Ignore Error Handle Alert
55 Return From Keyword If '${status}' == 'FAIL' ${status}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040056 ${status} ${value} Run Keyword And Ignore Error Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986075010a42017-02-22 16:52:54 -050057 Return From Keyword If '${status}' == 'FAIL' ${status}
58
59
Jerry Floodf67ce0e2017-03-20 16:59:23 -040060 Click Element link=View/Edit
61 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
62 Wait Until Element Is Visible xpath=//a/span[@class='glyphicon glyphicon-remove'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
63
64 :for ${remove_first} in @{remove_order}
jf986075010a42017-02-22 16:52:54 -050065 \ ${remove_xpath}= Set Variable //li/div[contains(.,'${remove_first}')]/a/span[@class='glyphicon glyphicon-remove']
66 \ ${status} ${data}= Run Keyword And Ignore Error Page Should Contain Element xpath=${remove_xpath}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040067 \ Exit For Loop If '${status}' == 'PASS'
jf986075010a42017-02-22 16:52:54 -050068 \ ${remove_xpath}= Set Variable //li/div/a/span[@class='glyphicon glyphicon-remove']
Jerry Floodf67ce0e2017-03-20 16:59:23 -040069 Click On Element When Visible xpath=${remove_xpath}
DR695Hccff30b2017-02-17 18:44:24 -050070
jf986075010a42017-02-22 16:52:54 -050071 ${status} ${value}= Run Keyword and Ignore Error Wait Until Page Contains Element xpath=//select[@parameter-id='lcpRegion']
Jerry Floodf67ce0e2017-03-20 16:59:23 -040072 Run Keyword If '${status}'=='PASS' Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
jf986075010a42017-02-22 16:52:54 -050073 Run Keyword If '${status}'=='PASS' Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040074 ${status} ${vfmodule}= Run Keyword And Ignore Error Get Text xpath=//td[contains(text(), 'Vf Module Name')]/../td[2]
DR695Hccff30b2017-02-17 18:44:24 -050075 Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true']
76 #//*[@id="mContent"]/div/div/div/div/table/tbody/tr/td/div/div[2]/div/div[1]/div[5]/button[1]
jf986075010a42017-02-22 16:52:54 -050077 Wait Until Page Contains 100 % 300s
DR695Hccff30b2017-02-17 18:44:24 -050078 ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
79 ${request_id}= Parse Request Id ${response text}
jf986075010a42017-02-22 16:52:54 -050080 Click Element xpath=//div[@class='ng-scope']/div[@class = 'buttonRow']/button[text() = 'Close']
DR695Hccff30b2017-02-17 18:44:24 -050081 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
jf986075010a42017-02-22 16:52:54 -050082 [Return] ${vfmodule}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040083
jf986075010a42017-02-22 16:52:54 -050084Handle Alert
85 [Documentation] When service instance has been deleted, an alert will be triggered on the search to end the loop
86 ... The various Alert keywords did not prevent the alert exception on the Click ELement, hence this roundabout way of handling the alert
Jerry Floodf67ce0e2017-03-20 16:59:23 -040087 Run Keyword And Ignore Error Click Element button=Submit
jf986075010a42017-02-22 16:52:54 -050088 ${status} ${t}= Run Keyword And Ignore Error Get Alert Message
Jerry Floodf67ce0e2017-03-20 16:59:23 -040089 Return From Keyword If '${status}' == 'FAIL'
jf986075010a42017-02-22 16:52:54 -050090 Fail ${t}