Move CSIT to integration/csit repo
[integration/csit.git] / tests / portal / testsuites / portal_VID.robot
1 *** Settings ***
2 Documentation     The main interface for interacting with Portal. It handles low level stuff like managing the selenium request library and Portal required steps
3 Library             ExtendedSelenium2Library
4 Library           RequestsClientCert
5 Library               RequestsLibrary
6 Library           UUID 
7 Library         DateTime  
8 Resource        ../global_properties.robot
9 Resource        ../browser_setup.robot
10
11 *** Variables ***
12 ${PORTAL_ENV}            /ECOMPPORTAL
13 ${PORTAL_LOGIN_URL}                ${GLOBAL_PORTAL_URL}${PORTAL_ENV}/login.htm
14 ${PORTAL_HOME_PAGE}        ${GLOBAL_PORTAL_URL}${PORTAL_ENV}/applicationsHome
15 ${PORTAL_MICRO_ENDPOINT}    ${GLOBAL_PORTAL_URL}${PORTAL_ENV}/commonWidgets
16 ${PORTAL_HOME_URL}                ${GLOBAL_PORTAL_URL}${PORTAL_ENV}/applicationsHome
17 ${App_First_Name}    appdemo    
18 ${App_Last_Name}    demo
19 ${App_Email_Address}    appdemo@onap.com
20 ${App_LoginID}    appdemo 
21 ${App_Loginpwd}    demo123456!
22 ${App_LoginPwdCheck}    demo123456!
23 ${Sta_First_Name}    stademo   
24 ${Sta_Last_Name}    demo
25 ${Sta_Email_Address}    stademo@onap.com
26 ${Sta_LoginID}    stademo
27 ${Sta_Loginpwd}    demo123456!
28 ${Sta_LoginPwdCheck}    demo123456!
29 ${Existing_User}    portal
30 ${PORTAL_HEALTH_CHECK_PATH}        /ECOMPPORTAL/portalApi/healthCheck
31 #${Application}     'Virtual Infrastructure Deployment'  
32 #${Application_tab}     'select-app-Virtual-Infrastructure-Deployment'   
33 #${Application_dropdown}    'div-app-name-dropdown-Virtual-Infrastructure-Deployment'
34 #${Application_dropdown_select}    'div-app-name-Virtual-Infrastructure-Deployment'  
35 ${APPC_LOGIN_URL}     http://104.130.74.99:8282/apidoc/explorer/index.html 
36 ${PORTAL_ASSETS_DIRECTORY}    C:\\Users\\kk707x\\Downloads
37
38
39   
40
41
42 *** Keywords ***
43
44 Run Portal Health Check
45      [Documentation]    Runs Portal Health check
46      ${resp}=    Run Portal Get Request    ${PORTAL_HEALTH_CHECK_PATH}    
47      Should Be Equal As Strings         ${resp.status_code}     200
48      Should Be Equal As Strings         ${resp.json()['statusCode']}    200
49 Run Portal Get Request
50      [Documentation]    Runs Portal Get request
51      [Arguments]    ${data_path}
52      ${session}=    Create Session      portal  ${GLOBAL_PORTAL_URL}
53      ${uuid}=    Generate UUID
54      ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
55      ${resp}=   Get Request     portal  ${data_path}     headers=${headers}
56      Log    Received response from portal ${resp.text}
57      [Return]    ${resp}     
58      
59
60 Portal admin Login To Portal GUI
61     [Documentation]   Logs into Portal GUI
62     # Setup Browser Now being managed by test case
63     ##Setup Browser
64     Go To    ${PORTAL_LOGIN_URL}
65     Maximize Browser Window
66     Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
67     Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
68     Log    Logging in to ${GLOBAL_PORTAL_SERVER}${PORTAL_ENV}
69    # Handle Proxy Warning
70     Title Should Be    Login
71     Input Text    xpath=//input[@ng-model='loginId']    ${GLOBAL_PORTAL_ADMIN_USER}
72     Input Password    xpath=//input[@ng-model='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
73     Click Link    xpath=//a[@id='loginBtn']
74     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}    
75     Log    Logged in to ${GLOBAL_PORTAL_SERVER}${PORTAL_ENV}
76
77 Portal admin Go To Portal HOME
78     [Documentation]    Naviage to Portal Home
79     Go To    ${PORTAL_HOME_URL}
80     Wait Until Page Contains Element    xpath=//div[@class='applicationWindow']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}   
81     
82 Portal admin User Notifications 
83     [Documentation]    Naviage to User notification tab
84     Click Link    xpath=//a[@id='parent-item-User-Notifications']
85     Wait Until Element Is Visible    xpath=//h1[@class='heading-page']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
86     Click Button    xpath=//button[@id='button-openAddNewApp']
87     Click Button    xpath=(//button[@id='undefined'])[1]
88     #Click Button    xpath=//input[@id='datepicker-start']
89     
90 Portal admin Add Application Admin New User
91     [Documentation]    Naviage to Admins tab
92     Click Link    xpath=//a[@title='Admins']
93     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
94     Page Should Contain      Admins
95     Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
96     Click Button    xpath=//button[@id='Create-New-User-button']
97     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${First_Name}
98     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${Last_Name}
99     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${Email_Address}
100     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${LoginID}
101     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${Loginpwd}
102     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${LoginPwdCheck} 
103     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
104     Click Button    xpath=//button[@id='search-users-button-next']
105     Click Button    xpath=//input[@value='Select application']
106     Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'Virtual Infrastructure Deployment')])[1]
107     #Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'Virtual Infrastructure Deployment')])[1]
108     Click Element    xpath=(//li[contains(.,'Virtual Infrastructure Deployment')])[2]
109      Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
110    Click Element    xpath=//button[@id='admin-div-ok-button']
111     Click Element    xpath=//button[@id='div-confirm-ok-button']
112     Click Link    xpath=//a[@aria-label='Admins']
113     Click Button    xpath=//input[@id='dropdown1']
114     Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
115     Input Text    xpath=//input[@id='input-table-search']    ${First_Name}
116     Element Text Should Be      xpath=(//span[contains(.,'Test')] )[1]   ${First_Name}
117     
118     
119     
120     
121 Portal admin Add Application Admin Exiting User 
122     [Documentation]    Naviage to Admins tab
123     Wait Until Element Is Visible    xpath=//a[@title='Admins']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
124     Click Link    xpath=//a[@title='Admins']
125     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
126     Page Should Contain      Admins
127     Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
128     Input Text    xpath=//input[@id='input-user-search']    ${Existing_User}   
129     Click Button    xpath=//button[@id='button-search-users']
130     Click Element    xpath=//span[@id='result-uuid-0']
131     Click Button    xpath=//button[@id='search-users-button-next']
132     Click Button    xpath=//input[@value='Select application']
133     Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'Virtual Infrastructure Deployment' )])[1]
134     
135     Click Element    xpath=(//li[contains(.,'Virtual Infrastructure Deployment' )])[2]
136     #Select From List    xpath=(//input[@value='Select application']/following::*[contains(text(),'Virtual Infrastructure Deployment')])[1]   Virtual Infrastructure Deployment
137     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
138     Click Element    xpath=//button[@id='admin-div-ok-button']
139     Click Element    xpath=//button[@id='div-confirm-ok-button']
140     Get Selenium Implicit Wait
141     Click Link    xpath=//a[@aria-label='Admins']
142     Click Element    xpath=//input[@id='dropdown1']
143     Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment' )]
144     Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
145     Element Text Should Be      xpath=(//span[contains(.,'portal')])[1]   ${Existing_User}
146     
147     
148 Portal admin Delete Application Admin Existing User  
149     [Documentation]    Naviage to Admins tab
150     Click Element    xpath=(//span[contains(.,'portal')] )[1] 
151     Click Element    xpath=//*[@id='select-app-Virtual-Infrastructure-Deployment']/following::i[@id='i-delete-application']
152     Click Element    xpath=//button[@id='div-confirm-ok-button']
153     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
154     Click Element    xpath=//button[@id='admin-div-ok-button']
155     #Is Element Visible      xpath=(//span[contains(.,'Portal')] )[2]
156     #Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2]
157     Element Should Not Contain     xpath=//*[@table-data='admins.adminsTableData']    portal
158     
159     
160 Portal admin Add Application admin User New user
161     [Documentation]    Naviage to Users tab
162     Click Link    xpath=//a[@title='Users']
163     Page Should Contain      Users
164     Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
165     Click Button    xpath=//button[@id='Create-New-User-button']
166     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${App_First_Name}
167     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${App_Last_Name}
168     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${App_Email_Address}
169     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${App_LoginID}
170     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${App_Loginpwd}
171     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${App_LoginPwdCheck}
172     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
173     Click Button    xpath=//button[@id='next-button']
174     #Scroll Element Into View    xpath=//div[@id='div-app-name-dropdown-Virtual-Infrastructure-Deployment']
175     Click Element    xpath=//*[@id='div-app-name-dropdown-Virtual-Infrastructure-Deployment']
176     Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::input[@id='Standard-User-checkbox']
177     Set Selenium Implicit Wait    3000
178     Click Button    xpath=//button[@id='new-user-save-button']
179     Set Selenium Implicit Wait    3000
180     Go To    ${PORTAL_HOME_PAGE}
181      Click Link    xpath=//a[@title='Users']
182      Click Element    xpath=//input[@id='dropdown1']
183      Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
184     Input Text    xpath=//input[@id='input-table-search']    ${App_First_Name}
185     Element Text Should Be      xpath=(//span[contains(.,'appdemo')] )[1]   ${App_First_Name}
186     
187     
188 Portal admin Add Standard User New user
189     [Documentation]    Naviage to Users tab
190     Click Link    xpath=//a[@title='Users']
191     Page Should Contain      Users
192     Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
193     Click Button    xpath=//button[@id='Create-New-User-button']
194     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${Sta_First_Name}
195     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${Sta_Last_Name}
196     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${Sta_Email_Address}
197     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${Sta_LoginID}
198     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${Sta_Loginpwd}
199     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${Sta_LoginPwdCheck}
200     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
201     Click Button    xpath=//button[@id='next-button']
202     #Scroll Element Into View    xpath=//div[@id='div-app-name-dropdown-Virtual-Infrastructure-Deployment']
203     Click Element    xpath=//*[@id='div-app-name-dropdown-Virtual-Infrastructure-Deployment']
204     Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::input[@id='Standard-User-checkbox']
205     Set Selenium Implicit Wait    3000
206     Click Button    xpath=//button[@id='new-user-save-button']
207     Set Selenium Implicit Wait    3000
208     Go To    ${PORTAL_HOME_PAGE}
209      Click Link    xpath=//a[@title='Users']
210      Click Element    xpath=//input[@id='dropdown1']
211      Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
212     Input Text    xpath=//input[@id='input-table-search']    ${Sta_First_Name}
213     Element Text Should Be      xpath=(//span[contains(.,'appdemo')] )[1]   ${Sta_First_Name} 
214     
215     
216     
217 Portal admin Add Application Admin Exiting User -APPDEMO 
218     [Documentation]    Naviage to Admins tab
219     Wait Until Element Is Visible    xpath=//a[@title='Admins']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
220     Click Link    xpath=//a[@title='Admins']
221     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
222     Page Should Contain      Admins
223     Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
224     Input Text    xpath=//input[@id='input-user-search']    ${App_First_Name}   
225     Click Button    xpath=//button[@id='button-search-users']
226     Click Element    xpath=//span[@id='result-uuid-0']
227     Click Button    xpath=//button[@id='search-users-button-next']
228     Click Button    xpath=//input[@value='Select application']
229     Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'Virtual Infrastructure Deployment' )])[1]
230     
231     Click Element    xpath=(//li[contains(.,'Virtual Infrastructure Deployment' )])[2]
232     #Select From List    xpath=(//input[@value='Select application']/following::*[contains(text(),'Virtual Infrastructure Deployment')])[1]   Virtual Infrastructure Deployment
233     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
234     Click Element    xpath=//button[@id='admin-div-ok-button']
235     Click Element    xpath=//button[@id='div-confirm-ok-button']
236     Get Selenium Implicit Wait
237     Click Link    xpath=//a[@aria-label='Admins']
238     Click Element    xpath=//input[@id='dropdown1']
239     Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment' )]
240     Input Text    xpath=//input[@id='input-table-search']    ${App_First_Name}
241     Element Text Should Be      xpath=(//span[contains(.,'appdemo')])[1]   ${App_First_Name}    
242     
243     
244       
245 Portal admin Add Standard User Existing user   
246      [Documentation]    Naviage to Users tab
247      Click Link    xpath=//a[@title='Users']
248      Page Should Contain      Users
249      Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
250      Input Text    xpath=//input[@id='input-user-search']    ${Existing_User}
251      Click Button    xpath=//button[@id='button-search-users']
252      Click Element    xpath=//span[@id='result-uuid-0']
253      Click Button    xpath=//button[@id='next-button']
254      Click Element    xpath=//*[@id='div-app-name-dropdown-Virtual-Infrastructure-Deployment']
255      Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::input[@id='Standard-User-checkbox']
256      #Click Element    xpath=//div[@id='div-app-name-dropdown-xDemo-App']
257      #Click Element    xpath=//div[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
258      
259      Set Selenium Implicit Wait    3000
260      Click Button    xpath=//button[@id='new-user-save-button']
261      Set Selenium Implicit Wait    3000
262      #Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
263      #Select From List    xpath=//input[@value='Select application']    Virtual Infrastructure Deployment
264      #Click Link    xpath=//a[@title='Users']
265      #Page Should Contain      Users
266      #Focus    xpath=//input[@name='dropdown1']
267     
268      Go To    ${PORTAL_HOME_PAGE}
269      Click Link    xpath=//a[@title='Users']
270      Click Element    xpath=//input[@id='dropdown1']
271      Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
272      #Click Element    xpath=//li[contains(.,'XDemo App')]
273      Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
274      Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Standard User
275      
276      
277 Portal admin Edit Standard User Existing user  
278      [Documentation]    Naviage to Users tab
279      Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
280      Click Element    xpath=//*[@id='div-app-name-dropdown-Virtual-Infrastructure-Deployment']
281      Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::input[@id='Standard-User-checkbox']
282      Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::input[@id='System-Administrator-checkbox']
283      Set Selenium Implicit Wait    3000
284      Click Button    xpath=//button[@id='new-user-save-button']
285      Set Selenium Implicit Wait    3000
286      Page Should Contain      Users
287      #Click Button    xpath=//input[@id='dropdown1']
288      #Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
289      Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
290      Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   System Administrator
291      
292      
293  Portal admin Delete Standard User Existing user    
294      [Documentation]    Naviage to Users tab
295      Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
296      Scroll Element Into View    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::*[@id='app-item-delete'][1]
297      Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::*[@id='app-item-delete'][1]
298      Click Element    xpath=//button[@id='div-confirm-ok-button']
299      Click Button    xpath=//button[@id='new-user-save-button']
300      #Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
301      #Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2]  
302       Element Should Not Contain     xpath=//*[@table-data='users.accountUsers']    portal  
303      
304      
305      
306      
307 Functional Top Menu Get Access     
308     [Documentation]    Naviage to Support tab
309      Click Link    xpath=//a[contains(.,'Support')]
310      Mouse Over    xpath=//*[contains(text(),'Get Access')]
311      Click Link    xpath=//a[contains(.,'Get Access')]
312      Element Text Should Be    xpath=//h1[contains(.,'Get Access')]    Get Access
313      
314      
315 Functional Top Menu Contact Us     
316     [Documentation]    Naviage to Support tab
317      Click Link    xpath=//a[contains(.,'Support')]
318      Mouse Over    xpath=//*[contains(text(),'Contact Us')]
319      Click Link    xpath=//a[contains(.,'Contact Us')]
320      Element Text Should Be    xpath=//h1[contains(.,'Contact Us')]    Contact Us    
321      Click Image    xpath=//img[@alt='Onap Logo'] 
322      
323
324 Portal admin Edit Functional menu  
325     [Documentation]    Naviage to Edit Functional menu tab
326     Click Link    xpath=//a[@title='Edit Functional Menu']
327     Click Link    xpath=.//*[@id='Manage']/div/a
328     Click Link    xpath=.//*[@id='Design']/div/a
329     Click Link    xpath=.//*[@id='Product_Design']/div/a
330     Open Context Menu    xpath=//*[@id='Product_Design']/div/span
331     Click Link    xpath=//a[@href='#add']
332     Input Text    xpath=//input[@id='input-title']    ONAP Test
333     #Input Text    xpath=//input[@id='input-url']    http://google.com
334     Click Element     xpath=//input[@id='select-app']
335     Scroll Element Into View    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
336     Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
337     Input Text    xpath=//input[@id='input-url']    http://google.com
338     Click Button    xpath=//button[@id='button-save-continue']
339     #Click Button    xpath=//div[@title='Select Roles']
340     Click Element    xpath=//*[@id='app-select-Select Roles']
341     Click Element    xpath=//input[@id='Standard-User-checkbox']
342     Click Element    xpath=//button[@id='button-save-add']
343     Click Image     xpath=//img[@alt='Onap Logo']
344     Set Selenium Implicit Wait    3000
345     Click Link    xpath=//a[contains(.,'Manage')]
346      Mouse Over    xpath=//*[contains(text(),'Design')]
347      Set Selenium Implicit Wait    3000
348      Element Text Should Be    xpath=//a[contains(.,'ONAP Test')]      ONAP Test  
349      Set Selenium Implicit Wait    3000
350       Click Link    xpath=//a[@title='Edit Functional Menu']
351     Click Link    xpath=.//*[@id='Manage']/div/a
352     Click Link    xpath=.//*[@id='Design']/div/a
353     Click Link    xpath=.//*[@id='Product_Design']/div/a
354     Open Context Menu    xpath=//*[@id='ONAP_Test']
355     Click Link    xpath=//a[@href='#delete']
356      Set Selenium Implicit Wait    3000
357      Click Element    xpath=//button[@id='div-confirm-ok-button']
358      Click Image     xpath=//img[@alt='Onap Logo']
359     Set Selenium Implicit Wait    3000
360     Click Link    xpath=//a[contains(.,'Manage')]
361      Mouse Over    xpath=//*[contains(text(),'Design')]
362      Set Selenium Implicit Wait    3000
363      Element Should Not Contain    xpath=(.//*[contains(.,'Design')]/following::ul[1])[1]      ONAP Test  
364      
365     
366      
367      
368     
369     
370     
371     
372 Portal admin Microservice Onboarding
373      [Documentation]    Naviage to Edit Functional menu tab
374      Click Link    xpath=//a[@title='Microservice Onboarding']
375      Click Button    xpath=//button[@id='microservice-onboarding-button-add']
376      Input Text    xpath=//input[@name='name']    Test Microservice
377      Input Text    xpath=//*[@name='desc']    Test
378      Click Element    xpath=//input[@id='microservice-details-input-app']
379      Scroll Element Into View    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
380      Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
381      Click Element     xpath=//*[@name='desc']
382      Input Text    xpath=//input[@name='url']    ${PORTAL_MICRO_ENDPOINT}
383      Click Element    xpath=//input[@id='microservice-details-input-security-type']
384      Scroll Element Into View    xpath=//li[contains(.,'Basic Authentication')]
385      Click Element    xpath=//li[contains(.,'Basic Authentication')]
386      Input Text    xpath=//input[@name='username']    ${GLOBAL_PORTAL_ADMIN_USER}
387      Input Text    xpath=//input[@name='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
388      Click Button    xpath=//button[@id='microservice-details-save-button']
389      #Table Column Should Contain    xpath=//*[@table-data='serviceList']    0    Test Microservice
390      Element Text Should Be    xpath=//*[@table-data='serviceList']    Test Microservice
391      
392     
393     
394 Portal Admin Create Widget for All users 
395     [Documentation]    Naviage to Create Widget menu tab
396     ${WidgetAttachment}=    Catenate    ${PORTAL_ASSETS_DIRECTORY}\\widget_news.zip
397     Click Link    xpath=//a[@title='Widget Onboarding']
398     Click Button    xpath=//button[@id='widget-onboarding-button-add']
399     Input Text    xpath=//*[@name='name']    ONAP-VID
400     Input Text    xpath=//*[@name='desc']    ONAP VID
401     Click Element    xpath=//*[@id='widgets-details-input-endpoint-url']
402     Scroll Element Into View    xpath=//li[contains(.,'Test Microservice')]
403     Click Element    xpath=//li[contains(.,'Test Microservice')]
404     Click Element    xpath=//*[contains(text(),'Allow all user access')]/preceding::input[@ng-model='widgetOnboardingDetails.widget.allUser'][1] 
405     Choose File    xpath=//input[@id='widget-onboarding-details-upload-file']    ${WidgetAttachment}
406     Click Button    xpath=//button[@id='widgets-details-save-button']
407     Wait Until Page Contains    ONAP-VID    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
408     Page Should Contain    ONAP-VID
409      Set Selenium Implicit Wait    3000
410     GO TO    ${PORTAL_HOME_PAGE}
411     
412     
413 Portal Admin Delete Widget for All users 
414      [Documentation]    Naviage to delete Widget menu tab
415      #Wait Until Page Contains    ONAP-VID    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
416      #Page Should Contain    ONAP-VID
417      #Click Image    xpath=//img[@alt='Onap Logo']
418      Click Link    xpath=//a[@title='Widget Onboarding']
419      Click Element    xpath=//input[@id='dropdown1']
420     Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
421      #Wait Until Page Contains    xpath=(.//*[contains(text(),'ONAP-VID')]/followi
422      #Wait Until Page Contains    xpath=(.//*[contains(text(),'ONAP-VID')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
423      Click Element    xpath=(.//*[contains(text(),'ONAP-VID')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]
424      Click Element    xpath=//button[@id='div-confirm-ok-button']
425      Set Selenium Implicit Wait    3000
426      Element Should Not Contain     xpath=//*[@table-data='portalAdmin.portalAdminsTableData']    ONAP-VID
427      #Is Element Visible    xpath=//*[@table-data='portalAdmin.portalAdminsTableData']
428      #Table Column Should Contain    .//*[@table-data='portalAdmin.portalAdminsTableData']    0       ONAP-VID    
429      #Set Selenium Implicit Wait    3000
430     
431     
432 Portal Admin Create Widget for Application Roles 
433     [Documentation]    Naviage to Create Widget menu tab 
434     ${WidgetAttachment}=    Catenate    ${PORTAL_ASSETS_DIRECTORY}\\widget_news.zip 
435     Click Link    xpath=//a[@title='Widget Onboarding'] 
436     Click Button    xpath=//button[@id='widget-onboarding-button-add'] 
437     Input Text    xpath=//*[@name='name']    ONAP-VID 
438     Input Text    xpath=//*[@name='desc']    ONAP VID 
439     Click Element    xpath=//*[@id='widgets-details-input-endpoint-url'] 
440     Scroll Element Into View    xpath=//li[contains(.,'Test Microservice')] 
441     Click Element    xpath=//li[contains(.,'Test Microservice')] 
442     Click element    xpath=//*[@id="app-select-Select Applications"] 
443     click element    xpath=//*[@id="Virtual-Infrastructure-Deployment-checkbox"] 
444     Click element    xpath=//*[@name='desc'] 
445     click element    xpath=//*[@id="app-select-Select Roles"] 
446     click element    xpath=//*[@id="Standard-User-checkbox"] 
447     Click element    xpath=//*[@name='desc'] 
448     Scroll Element Into View    xpath=//input[@id='widget-onboarding-details-upload-file'] 
449     Choose File    xpath=//input[@id='widget-onboarding-details-upload-file']    ${WidgetAttachment} 
450     Click Button    xpath=//button[@id='widgets-details-save-button'] 
451      Click Image     xpath=//img[@alt='Onap Logo']
452     Set Selenium Implicit Wait    3000
453     #Wait Until Page Contains    ONAP-VID    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
454     Click Link    xpath=//a[@title='Widget Onboarding'] 
455     Click Element    xpath=//input[@id='dropdown1']
456     Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
457     Page Should Contain    ONAP-VID 
458     Set Selenium Implicit Wait    3000 
459     GO TO    ${PORTAL_HOME_PAGE}
460     
461     
462     
463     
464  Portal Admin Delete Widget for Application Roles 
465      [Documentation]    Naviage to delete Widget menu tab
466      #Wait Until Page Contains    ONAP-VID    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
467      #Page Should Contain    ONAP-VID
468      #Click Image    xpath=//img[@alt='Onap Logo']
469      Click Link    xpath=//a[@title='Widget Onboarding']
470      Click Element    xpath=//input[@id='dropdown1']
471     Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
472      #Wait Until Page Contains    xpath=(.//*[contains(text(),'ONAP-VID')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
473      Click Element    xpath=(.//*[contains(text(),'ONAP-VID')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]
474      Click Element    xpath=//button[@id='div-confirm-ok-button']
475      Set Selenium Implicit Wait    3000
476      Element Should Not Contain     xpath=//*[@table-data='portalAdmin.portalAdminsTableData']    ONAP-VID
477      #Is Element Visible    xpath=//*[@table-data='portalAdmin.portalAdminsTableData']
478      #Table Column Should Contain    .//*[@table-data='portalAdmin.portalAdminsTableData']    0       ONAP-VID    
479      #Set Selenium Implicit Wait    3000   
480     
481     
482     
483 Portal Admin Edit Widget
484     [Documentation]    Naviage to Home tab  
485     #Mouse Over    xpath=(//h3[contains(text(),'News')]/following::span[1])[1]
486     Click Element    xpath=(//h3[contains(text(),'News')]/following::span[1])[1]
487     Set Browser Implicit Wait    8000
488     #Wait Until Element Is Visible    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1]    60
489     Mouse Over    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1] 
490     Click Link    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1]
491     Input Text    xpath=//input[@name='title']    ONAP_VID
492     Input Text    xpath=//input[@name='url']    http://about.att.com/news/international.html
493     Input Text    xpath=//input[@id='widget-input-add-order']    5
494     Click Link    xpath=//a[contains(.,'Add New')]
495     Click Element    xpath=//div[@id='close-button']
496     Element Should Contain    xpath=//*[@table-data='ignoredTableData']    ONAP_VID
497     Click Element    xpath=.//div[contains(text(),'ONAP_VID')]/following::*[contains(text(),'5')][1]/following::div[@ng-click='remove($index);'][1]
498     Click Element    xpath=//div[@id='confirmation-button-next']
499     Element Should Not Contain    xpath=//*[@table-data='ignoredTableData']    ONAP_VID
500     Click Link    xpath=//a[@id='close-button']
501     
502     
503     
504     
505 Portal Admin Broadcast Notifications 
506     [Documentation]   Portal Test Admin Broadcast Notifications 
507     ${CurrentDay}=    Get Current Date    result_format=%m/%d/%Y 
508     ${NextDay}=    Get Current Date    increment=24:00:00    result_format=%m/%d/%Y 
509     ${CurrentDate}=    Get Current Date    result_format=%m%d%y%H%M
510     ${AdminBroadCastMsg}=    catenate    ONAP VID Broadcast Automation${CurrentDate} 
511     Click Image     xpath=//img[@alt='Onap Logo']
512     Set Selenium Implicit Wait    3000
513     Click Link    xpath=//*[@id="parent-item-User-Notifications"] 
514     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
515     Click button    xpath=//*[@id="button-openAddNewApp"] 
516     Input Text    xpath=//input[@id='datepicker-start']     ${CurrentDay} 
517     Input Text    xpath=//input[@id='datepicker-end']     ${NextDay} 
518     Input Text    xpath=//*[@id="add-notification-input-title"]    ONAP VID Broadcast Automation 
519     Input Text    xpath=//*[@id="user-notif-input-message"]    ${AdminBroadCastMsg} 
520     click element    xpath=//*[@id="button-notification-save"] 
521     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
522     click element    xpath=//*[@id="megamenu-notification-button"] 
523     click element    xpath=//*[@id="notification-history-link"] 
524     Wait until Element is visible    xpath=//*[@id="notification-history-table"]    timeout=10 
525     Table Column Should Contain    xpath=//*[@id="notification-history-table"]    2    ${AdminBroadCastMsg} 
526     log    ${AdminBroadCastMsg} 
527     [Return]     ${AdminBroadCastMsg}
528         
529 Portal Admin Category Notifications 
530     [Documentation]   Portal Admin Broadcast Notifications 
531     ${CurrentDay}=    Get Current Date    result_format=%m/%d/%Y 
532     ${NextDay}=    Get Current Date    increment=24:00:00    result_format=%m/%d/%Y 
533     ${CurrentDate}=    Get Current Date    result_format=%m%d%y%H%M
534     ${AdminCategoryMsg}=    catenate    ONAP VID Category Automation${CurrentDate} 
535     Click Link    xpath=//a[@id='parent-item-Home'] 
536     Click Link    xpath=//*[@id="parent-item-User-Notifications"] 
537     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
538     Click button    xpath=//*[@id="button-openAddNewApp"]
539     #Select Radio Button    NO     radio-button-no
540     Click Element    //*[contains(text(),'Broadcast to All Categories')]/following::*[contains(text(),'No')][1]
541     #Select Radio Button    //label[@class='radio']    radio-button-approles
542     Click Element    xpath=//*[contains(text(),'Categories')]/following::*[contains(text(),'Application Roles')][1]
543     Click Element    xpath=//*[contains(text(),'Virtual Infrastructure Deployment')]/preceding::input[@ng-model='member.isSelected'][1] 
544     Input Text    xpath=//input[@id='datepicker-start']     ${CurrentDay} 
545     Input Text    xpath=//input[@id='datepicker-end']     ${NextDay} 
546     Input Text    xpath=//*[@id="add-notification-input-title"]    ONAP VID Category Automation 
547     Input Text    xpath=//*[@id='user-notif-input-message']    ${AdminCategoryMsg} 
548     click element    xpath=//*[@id="button-notification-save"] 
549     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
550     click element    xpath=//*[@id="megamenu-notification-button"] 
551     click element    xpath=//*[@id="notification-history-link"] 
552     Wait until Element is visible    xpath=//*[@id="notification-history-table"]    timeout=10 
553     Table Column Should Contain    xpath=//*[@id="notification-history-table"]    2    ${AdminCategoryMsg} 
554     log    ${AdminCategoryMsg}   
555      [Return]     ${AdminCategoryMsg}  
556     
557     
558  Portal admin Logout from Portal GUI
559     [Documentation]   Logout from Portal GUI
560     Click Element    xpath=//div[@id='header-user-icon']
561     Click Button    xpath=//button[contains(.,'Log out')]
562     Title Should Be    Login
563     
564     
565     
566 Application admin Login To Portal GUI
567     [Documentation]   Logs into Portal GUI
568     # Setup Browser Now being managed by test case
569     ##Setup Browser
570     Go To    ${PORTAL_LOGIN_URL}
571     Maximize Browser Window
572     Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
573     Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
574     Log    Logging in to ${GLOBAL_PORTAL_SERVER}${PORTAL_ENV}
575    # Handle Proxy Warning
576     Title Should Be    Login
577     Input Text    xpath=//input[@ng-model='loginId']    ${GLOBAL_APP_ADMIN_USER}
578     Input Password    xpath=//input[@ng-model='password']    ${GLOBAL_APP_ADMIN_PWD}
579     Click Link    xpath=//a[@id='loginBtn']
580     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}    
581     Log    Logged in to ${GLOBAL_PORTAL_SERVER}${PORTAL_ENV}    
582     
583 Application Admin Navigation Application Link Tab    
584     [Documentation]   Logs into Portal GUI as application admin
585     Click Link    xpath=//a[@id='parent-item-Home']
586     Click Element    xpath=.//h3[contains(text(),'Virtual Infras...')]/following::div[1]
587     Page Should Contain    Welcome to VID
588     Click Element    xpath=//i[@class='ion-close-round']    
589     Click Element    xpath=(.//span[@id='tab-Home'])[1]
590     
591     
592 Application Admin Navigation Functional Menu     
593     [Documentation]   Logs into Portal GUI as application admin
594     Click Link    xpath=//a[contains(.,'Manage')]
595      Mouse Over    xpath=//*[contains(text(),'Technology Insertion')]
596      Click Link    xpath= //*[contains(text(),'Infrastructure VNF Provisioning')] 
597      Page Should Contain    Welcome to VID
598      Click Element    xpath=//i[@class='ion-close-round']
599      Click Element    xpath=(.//span[@id='tab-Home'])[1]
600      
601      
602 Application admin Add Standard User Existing user   
603      [Documentation]    Naviage to Users tab
604      Click Link    xpath=//a[@title='Users']
605      Page Should Contain      Users
606      Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
607      Input Text    xpath=//input[@id='input-user-search']    ${Existing_User}
608      Click Button    xpath=//button[@id='button-search-users']
609      Click Element    xpath=//span[@id='result-uuid-0']
610      Click Button    xpath=//button[@id='next-button']
611      Click Element    xpath=//*[@id='div-app-name-dropdown-Virtual-Infrastructure-Deployment']
612      Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::input[@id='Standard-User-checkbox']
613      Set Selenium Implicit Wait    3000
614      Click Button    xpath=//button[@id='new-user-save-button']
615      Set Selenium Implicit Wait    3000
616      #Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
617      #Select From List    xpath=//input[@value='Select application']    Virtual Infrastructure Deployment
618      #Click Link    xpath=//a[@title='Users']
619      #Page Should Contain      Users
620      Go To    ${PORTAL_HOME_PAGE}
621      Set Selenium Implicit Wait    3000
622      Click Link    xpath=//a[@title='Users']
623      Click Element    xpath=//input[@id='dropdown1']
624      Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
625      Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
626      Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Standard User
627      
628      
629 Application admin Edit Standard User Existing user  
630      [Documentation]    Naviage to Users tab
631      Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
632      Click Element    xpath=//*[@id='div-app-name-dropdown-Virtual-Infrastructure-Deployment']
633      Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::input[@id='Standard-User-checkbox']
634      Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::input[@id='System-Administrator-checkbox']
635      Set Selenium Implicit Wait    3000
636      Click Button    xpath=//button[@id='new-user-save-button']
637      Set Selenium Implicit Wait    3000
638      Page Should Contain      Users
639      #Click Button    xpath=//input[@id='dropdown1']
640      #Click Element    xpath=//li[contains(.,'Virtual Infrastructure Deployment')]
641      Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
642      Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   System Administrator
643      
644      
645 Application admin Delete Standard User Existing user    
646      [Documentation]    Naviage to Users tab
647      Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
648      Scroll Element Into View    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::*[@id='app-item-delete'][1]
649      Click Element    xpath=//*[@id='div-app-name-Virtual-Infrastructure-Deployment']/following::*[@id='app-item-delete'][1]
650      Click Element    xpath=//button[@id='div-confirm-ok-button']
651      Click Button    xpath=//button[@id='new-user-save-button']
652      #Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
653      #Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2] 
654      Element Should Not Contain     xpath=//*[@table-data='users.accountUsers']    Portal   
655      
656      
657      
658 Application admin Logout from Portal GUI
659     [Documentation]   Logout from Portal GUI
660     Click Element    xpath=//div[@id='header-user-icon']
661     Click Button    xpath=//button[contains(.,'Log out')]
662     #Confirm Action     
663     Title Should Be    Login   
664     
665     
666 Standared user Login To Portal GUI
667     [Documentation]   Logs into Portal GUI
668     # Setup Browser Now being managed by test case
669     ##Setup Browser
670     Go To    ${PORTAL_LOGIN_URL}
671     Maximize Browser Window
672     Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
673     Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
674     Log    Logging in to ${GLOBAL_PORTAL_SERVER}${PORTAL_ENV}
675    # Handle Proxy Warning
676     Title Should Be    Login
677     Input Text    xpath=//input[@ng-model='loginId']    ${GLOBAL_STA_USER_USER}
678     Input Password    xpath=//input[@ng-model='password']    ${GLOBAL_STA_USER_PWD}
679     Click Link    xpath=//a[@id='loginBtn']
680     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}    
681     Log    Logged in to ${GLOBAL_PORTAL_SERVER}${PORTAL_ENV}       
682      
683  
684 Standared user Navigation Application Link Tab    
685     [Documentation]   Logs into Portal GUI as application admin
686     #Portal admin Go To Portal HOME
687     Click Element    xpath=.//h3[contains(text(),'Virtual Infras...')]/following::div[1]
688     Page Should Contain    Welcome to VID    
689     Click Element    xpath=(.//span[@id='tab-Home'])[1]
690     
691     
692 Standared user Navigation Functional Menu     
693     [Documentation]   Logs into Portal GUI as application admin
694     Click Link    xpath=//a[contains(.,'Manage')]
695      Mouse Over    xpath=//*[contains(text(),'Technology Insertion')]
696      Click Link    xpath= //*[contains(text(),'Infrastructure VNF Provisioning')] 
697      Page Should Contain    Welcome to VID
698      Click Element    xpath=(.//span[@id='tab-Home'])[1]   
699      
700      
701      
702 Standared user Broadcast Notifications 
703     [Documentation]   Logs into Portal GUI as application admin 
704     [Arguments]    ${AdminBroadCastMsg}
705     Click element    xpath=//*[@id='megamenu-notification-button'] 
706     Click element    xpath=//*[@id='notification-history-link'] 
707     Wait until Element is visible    xpath=//*[@id='app-title']    timeout=10 
708     Table Column Should Contain    xpath=//*[@id='notification-history-table']    2    ${AdminBroadCastMsg} 
709     log    ${AdminBroadCastMsg}   
710     
711    
712 Standared user Category Notifications 
713     [Documentation]   Logs into Portal GUI as application admin 
714     [Arguments]    ${AdminCategoryMsg}
715     #click element    xpath=//*[@id='megamenu-notification-button'] 
716     #click element    xpath=//*[@id="notification-history-link"] 
717     Wait until Element is visible    xpath=//*[@id='app-title']    timeout=10 
718     Table Column Should Contain    xpath=//*[@id='notification-history-table']    2    ${AdminCategoryMsg} 
719     log    ${AdminCategoryMsg} 
720     
721     
722 Standared user Logout from Portal GUI
723     [Documentation]   Logout from Portal GUI
724     Click Element    xpath=//div[@id='header-user-icon']
725     Click Button    xpath=//button[contains(.,'Log out')]
726     #Confirm Action     
727     Title Should Be    Login     
728         
729      
730      
731      
732 Tear Down     
733     [Documentation]   Close all browsers
734     Close All Browsers
735     
736
737  
738  
739  
740     
741