blob: 41737627de1f2a4912c29fbb0fe67245de3b3bd0 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation Creates VID VNF Instance
3
4Library ExtendedSelenium2Library 60
5Library UUID
6Library String
7Library DateTime
8Library RequestsLibrary
9
10Resource ../mso_interface.robot
11Resource vid_interface.robot
jf986099c63292017-03-09 15:28:42 -050012
13*** Keywords ***
14
DR695Hccff30b2017-02-17 18:44:24 -050015Create VID VNF
jf986099c63292017-03-09 15:28:42 -050016 [Documentation] Creates a VNF instance using VID for passed instance id with the passed service instance name
Jerry Flood81d33fb2017-11-21 16:21:21 -050017 [Arguments] ${service_instance_id} ${service_instance_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} ${customer}
DR695Hccff30b2017-02-17 18:44:24 -050018 Go To VID HOME
19 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
Jerry Floodf67ce0e2017-03-20 16:59:23 -040020 Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050021
22 # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
Jerry Flood81d33fb2017-11-21 16:21:21 -050023 #Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
24 #Select From List By Label //select[@ng-model='selectedserviceinstancetype'] Service Instance Id
25 Select From List By Label //select[@ng-model='selectedCustomer'] ${customer}
DR695Hccff30b2017-02-17 18:44:24 -050026 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040027 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050028 Click Element xpath=//a[contains(text(), 'View/Edit')]
Jerry Floodf67ce0e2017-03-20 16:59:23 -040029 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
DR695Hccff30b2017-02-17 18:44:24 -050030 Click Element button=Add VNF
Jerry Flood81d33fb2017-11-21 16:21:21 -050031 #01681d02-2304-4c91-ab2d 0
DR695Hccff30b2017-02-17 18:44:24 -050032 # This is where firefox breaks. Th elink never becomes visible when run with the script.
Jerry Flood81d33fb2017-11-21 16:21:21 -050033 ${dataTestsId}= Catenate AddVNFOption-${vnf_type}
34 Click Element xpath=//a[contains(text(), '${vnf_type}')]
Jerry Floodf67ce0e2017-03-20 16:59:23 -040035 Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
36 Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
jf986099c63292017-03-09 15:28:42 -050037
38 ## Without this sleep, the input text below gets immediately wiped out.
DR695Hccff30b2017-02-17 18:44:24 -050039 ## Wait Until Angular Ready just sleeps for its timeout value
40 Sleep 10s
41 Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name}
jf986099c63292017-03-09 15:28:42 -050042 Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family}
43 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
44 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
DR695Hccff30b2017-02-17 18:44:24 -050045 Click Element button=Confirm
Jerry Flood81d33fb2017-11-21 16:21:21 -050046 Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
DR695Hccff30b2017-02-17 18:44:24 -050047 ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
jf986099c63292017-03-09 15:28:42 -050048 Should Not Contain ${response text} FAILED
DR695Hccff30b2017-02-17 18:44:24 -050049 Click Element button=Close
50 ${instance_id}= Parse Instance Id ${response text}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040051 Wait Until Page Contains ${service_instance_name} ${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050052 [Return] ${instance_id}
DR695Hccff30b2017-02-17 18:44:24 -050053
jf986099c63292017-03-09 15:28:42 -050054Delete VID VNF
55 [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id}
DR695Hccff30b2017-02-17 18:44:24 -050056 Go To VID HOME
57 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
58 Wait Until Page Contains Please search by timeout=60s
Jerry Floodf67ce0e2017-03-20 16:59:23 -040059 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
60 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050061
62 # 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 -050063 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
64 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040065 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050066 Click Element link=View/Edit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040067 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
68 Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
69 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
DR695Hccff30b2017-02-17 18:44:24 -050070
jf986099c63292017-03-09 15:28:42 -050071
72
Jerry Floodf67ce0e2017-03-20 16:59:23 -040073 Click On Element When Visible xpath=//li/div[contains(.,'${vnf_instance_id}')]/a/span[@class='glyphicon glyphicon-remove'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
jf986099c63292017-03-09 15:28:42 -050074 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
75 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
DR695Hccff30b2017-02-17 18:44:24 -050076 Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true']
77 #//*[@id="mContent"]/div/div/div/div/table/tbody/tr/td/div/div[2]/div/div[1]/div[5]/button[1]
jf986099c63292017-03-09 15:28:42 -050078
DR695Hccff30b2017-02-17 18:44:24 -050079 ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
80 ${request_id}= Parse Request Id ${response text}
81 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
jf986099c63292017-03-09 15:28:42 -050082
83Create VID VNF module
Jerry Flood3a169a32017-12-01 12:39:10 -050084 [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE} ${customer} ${vnf_name}
DR695Hccff30b2017-02-17 18:44:24 -050085 Go To VID HOME
86 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
Jerry Floodf67ce0e2017-03-20 16:59:23 -040087 Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
88 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050089
90 # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
Jerry Flood81d33fb2017-11-21 16:21:21 -050091 Select From List By Label //select[@ng-model='selectedCustomer'] ${customer}
92 ###Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
DR695Hccff30b2017-02-17 18:44:24 -050093 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040094 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050095 Click Element link=View/Edit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040096 Wait Until Keyword Succeeds 300s 5s Wait For Add VF Module
97 #Wait Until Page Contains View/Edit Service Instance timeout=60s
98 #Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s
99 #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=120s
100 #Wait Until Element Is Visible button=Add VF-Module timeout=120s
Jerry Flood3a169a32017-12-01 12:39:10 -0500101 Click Element xpath=//div[contains(.,'${vnf_name}')]/div/button[contains(.,'Add VF-Module')]
jf986099c63292017-03-09 15:28:42 -0500102
DR695Hccff30b2017-02-17 18:44:24 -0500103 # This is where firefox breaks. Th elink never becomes visible when run with the script.
104 Click Element link=${vnf_type}
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400105 Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
106 Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
jf986099c63292017-03-09 15:28:42 -0500107
108 ## Without this sleep, the input text below gets immediately wiped out.
DR695Hccff30b2017-02-17 18:44:24 -0500109 ## Wait Until Angular Ready just sleeps for its timeout value
110 Sleep 10s
jf986099c63292017-03-09 15:28:42 -0500111 Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name}
112 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
113 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
Jerry Flood81d33fb2017-11-21 16:21:21 -0500114 Select Checkbox xpath=//input[@parameter-id='sdncPreload']
DR695Hccff30b2017-02-17 18:44:24 -0500115 Click Element button=Confirm
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400116 Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
jf986099c63292017-03-09 15:28:42 -0500117 ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
DR695Hccff30b2017-02-17 18:44:24 -0500118 Click Element button=Close
119 ${instance_id}= Parse Instance Id ${response text}
jf986099c63292017-03-09 15:28:42 -0500120
DR695Hccff30b2017-02-17 18:44:24 -0500121 ${request_id}= Parse Request Id ${response text}
122 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
jf986099c63292017-03-09 15:28:42 -0500123
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400124 [Return] ${instance_id}
125
126Wait For Add VF Module
127 [Documentation] Retry by refresh if the ADD VF-Module is not visible
128 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
129 Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
130 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
131 ${status} ${value} Run Keyword And Ignore Error Wait Until Element Is Visible button=Add VF-Module timeout=${GLOBAL_VID_UI_TIMEOUT_SHORT}
132 Return From Keyword If '${status}' == 'PASS'
133 Reload Page
134 Fail Retry