blob: a7cc8e1f96d80dcffa0e975325cb9a83df9bddd3 [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
bdfreeman14217f58ef12018-05-06 12:12:27 -040017 [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 -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)
Jerry Flood81d33fb2017-11-21 16:21:21 -050023 #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}
DR695Hccff30b2017-02-17 18:44:24 -050026 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040027 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050028 Click Element xpath=//a[contains(text(), 'View/Edit')]
Jerry Floodf67ce0e2017-03-20 16:59:23 -040029 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
bdfreeman14217f58ef12018-05-06 12:12:27 -040030 Click Element button=Add node instance
Jerry Flood81d33fb2017-11-21 16:21:21 -050031 #01681d02-2304-4c91-ab2d 0
DR695Hccff30b2017-02-17 18:44:24 -050032 # This is where firefox breaks. Th elink never becomes visible when run with the script.
Jerry Flood81d33fb2017-11-21 16:21:21 -050033 ${dataTestsId}= Catenate AddVNFOption-${vnf_type}
34 Click Element xpath=//a[contains(text(), '${vnf_type}')]
Jerry Floodf67ce0e2017-03-20 16:59:23 -040035 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}
jf986099c63292017-03-09 15:28:42 -050037
38 ## Without this sleep, the input text below gets immediately wiped out.
DR695Hccff30b2017-02-17 18:44:24 -050039 ## Wait Until Angular Ready just sleeps for its timeout value
40 Sleep 10s
41 Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name}
jf986099c63292017-03-09 15:28:42 -050042 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}
bdfreeman14217f58ef12018-05-06 12:12:27 -040045 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}
DR695Hccff30b2017-02-17 18:44:24 -050050 Click Element button=Confirm
bdfreeman14217f58ef12018-05-06 12:12:27 -040051 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']
jf986099c63292017-03-09 15:28:42 -050053 Should Not Contain ${response text} FAILED
DR695Hccff30b2017-02-17 18:44:24 -050054 Click Element button=Close
55 ${instance_id}= Parse Instance Id ${response text}
Jerry Floodf67ce0e2017-03-20 16:59:23 -040056 Wait Until Page Contains ${service_instance_name} ${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050057 [Return] ${instance_id}
DR695Hccff30b2017-02-17 18:44:24 -050058
jf986099c63292017-03-09 15:28:42 -050059Delete VID VNF
60 [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id}
DR695Hccff30b2017-02-17 18:44:24 -050061 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 Floodf67ce0e2017-03-20 16:59:23 -040064 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}
jf986099c63292017-03-09 15:28:42 -050066
67 # 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 -050068 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
69 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040070 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050071 Click Element link=View/Edit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040072 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 Floodf67ce0e2017-03-20 16:59:23 -040075 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 -050076 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
77 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
DR695Hccff30b2017-02-17 18:44:24 -050078 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]
jf986099c63292017-03-09 15:28:42 -050080
DR695Hccff30b2017-02-17 18:44:24 -050081 ${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
jf986099c63292017-03-09 15:28:42 -050084
85Create VID VNF module
bdfreeman14217f58ef12018-05-06 12:12:27 -040086 [Arguments] ${service_instance_id} ${vf_module_name} ${lcp_region} ${TENANT} ${VNF_TYPE} ${customer} ${vnf_name}
DR695Hccff30b2017-02-17 18:44:24 -050087 Go To VID HOME
88 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
Jerry Floodf67ce0e2017-03-20 16:59:23 -040089 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}
jf986099c63292017-03-09 15:28:42 -050091
92 # 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 -050093 Select From List By Label //select[@ng-model='selectedCustomer'] ${customer}
94 ###Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
DR695Hccff30b2017-02-17 18:44:24 -050095 Click Button button=Submit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040096 Wait Until Page Contains Element link=View/Edit timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
jf986099c63292017-03-09 15:28:42 -050097 Click Element link=View/Edit
Jerry Floodf67ce0e2017-03-20 16:59:23 -040098 Wait Until Keyword Succeeds 300s 5s Wait For Add VF Module
Jerry Flood3a169a32017-12-01 12:39:10 -050099 Click Element xpath=//div[contains(.,'${vnf_name}')]/div/button[contains(.,'Add VF-Module')]
jf986099c63292017-03-09 15:28:42 -0500100
DR695Hccff30b2017-02-17 18:44:24 -0500101 # This is where firefox breaks. Th elink never becomes visible when run with the script.
102 Click Element link=${vnf_type}
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400103 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}
jf986099c63292017-03-09 15:28:42 -0500105
106 ## Without this sleep, the input text below gets immediately wiped out.
DR695Hccff30b2017-02-17 18:44:24 -0500107 ## Wait Until Angular Ready just sleeps for its timeout value
108 Sleep 10s
jf986099c63292017-03-09 15:28:42 -0500109 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 Flood81d33fb2017-11-21 16:21:21 -0500112 Select Checkbox xpath=//input[@parameter-id='sdncPreload']
DR695Hccff30b2017-02-17 18:44:24 -0500113 Click Element button=Confirm
bdfreeman14217f58ef12018-05-06 12:12:27 -0400114 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']
DR695Hccff30b2017-02-17 18:44:24 -0500116 Click Element button=Close
117 ${instance_id}= Parse Instance Id ${response text}
jf986099c63292017-03-09 15:28:42 -0500118
DR695Hccff30b2017-02-17 18:44:24 -0500119 ${request_id}= Parse Request Id ${response text}
120 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
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
125 Wait Until Page Contains View/Edit Service Instance timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
Jerry Floodf67ce0e2017-03-20 16:59:23 -0400126 ${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