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 |
| 17 | [Arguments] ${service_instance_id} ${service_instance_name} ${product_family} ${lcp_region} ${tenant} ${vnf_type} |
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) |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 23 | Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} |
Jerry Flood | a7e5144 | 2017-08-22 18:25:06 -0400 | [diff] [blame] | 24 | Select From List By Label //select[@ng-model='selectedserviceinstancetype'] Service Instance Id |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 25 | Click Button button=Submit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 26 | 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] | 27 | Click Element xpath=//a[contains(text(), 'View/Edit')] |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 28 | Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 29 | Click Element button=Add VNF |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 30 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 31 | # This is where firefox breaks. Th elink never becomes visible when run with the script. |
| 32 | Click Element link=${vnf_type} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 33 | Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT} |
| 34 | 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] | 35 | |
| 36 | ## Without this sleep, the input text below gets immediately wiped out. |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 37 | ## Wait Until Angular Ready just sleeps for its timeout value |
| 38 | Sleep 10s |
| 39 | Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 40 | Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family} |
| 41 | Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} |
| 42 | Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 43 | Click Element button=Confirm |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 44 | Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] Status: OK (200) timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 45 | ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 46 | Should Not Contain ${response text} FAILED |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 47 | Click Element button=Close |
| 48 | ${instance_id}= Parse Instance Id ${response text} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 49 | Wait Until Page Contains ${service_instance_name} ${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 50 | [Return] ${instance_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 51 | |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 52 | Delete VID VNF |
| 53 | [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 54 | Go To VID HOME |
| 55 | Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a |
| 56 | Wait Until Page Contains Please search by timeout=60s |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 57 | Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 58 | 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] | 59 | |
| 60 | # 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] | 61 | Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} |
| 62 | Click Button button=Submit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 63 | 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] | 64 | Click Element link=View/Edit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 65 | Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 66 | Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} |
| 67 | Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 68 | |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 69 | |
| 70 | |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 71 | 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] | 72 | Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} |
| 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} |
| 79 | Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 80 | |
| 81 | Create VID VNF module |
| 82 | [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 83 | Go To VID HOME |
| 84 | Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 85 | Wait Until Page Contains Please search by timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 86 | 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] | 87 | |
| 88 | # 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] | 89 | Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id} |
| 90 | Click Button button=Submit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 91 | 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] | 92 | Click Element link=View/Edit |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 93 | Wait Until Keyword Succeeds 300s 5s Wait For Add VF Module |
| 94 | #Wait Until Page Contains View/Edit Service Instance timeout=60s |
| 95 | #Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s |
| 96 | #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=120s |
| 97 | #Wait Until Element Is Visible button=Add VF-Module timeout=120s |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 98 | Click Element button=Add VF-Module |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 99 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 100 | # This is where firefox breaks. Th elink never becomes visible when run with the script. |
| 101 | Click Element link=${vnf_type} |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 102 | Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] ${GLOBAL_VID_UI_TIMEOUT_SHORT} |
| 103 | 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] | 104 | |
| 105 | ## Without this sleep, the input text below gets immediately wiped out. |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 106 | ## Wait Until Angular Ready just sleeps for its timeout value |
| 107 | Sleep 10s |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 108 | Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name} |
| 109 | Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region} |
| 110 | Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 111 | Click Element button=Confirm |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 112 | Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=${GLOBAL_VID_UI_TIMEOUT_LONG} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 113 | ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 114 | Click Element button=Close |
| 115 | ${instance_id}= Parse Instance Id ${response text} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 116 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 117 | ${request_id}= Parse Request Id ${response text} |
| 118 | Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 119 | |
Jerry Flood | f67ce0e | 2017-03-20 16:59:23 -0400 | [diff] [blame] | 120 | [Return] ${instance_id} |
| 121 | |
| 122 | Wait For Add VF Module |
| 123 | [Documentation] Retry by refresh if the ADD VF-Module is not visible |
| 124 | Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 125 | Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 126 | Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM} |
| 127 | ${status} ${value} Run Keyword And Ignore Error Wait Until Element Is Visible button=Add VF-Module timeout=${GLOBAL_VID_UI_TIMEOUT_SHORT} |
| 128 | Return From Keyword If '${status}' == 'PASS' |
| 129 | Reload Page |
| 130 | Fail Retry |