blob: 88408546d5e8281e976346a63b1b6c15fbb807d3 [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
7Library UUID
8Resource 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 ***
17
18Teardown VID
19 [Documentation] Teardown the VID This assumes that the any runnign stacks have been torn down
jf986075010a42017-02-22 16:52:54 -050020 [Arguments] ${service_instance_id} ${lcp_region} ${tenant}
21 Return From Keyword If len('${service_instance_id}') == 0
22 # 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}
24
25
26Delete VID
27 [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}
29 # For vLB closed loop, we may have 2 vf modules and the vDNS one needs to be removed first.
30 ${remove_order}= Create List vDNS_Ete Vfmodule_Ete
31
32 # 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
40Delete Next VID Entity
41 [Documentation] Teardown the next VID entity that has a Remove icon.
42 [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${remove_order}
43 ${vfmodule}= Catenate
DR695Hccff30b2017-02-17 18:44:24 -050044 Go To ${VID_SERVICE_MODELS_SEARCH_URL}
45 Wait Until Page Contains Please search by timeout=60s
46 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s
47 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s
48
49 # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
50 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}
56 ${status} ${value} Run Keyword And Ignore Error Wait Until Page Contains Element link=View/Edit timeout=60s
57 Return From Keyword If '${status}' == 'FAIL' ${status}
58
59
DR695Hccff30b2017-02-17 18:44:24 -050060 Click Element link=View/Edit
61 Wait Until Page Contains View/Edit Service Instance timeout=60s
jf986075010a42017-02-22 16:52:54 -050062 Wait Until Element Is Visible xpath=//a/span[@class='glyphicon glyphicon-remove'] timeout=120s
DR695Hccff30b2017-02-17 18:44:24 -050063
DR695Hccff30b2017-02-17 18:44:24 -050064 :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}
67 \ Exit For Loop If '${status}' == 'PASS'
68 \ ${remove_xpath}= Set Variable //li/div/a/span[@class='glyphicon glyphicon-remove']
69 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']
72 Run Keyword If '${status}'=='PASS' Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
73 Run Keyword If '${status}'=='PASS' Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
74 ${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}
DR695Hccff30b2017-02-17 18:44:24 -050083
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
87 Run Keyword And Ignore Error Click Element button=Submit
88 ${status} ${t}= Run Keyword And Ignore Error Get Alert Message
89 Return From Keyword If '${status}' == 'FAIL'
90 Fail ${t}
91