DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Creates VID VNF Instance |
| 3 | |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 4 | Library SeleniumLibrary 60 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 5 | Library String |
| 6 | Library DateTime |
| 7 | Library RequestsLibrary |
DR695H | 102f320 | 2019-05-24 15:05:03 -0400 | [diff] [blame] | 8 | Resource ../global_properties.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 9 | Resource vid_interface.robot |
DR695H | 102f320 | 2019-05-24 15:05:03 -0400 | [diff] [blame] | 10 | Library ONAPLibrary.SO WITH NAME SO |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 11 | |
| 12 | *** Keywords *** |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 13 | Create VID VNF |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 14 | [Documentation] Creates a VNF instance using VID for passed instance id with the passed service instance name |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame] | 15 | [Arguments] ${service_instance_id} ${service_instance_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} ${customer} ${line_of_business}=LOB-Demonstration ${platform}=Platform-Demonstration |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 16 | Go To VID HOME |
| 17 | Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 18 | Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 19 | |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 20 | Select From List By Label //select[@ng-model='selectedCustomer'] ${customer} |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 21 | Click On Button When Enabled //button[contains(text(),'Submit')] |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 22 | Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 23 | Click Element xpath=//a[contains(text(), 'View/Edit')] |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 24 | Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
Brian Freeman | a9ea82a | 2019-06-09 09:11:15 -0500 | [diff] [blame] | 25 | # in slower environment the background load of data from AAI takes time so that the button is not populated yet |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 26 | Click On Button When Enabled //button[contains(text(),'Add node instance')] |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 27 | #01681d02-2304-4c91-ab2d 0 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 28 | # This is where firefox breaks. Th elink never becomes visible when run with the script. |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 29 | ${dataTestsId}= Catenate AddVNFOption-${vnf_type} |
Brian Freeman | a9ea82a | 2019-06-09 09:11:15 -0500 | [diff] [blame] | 30 | Sleep 10s |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 31 | Click Element xpath=//a[contains(text(), '${vnf_type}')] |
Brian Freeman | a9ea82a | 2019-06-09 09:11:15 -0500 | [diff] [blame] | 32 | 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} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 34 | ## Without this sleep, the input text below gets immediately wiped out. |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 35 | ## Wait Until Angular Ready just sleeps for its timeout value |
| 36 | Sleep 10s |
| 37 | Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 38 | Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family} |
Brian Freeman | dcdc785 | 2019-03-16 12:48:47 -0500 | [diff] [blame] | 39 | # 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}) |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 42 | Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} |
DR695H | 70861af | 2019-07-30 17:25:33 -0400 | [diff] [blame] | 43 | Select From List When Enabled //select[@parameter-id='lineOfBusiness'] ${line_of_business} |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame] | 44 | Select From List By Label xpath=//select[@parameter-id='platform'] ${platform} |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 45 | Click On Button When Enabled //button[contains(text(),'Confirm')] |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame] | 46 | 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'] |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 48 | Should Not Contain ${response text} FAILED |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 49 | Click On Button When Enabled //button[contains(text(),'Close')] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 50 | ${instance_id}= Parse Instance Id ${response text} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 51 | Wait Until Page Contains ${service_instance_name} ${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 52 | [Return] ${instance_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 53 | |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 54 | Delete VID VNF |
| 55 | [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 56 | 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 Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 59 | 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} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 61 | |
| 62 | # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 63 | Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 64 | Click On Button When Enabled //button[contains(text(),'Submit')] |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 65 | Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 66 | Click Element link=View/Edit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 67 | 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 Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 70 | 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 Freeman | dcdc785 | 2019-03-16 12:48:47 -0500 | [diff] [blame] | 71 | ${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}) |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 73 | Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 74 | 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] |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 76 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 77 | ${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} |
DR695H | c0cf6a4 | 2019-07-26 16:42:36 -0400 | [diff] [blame] | 79 | ${auth}= Create List ${GLOBAL_SO_USERNAME} ${GLOBAL_SO_PASSWORD} |
DR695H | 50e6c29 | 2019-07-26 10:18:50 -0400 | [diff] [blame] | 80 | ${resp}= SO.Run Polling Get Request ${GLOBAL_SO_ENDPOINT} ${GLOBAL_SO_STATUS_PATH}${request_id} auth=${auth} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 81 | |
| 82 | Create VID VNF module |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame] | 83 | [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE} ${customer} ${vnf_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 84 | Go To VID HOME |
| 85 | Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 86 | 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} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 88 | |
| 89 | # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 90 | Select From List By Label //select[@ng-model='selectedCustomer'] ${customer} |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 91 | Click On Button When Enabled //button[contains(text(),'Submit')] |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 92 | Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 93 | Click Element link=View/Edit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 94 | Wait Until Keyword Succeeds 300s 5s Wait For Add VF Module |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 95 | Click Element xpath=//div[contains(.,'${vnf_name}')]/div/button[contains(.,'Add VF-Module')] |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 96 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 97 | # This is where firefox breaks. Th elink never becomes visible when run with the script. |
| 98 | Click Element link=${vnf_type} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 99 | 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} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 101 | |
| 102 | ## Without this sleep, the input text below gets immediately wiped out. |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 103 | ## Wait Until Angular Ready just sleeps for its timeout value |
| 104 | Sleep 10s |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 105 | Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name} |
Brian Freeman | dcdc785 | 2019-03-16 12:48:47 -0500 | [diff] [blame] | 106 | ${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}) |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 108 | Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} |
Brian Freeman | adaa237 | 2018-10-24 12:25:22 -0500 | [diff] [blame] | 109 | 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 Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 111 | Select Checkbox xpath=//input[@parameter-id='sdncPreload'] |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 112 | Click On Button When Enabled //button[contains(text(),'Confirm')] |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame] | 113 | 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'] |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 115 | Click On Button When Enabled //button[contains(text(),'Close')] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 116 | ${instance_id}= Parse Instance Id ${response text} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 117 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 118 | ${request_id}= Parse Request Id ${response text} |
DR695H | c0cf6a4 | 2019-07-26 16:42:36 -0400 | [diff] [blame] | 119 | ${auth}= Create List ${GLOBAL_SO_USERNAME} ${GLOBAL_SO_PASSWORD} |
DR695H | 50e6c29 | 2019-07-26 10:18:50 -0400 | [diff] [blame] | 120 | ${resp}= SO.Run Polling Get Request ${GLOBAL_SO_ENDPOINT} ${GLOBAL_SO_STATUS_PATH}${request_id} auth=${auth} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 121 | [Return] ${instance_id} |
| 122 | |
| 123 | Wait For Add VF Module |
| 124 | [Documentation] Retry by refresh if the ADD VF-Module is not visible |
DR695H | 63e3c4b | 2019-07-29 17:18:49 -0400 | [diff] [blame] | 125 | 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 Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 128 | Return From Keyword If '${status}' == 'PASS' |
| 129 | Reload Page |
| 130 | Fail Retry |