blob: ea3cf1233ecf73c1420602de029daab23a0a0d66 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation Creates VID VNF Instance
3
DR695H910097e2019-05-08 13:55:32 -04004Library SeleniumLibrary 60
DR695Hccff30b2017-02-17 18:44:24 -05005Library String
6Library DateTime
7Library RequestsLibrary
DR695H102f3202019-05-24 15:05:03 -04008Resource ../global_properties.robot
DR695Hccff30b2017-02-17 18:44:24 -05009Resource vid_interface.robot
DR695H102f3202019-05-24 15:05:03 -040010Library ONAPLibrary.SO WITH NAME SO
jf986099c63292017-03-09 15:28:42 -050011
12*** Keywords ***
DR695Hccff30b2017-02-17 18:44:24 -050013Create VID VNF
jf986099c63292017-03-09 15:28:42 -050014 [Documentation] Creates a VNF instance using VID for passed instance id with the passed service instance name
bdfreeman14217f58ef12018-05-06 12:12:27 -040015 [Arguments] ${service_instance_id} ${service_instance_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} ${customer} ${line_of_business}=LOB-Demonstration ${platform}=Platform-Demonstration
DR695Hccff30b2017-02-17 18:44:24 -050016 Go To VID HOME
17 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
Jerry Floodf67ce0e2017-03-20 16:59:23 -040018 Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050019
Jerry Flood81d33fb2017-11-21 16:21:21 -050020 Select From List By Label //select[@ng-model='selectedCustomer'] ${customer}
DR695H63e3c4b2019-07-29 17:18:49 -040021 Click On Button When Enabled //button[contains(text(),'Submit')]
Jerry Floodf67ce0e2017-03-20 16:59:23 -040022 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050023 Click Element xpath=//a[contains(text(), 'View/Edit')]
Jerry Floodf67ce0e2017-03-20 16:59:23 -040024 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
Brian Freemana9ea82a2019-06-09 09:11:15 -050025 # in slower environment the background load of data from AAI takes time so that the button is not populated yet
DR695H63e3c4b2019-07-29 17:18:49 -040026 Click On Button When Enabled //button[contains(text(),'Add node instance')]
Jerry Flood81d33fb2017-11-21 16:21:21 -050027 #01681d02-2304-4c91-ab2d 0
DR695Hccff30b2017-02-17 18:44:24 -050028 # This is where firefox breaks. Th elink never becomes visible when run with the script.
Jerry Flood81d33fb2017-11-21 16:21:21 -050029 ${dataTestsId}= Catenate AddVNFOption-${vnf_type}
Brian Freemana9ea82a2019-06-09 09:11:15 -050030 Sleep 10s
Jerry Flood81d33fb2017-11-21 16:21:21 -050031 Click Element xpath=//a[contains(text(), '${vnf_type}')]
Brian Freemana9ea82a2019-06-09 09:11:15 -050032 Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
33 Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050034 ## Without this sleep, the input text below gets immediately wiped out.
DR695Hccff30b2017-02-17 18:44:24 -050035 ## Wait Until Angular Ready just sleeps for its timeout value
36 Sleep 10s
37 Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name}
jf986099c63292017-03-09 15:28:42 -050038 Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family}
Brian Freemandcdc7852019-03-16 12:48:47 -050039 # Fix for Dublin
40 ${cloud_owner_uc}= Convert To Uppercase ${GLOBAL_AAI_CLOUD_OWNER}
41 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} (${cloud_owner_uc})
jf986099c63292017-03-09 15:28:42 -050042 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
DR695H70861af2019-07-30 17:25:33 -040043 Select From List When Enabled //select[@parameter-id='lineOfBusiness'] ${line_of_business}
bdfreeman14217f58ef12018-05-06 12:12:27 -040044 Select From List By Label xpath=//select[@parameter-id='platform'] ${platform}
DR695H63e3c4b2019-07-29 17:18:49 -040045 Click On Button When Enabled //button[contains(text(),'Confirm')]
bdfreeman14217f58ef12018-05-06 12:12:27 -040046 Wait Until Element Contains xpath=//pre[@class = 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
47 ${response text}= Get Text xpath=//pre[@class = 'log ng-binding']
jf986099c63292017-03-09 15:28:42 -050048 Should Not Contain ${response text} FAILED
DR695H63e3c4b2019-07-29 17:18:49 -040049 Click On Button When Enabled //button[contains(text(),'Close')]
DR695Hccff30b2017-02-17 18:44:24 -050050 ${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}
DR695H63e3c4b2019-07-29 17:18:49 -040064 Click On Button When Enabled //button[contains(text(),'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}
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}
Brian Freemandcdc7852019-03-16 12:48:47 -050071 ${cloud_owner_uc}= Convert To Uppercase ${GLOBAL_AAI_CLOUD_OWNER}
72 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} (${cloud_owner_uc})
jf986099c63292017-03-09 15:28:42 -050073 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
DR695Hccff30b2017-02-17 18:44:24 -050074 Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true']
75 #//*[@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 -050076
DR695Hccff30b2017-02-17 18:44:24 -050077 ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
78 ${request_id}= Parse Request Id ${response text}
DR695Hc0cf6a42019-07-26 16:42:36 -040079 ${auth}= Create List ${GLOBAL_SO_USERNAME} ${GLOBAL_SO_PASSWORD}
DR695H50e6c292019-07-26 10:18:50 -040080 ${resp}= SO.Run Polling Get Request ${GLOBAL_SO_ENDPOINT} ${GLOBAL_SO_STATUS_PATH}${request_id} auth=${auth}
jf986099c63292017-03-09 15:28:42 -050081
82Create VID VNF module
bdfreeman14217f58ef12018-05-06 12:12:27 -040083 [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE} ${customer} ${vnf_name}
DR695Hccff30b2017-02-17 18:44:24 -050084 Go To VID HOME
85 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
Jerry Floodf67ce0e2017-03-20 16:59:23 -040086 Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
87 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050088
89 # 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 -050090 Select From List By Label //select[@ng-model='selectedCustomer'] ${customer}
DR695H63e3c4b2019-07-29 17:18:49 -040091 Click On Button When Enabled //button[contains(text(),'Submit')]
Jerry Floodf67ce0e2017-03-20 16:59:23 -040092 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050093 Click Element link=View/Edit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040094 Wait Until Keyword Succeeds 300s 5s Wait For Add VF Module
Jerry Flood3a169a32017-12-01 12:39:10 -050095 Click Element xpath=//div[contains(.,'${vnf_name}')]/div/button[contains(.,'Add VF-Module')]
jf986099c63292017-03-09 15:28:42 -050096
DR695Hccff30b2017-02-17 18:44:24 -050097 # This is where firefox breaks. Th elink never becomes visible when run with the script.
98 Click Element link=${vnf_type}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040099 Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
100 Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
jf986099c63292017-03-09 15:28:42 -0500101
102 ## Without this sleep, the input text below gets immediately wiped out.
DR695Hccff30b2017-02-17 18:44:24 -0500103 ## Wait Until Angular Ready just sleeps for its timeout value
104 Sleep 10s
jf986099c63292017-03-09 15:28:42 -0500105 Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name}
Brian Freemandcdc7852019-03-16 12:48:47 -0500106 ${cloud_owner_uc}= Convert To Uppercase ${GLOBAL_AAI_CLOUD_OWNER}
107 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} (${cloud_owner_uc})
jf986099c63292017-03-09 15:28:42 -0500108 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
Brian Freemanadaa2372018-10-24 12:25:22 -0500109 Wait Until Element Is Visible xpath=//input[@parameter-id='sdncPreload'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
110 Wait Until Element Is Enabled xpath=//input[@parameter-id='sdncPreload'] ${GLOBAL_VID_UI_TIMEOUT_SHORT}
Jerry Flood81d33fb2017-11-21 16:21:21 -0500111 Select Checkbox xpath=//input[@parameter-id='sdncPreload']
DR695H63e3c4b2019-07-29 17:18:49 -0400112 Click On Button When Enabled //button[contains(text(),'Confirm')]
bdfreeman14217f58ef12018-05-06 12:12:27 -0400113 Wait Until Element Contains xpath=//pre[@class = 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
114 ${response text}= Get Text xpath=//pre[@class = 'log ng-binding']
DR695H63e3c4b2019-07-29 17:18:49 -0400115 Click On Button When Enabled //button[contains(text(),'Close')]
DR695Hccff30b2017-02-17 18:44:24 -0500116 ${instance_id}= Parse Instance Id ${response text}
jf986099c63292017-03-09 15:28:42 -0500117
DR695Hccff30b2017-02-17 18:44:24 -0500118 ${request_id}= Parse Request Id ${response text}
DR695Hc0cf6a42019-07-26 16:42:36 -0400119 ${auth}= Create List ${GLOBAL_SO_USERNAME} ${GLOBAL_SO_PASSWORD}
DR695H50e6c292019-07-26 10:18:50 -0400120 ${resp}= SO.Run Polling Get Request ${GLOBAL_SO_ENDPOINT} ${GLOBAL_SO_STATUS_PATH}${request_id} auth=${auth}
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400121 [Return] ${instance_id}
122
123Wait For Add VF Module
124 [Documentation] Retry by refresh if the ADD VF-Module is not visible
DR695H63e3c4b2019-07-29 17:18:49 -0400125 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
126
127 ${status} ${value} Run Keyword And Ignore Error Wait Until Element Is Visible //button[contains(text(),'Add VF-Module')] timeout=${GLOBAL_VID_UI_TIMEOUT_SHORT}
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400128 Return From Keyword If '${status}' == 'PASS'
129 Reload Page
130 Fail Retry