blob: 371ad7083fb59723cb64d2e86834645cd11d6f3b [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
17 [Arguments] ${service_instance_id} ${service_instance_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type}
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)
DR695Hccff30b2017-02-17 18:44:24 -050023 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
24 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040025 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050026 Click Element xpath=//a[contains(text(), 'View/Edit')]
Jerry Floodf67ce0e2017-03-20 16:59:23 -040027 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
DR695Hccff30b2017-02-17 18:44:24 -050028 Click Element button=Add VNF
jf986099c63292017-03-09 15:28:42 -050029
DR695Hccff30b2017-02-17 18:44:24 -050030 # This is where firefox breaks. Th elink never becomes visible when run with the script.
31 Click Element link=${vnf_type}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040032 Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
33 Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
jf986099c63292017-03-09 15:28:42 -050034
35 ## Without this sleep, the input text below gets immediately wiped out.
DR695Hccff30b2017-02-17 18:44:24 -050036 ## Wait Until Angular Ready just sleeps for its timeout value
37 Sleep 10s
38 Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name}
jf986099c63292017-03-09 15:28:42 -050039 Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family}
40 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
41 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
DR695Hccff30b2017-02-17 18:44:24 -050042 Click Element button=Confirm
Jerry Floodf67ce0e2017-03-20 16:59:23 -040043 Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] Status: OK (200) timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
DR695Hccff30b2017-02-17 18:44:24 -050044 ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
jf986099c63292017-03-09 15:28:42 -050045 Should Not Contain ${response text} FAILED
DR695Hccff30b2017-02-17 18:44:24 -050046 Click Element button=Close
47 ${instance_id}= Parse Instance Id ${response text}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040048 Wait Until Page Contains ${service_instance_name} ${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050049 [Return] ${instance_id}
DR695Hccff30b2017-02-17 18:44:24 -050050
jf986099c63292017-03-09 15:28:42 -050051Delete VID VNF
52 [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id}
DR695Hccff30b2017-02-17 18:44:24 -050053 Go To VID HOME
54 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
55 Wait Until Page Contains Please search by timeout=60s
Jerry Floodf67ce0e2017-03-20 16:59:23 -040056 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
57 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050058
59 # 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 -050060 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
61 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040062 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050063 Click Element link=View/Edit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040064 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
65 Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
66 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
DR695Hccff30b2017-02-17 18:44:24 -050067
jf986099c63292017-03-09 15:28:42 -050068
69
Jerry Floodf67ce0e2017-03-20 16:59:23 -040070 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 -050071 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
72 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
DR695Hccff30b2017-02-17 18:44:24 -050073 Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true']
74 #//*[@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 -050075
DR695Hccff30b2017-02-17 18:44:24 -050076 ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
77 ${request_id}= Parse Request Id ${response text}
78 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
jf986099c63292017-03-09 15:28:42 -050079
80Create VID VNF module
81 [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE}
DR695Hccff30b2017-02-17 18:44:24 -050082 Go To VID HOME
83 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
Jerry Floodf67ce0e2017-03-20 16:59:23 -040084 Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
85 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050086
87 # 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 -050088 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
89 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040090 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050091 Click Element link=View/Edit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040092 Wait Until Keyword Succeeds 300s 5s Wait For Add VF Module
93 #Wait Until Page Contains View/Edit Service Instance timeout=60s
94 #Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s
95 #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=120s
96 #Wait Until Element Is Visible button=Add VF-Module timeout=120s
DR695Hccff30b2017-02-17 18:44:24 -050097 Click Element button=Add VF-Module
jf986099c63292017-03-09 15:28:42 -050098
DR695Hccff30b2017-02-17 18:44:24 -050099 # This is where firefox breaks. Th elink never becomes visible when run with the script.
100 Click Element link=${vnf_type}
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400101 Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
102 Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
jf986099c63292017-03-09 15:28:42 -0500103
104 ## Without this sleep, the input text below gets immediately wiped out.
DR695Hccff30b2017-02-17 18:44:24 -0500105 ## Wait Until Angular Ready just sleeps for its timeout value
106 Sleep 10s
jf986099c63292017-03-09 15:28:42 -0500107 Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name}
108 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
109 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
DR695Hccff30b2017-02-17 18:44:24 -0500110 Click Element button=Confirm
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400111 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 -0500112 ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
DR695Hccff30b2017-02-17 18:44:24 -0500113 Click Element button=Close
114 ${instance_id}= Parse Instance Id ${response text}
jf986099c63292017-03-09 15:28:42 -0500115
DR695Hccff30b2017-02-17 18:44:24 -0500116 ${request_id}= Parse Request Id ${response text}
117 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
jf986099c63292017-03-09 15:28:42 -0500118
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400119 [Return] ${instance_id}
120
121Wait For Add VF Module
122 [Documentation] Retry by refresh if the ADD VF-Module is not visible
123 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
124 Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
125 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
126 ${status} ${value} Run Keyword And Ignore Error Wait Until Element Is Visible button=Add VF-Module timeout=${GLOBAL_VID_UI_TIMEOUT_SHORT}
127 Return From Keyword If '${status}' == 'PASS'
128 Reload Page
129 Fail Retry