blob: a306637e1805f088830368ecec9d4a3363b5951d [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
12
13*** Keywords ***
14
15Create VID VNF
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}
18 Go To VID HOME
19 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
20 Wait Until Page Contains Please search by timeout=60s
21 #Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s
22 #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s
23
24 # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
25 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
26 Click Button button=Submit
27 Wait Until Page Contains Element link=View/Edit timeout=60s
28 Click Element xpath=//a[contains(text(), 'View/Edit')]
29 Wait Until Page Contains View/Edit Service Instance timeout=60s
30 #Wait Until Page Contains Element xpath=//div[@class='statusLine aaiVisible'] timeout=120s
31 #Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiVisible'] timeout=60s
32 Click Element button=Add VNF
33
34 # This is where firefox breaks. Th elink never becomes visible when run with the script.
35 Click Element link=${vnf_type}
36 Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] 20s
37 Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] 20s
38
39 ## Without this sleep, the input text below gets immediately wiped out.
40 ## Wait Until Angular Ready just sleeps for its timeout value
41 Sleep 10s
42 Input Text xpath=//input[@parameter-id='instanceName'] ${service_instance_name}
43 Select From List By Label xpath=//select[@parameter-id='productFamily'] ${product_family}
44 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
45 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
46 Click Element button=Confirm
47 Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] Status: OK (200) timeout=120
48 ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
49 Should Not Contain ${response text} FAILED
50 Click Element button=Close
51 ${instance_id}= Parse Instance Id ${response text}
52 Wait Until Page Contains ${service_instance_name} 60s
53 [Return] ${instance_id}
54
55Delete VID VNF
56 [Arguments] ${service_instance_id} ${lcp_region} ${tenant} ${vnf_instance_id}
57 Go To VID HOME
58 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
59 Wait Until Page Contains Please search by timeout=60s
60 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s
61 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s
62
63 # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
64 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
65 Click Button button=Submit
66 Wait Until Page Contains Element link=View/Edit timeout=60s
67 Click Element link=View/Edit
68 Wait Until Page Contains View/Edit Service Instance timeout=60s
69 Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s
70 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=60s
71
72
73
74 Click On Element When Visible xpath=//li/div[contains(.,'${vnf_instance_id}')]/a/span[@class='glyphicon glyphicon-remove'] timeout=120s
75 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
76 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
77 Click Element xpath=//div[@class='buttonRow']/button[@ngx-enabled='true']
78 #//*[@id="mContent"]/div/div/div/div/table/tbody/tr/td/div/div[2]/div/div[1]/div[5]/button[1]
79
80 ${response text}= Get Text xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
81 ${request_id}= Parse Request Id ${response text}
82 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
83
84Create VID VNF module
85 [Arguments] ${service_instance_id} ${vf_module_name} ${LCP_REGION} ${TENANT} ${VNF_TYPE}
86 Go To VID HOME
87 Click Link xpath=//div[@heading = 'Search for Existing Service Instances']/a
88 Wait Until Page Contains Please search by timeout=60s
89 Wait Until Page Contains Element xpath=//div[@class='statusLine aaiHidden'] timeout=60s
90
91 # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
92 Input Text When Enabled //input[@name='selectedServiceInstance'] ${service_instance_id}
93 Click Button button=Submit
94 Wait Until Page Contains Element link=View/Edit timeout=60s
95 Click Element link=View/Edit
96 Wait Until Page Contains View/Edit Service Instance timeout=60s
97 Wait Until Page Contains Element xpath=//div[@class='statusLine'] timeout=120s
98 Wait Until Element Is Not Visible xpath=//div[@class='statusLine aaiHidden'] timeout=120s
99 Wait Until Element Is Visible button=Add VF-Module timeout=120s
100 Click Element button=Add VF-Module
101
102 # This is where firefox breaks. Th elink never becomes visible when run with the script.
103 Click Element link=${vnf_type}
104 Wait Until Page Contains Element xpath=//input[@parameter-id='instanceName'] 20s
105 Wait Until Element Is Enabled xpath=//input[@parameter-id='instanceName'] 20s
106
107 ## Without this sleep, the input text below gets immediately wiped out.
108 ## Wait Until Angular Ready just sleeps for its timeout value
109 Sleep 10s
110 Input Text xpath=//input[@parameter-id='instanceName'] ${vf_module_name}
111 Select From List By Label xpath=//select[@parameter-id='lcpRegion'] ${lcp_region}
112 Select From List By Label xpath=//select[@parameter-id='tenant'] ${tenant}
113 Click Element button=Confirm
114 Wait Until Element Contains xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding'] requestId timeout=120
115 ${response text}= Get Text xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
116 Click Element button=Close
117 ${instance_id}= Parse Instance Id ${response text}
118
119 ${request_id}= Parse Request Id ${response text}
120 Poll MSO Get Request ${GLOBAL_MSO_STATUS_PATH}${request_id} COMPLETE
121
122 [Return] ${instance_id}