DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Creates VID VNF Instance |
| 3 | |
| 4 | Library ExtendedSelenium2Library 60 |
| 5 | Library UUID |
| 6 | Library String |
| 7 | Library DateTime |
| 8 | Library RequestsLibrary |
| 9 | |
| 10 | Resource ../mso_interface.robot |
| 11 | Resource vid_interface.robot |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 12 | |
| 13 | *** Keywords *** |
| 14 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 15 | Create VID VNF |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 16 | [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^] | 17 | [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] | 18 | Go To VID HOME |
| 19 | Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 20 | Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 21 | |
| 22 | # 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] | 23 | #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} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 26 | Click Button button=Submit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 27 | 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] | 28 | Click Element xpath=//a[contains(text(), 'View/Edit')] |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 29 | Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame^] | 30 | Click Element button=Add node instance |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 31 | #01681d02-2304-4c91-ab2d 0 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 32 | # 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] | 33 | ${dataTestsId}= Catenate AddVNFOption-${vnf_type} |
| 34 | Click Element xpath=//a[contains(text(), '${vnf_type}')] |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 35 | 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} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 37 | |
| 38 | ## Without this sleep, the input text below gets immediately wiped out. |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 39 | ## Wait Until Angular Ready just sleeps for its timeout value |
| 40 | Sleep 10s |
| 41 | Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 42 | 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} |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame^] | 45 | Sleep 5s |
| 46 | Click Element xpath=//multiselect[@parameter-id='lineOfBusiness'] |
| 47 | Sleep 5s |
| 48 | Click Element xpath=//button[contains(text(),${line_of_business})] |
| 49 | Select From List By Label xpath=//select[@parameter-id='platform'] ${platform} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 50 | Click Element button=Confirm |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame^] | 51 | Wait Until Element Contains xpath=//pre[@class = 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} |
| 52 | ${response text}= Get Text xpath=//pre[@class = 'log ng-binding'] |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 53 | Should Not Contain ${response text} FAILED |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 54 | Click Element button=Close |
| 55 | ${instance_id}= Parse Instance Id ${response text} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 56 | Wait Until Page Contains ${service_instance_name} ${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 57 | [Return] ${instance_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 58 | |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 59 | Delete VID VNF |
| 60 | [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 61 | Go To VID HOME |
| 62 | Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a |
| 63 | Wait Until Page Contains Please search by timeout=60s |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 64 | Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 65 | 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] | 66 | |
| 67 | # 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] | 68 | Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} |
| 69 | Click Button button=Submit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 70 | 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] | 71 | Click Element link=View/Edit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 72 | Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 73 | Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} |
| 74 | 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] | 75 | Click On Element When Visible xpath=//li/div[contains(.,'${vnf_instance_id}')]/a/span[@class='glyphicon glyphicon-remove'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 76 | Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} |
| 77 | Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 78 | Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true'] |
| 79 | #//*[@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] | 80 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 81 | ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] |
| 82 | ${request_id}= Parse Request Id ${response text} |
| 83 | Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 84 | |
| 85 | Create VID VNF module |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame^] | 86 | [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] | 87 | Go To VID HOME |
| 88 | Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 89 | Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 90 | 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] | 91 | |
| 92 | # 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] | 93 | Select From List By Label //select[@ng-model='selectedCustomer'] ${customer} |
| 94 | ###Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 95 | Click Button button=Submit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 96 | 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] | 97 | Click Element link=View/Edit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 98 | Wait Until Keyword Succeeds 300s 5s Wait For Add VF Module |
Jerry Flood | 3a169a3 | 2017-12-01 12:39:10 -0500 | [diff] [blame] | 99 | Click Element xpath=//div[contains(.,'${vnf_name}')]/div/button[contains(.,'Add VF-Module')] |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 100 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 101 | # This is where firefox breaks. Th elink never becomes visible when run with the script. |
| 102 | Click Element link=${vnf_type} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 103 | Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT} |
| 104 | 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] | 105 | |
| 106 | ## Without this sleep, the input text below gets immediately wiped out. |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 107 | ## Wait Until Angular Ready just sleeps for its timeout value |
| 108 | Sleep 10s |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 109 | Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name} |
| 110 | Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} |
| 111 | Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 112 | Select Checkbox xpath=//input[@parameter-id='sdncPreload'] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 113 | Click Element button=Confirm |
bdfreeman1421 | 7f58ef1 | 2018-05-06 12:12:27 -0400 | [diff] [blame^] | 114 | Wait Until Element Contains xpath=//pre[@class = 'log ng-binding'] requestState timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} |
| 115 | ${response text}= Get Text xpath=//pre[@class = 'log ng-binding'] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 116 | Click Element button=Close |
| 117 | ${instance_id}= Parse Instance Id ${response text} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 118 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 119 | ${request_id}= Parse Request Id ${response text} |
| 120 | Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE |
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 |
| 125 | Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 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 |