upgrade to python3 libraries
[testsuite.git] / robot / resources / portal-sdk / portalDef.robot
1 *** Settings ***
2 Documentation    This is RobotFrame work script
3 Library         SeleniumLibrary
4 Library         OperatingSystem
5 Library         RequestsLibrary
6 Library         UUID
7 Library         DateTime
8 Library         Collections
9 Library         OSUtils
10 Library         StringTemplater
11 Library         String
12
13 Resource        ../json_templater.robot
14 Resource        ../browser_setup.robot
15
16 *** Variables ***
17 #${PORTAL_URL}      http://portal.api.simpledemo.onap.org:8989
18 ${PORTAL_URL}       ${GLOBAL_PORTAL_SERVER_PROTOCOL}://${GLOBAL_INJECTED_PORTAL_IP_ADDR}:${GLOBAL_PORTAL_SERVER_PORT}
19 ${PORTAL_ENV}       /ONAPPORTAL
20 ${PORTAL_LOGIN_URL}                ${PORTAL_URL}${PORTAL_ENV}/login.htm
21 ${PORTAL_HOME_PAGE}        ${PORTAL_URL}${PORTAL_ENV}/applicationsHome
22 ${PORTAL_MICRO_ENDPOINT}    ${PORTAL_URL}${PORTAL_ENV}/commonWidgets
23 ${PORTAL_HOME_URL}                ${PORTAL_URL}${PORTAL_ENV}/applicationsHome
24 ${PORTAL_HEALTH_CHECK_PATH}        ${PORTAL_ENV}/portalApi/healthCheck
25 ${PORTAL_XDEMPAPP_REST_URL}        ${PORTAL_URL}/ONAPPORTALSDK/api/v2
26 ${PORTAL_ASSETS_DIRECTORY}    ../../assets/widgets/
27 ${GLOBAL_APPLICATION_ID}           robot-functional
28 ${GLOBAL_PORTAL_ADMIN_USER}             demo
29 ${GLOBAL_PORTAL_ADMIN_PWD}              demo123456!
30 ${GLOBAL_MSO_STATUS_PATH}    /ecomp/mso/infra/orchestrationRequests/v2/
31 ${GLOBAL_BUILD_NUMBER}    0
32 ${GLOBAL_VM_PRIVATE_KEY}   ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt
33 ${jira}    jira
34 ${RESOURCE_PATH}    ${PORTAL_URL}/auxapi/ticketevent
35 ${portal_Template}    ${CURDIR}/portal.template
36
37
38 ${download_link_id}    0
39
40
41 *** Keywords ***
42
43 Generate Random User Name
44     ${RAND}    Generate Random String    4    [NUMBERS]
45     ${App_LoginID}=     Set Variable    demoapp${RAND}
46     ${App_Email_Address}=    Set Variable    demoapp${RAND}@onap.com
47     ${Sta_LoginID}=    Set Variable    demosta${RAND}
48     ${Sta_Email_Address}=    Set Variable    demosta${RAND}@onap.com
49     ${Test_LoginID}=    Set Variable    portal${RAND}
50     ${Test_Email_Address}=    Set Variable    portal${RAND}@onap.com
51     ${AppUserName}=           Set Variable    testApp${RAND}
52     ${AppPassword}=           Set Variable    testApp${RAND}123!
53     Set Suite Variable  ${App_LoginID}
54     Set Suite Variable  ${App_Email_Address}
55     Set Suite Variable  ${Sta_LoginID}
56     Set Suite Variable  ${Sta_Email_Address}
57     Set Suite Variable  ${Test_LoginID}
58     Set Suite Variable  ${Test_Email_Address}
59     Set Suite Variable  ${AppUserName}
60     Set Suite Variable  ${AppPassword}
61
62
63 Portal admin Login To Portal GUI
64     [Documentation]   Logs into Portal GUI
65     ## Setup Browser Now being managed by test case
66     Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
67     Setup Browser
68     # Open Browser    ${PORTAL_LOGIN_URL}    chrome
69     Go To    ${PORTAL_LOGIN_URL}
70     # Maximize Browser Window
71     Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
72     Log    Logging in to ${PORTAL_URL}${PORTAL_ENV}
73     #Handle Proxy Warning
74     Title Should Be    Login
75     Input Text    xpath=//input[@ng-model='loginId']    ${GLOBAL_PORTAL_ADMIN_USER}
76     Input Password    xpath=//input[@ng-model='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
77     Click Link    xpath=//a[@id='loginBtn']
78     Sleep    5s
79     Go To    ${PORTAL_HOME_URL}
80     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
81         #Execute Javascript    document.getElementById('w-ecomp-footer').style.display = 'none'
82         Log    Logged in to ${PORTAL_URL}${PORTAL_ENV}
83
84 Portal admin Go To Portal HOME
85     [Documentation]    Naviage to Portal Home
86     Go To    ${PORTAL_HOME_URL}
87     Wait Until Page Contains Element    xpath=//div[@class='applicationWindow']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}   
88 Portal admin User Notifications 
89     [Documentation]    Naviage to User notification tab
90     Click Link    xpath=//a[@id='parent-item-User-Notifications']
91     Wait Until Element Is Visible    xpath=//h1[@class='heading-page']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
92     Click Button    xpath=//button[@id='button-openAddNewApp']
93     Click Button    xpath=(//button[@id='undefined'])[1]
94     #Click Button    xpath=//input[@id='datepicker-start']   
95     
96 Portal admin Add Application Admin Exiting User 
97     [Documentation]    Naviage to Admins tab
98     Wait Until Element Is Visible    xpath=//a[@title='Admins']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
99     Click Link    xpath=//a[@title='Admins']
100     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
101     Page Should Contain      Admins
102         Click Button    xpath=//button[@ng-click='toggleSidebar()']
103     Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
104     Input Text    xpath=//input[@id='input-user-search']    ${Test_LoginID}
105     Click Button    xpath=//button[@id='button-search-users']
106     Click Element    xpath=//span[@id='result-uuid-0']
107     Click Button    xpath=//button[@id='search-users-button-next']
108     Click Button    xpath=//input[@value='Select application']
109     Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App' )])[1]    
110     Click Element    xpath=(//li[contains(.,'xDemo App' )])[2]
111     #Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'Default' )])[1]
112     #Click Element    xpath=(//li[contains(.,'Default' )])[2]
113     #Select From List    xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App')])[1]   xDemo App
114     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
115     Click Element    xpath=//button[@id='admin-div-ok-button']
116     Click Element    xpath=//button[@id='div-confirm-ok-button']
117     Get Selenium Implicit Wait
118     Click Link    xpath=//a[@aria-label='Admins']
119     Click Element    xpath=//input[@id='dropdown1']
120     #Click Element    xpath=//li[contains(.,'Default' )]
121     Click Element    xpath=//li[contains(.,'xDemo App' )]
122     Input Text    xpath=//input[@id='input-table-search']    ${Test_LoginID}
123         Table Column Should Contain    xpath=//*[@table-data='admins.adminsTableData']    1    ${Test_LoginID}
124     #Element Text Should Be      xpath=(//span[contains(.,'portal')])[1]   ${Test_LoginID}
125         #Element Text Should Be      xpath=(//span[contains(.,'demo')])[1]   ${Test_LoginID}
126
127 Portal admin Delete Application Admin Existing User  
128     [Documentation]    Naviage to Admins tab
129     Wait Until Element Is Visible    xpath=//a[@title='Admins']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
130     Click Link    xpath=//a[@title='Admins']
131     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
132     Page Should Contain      Admins
133         Click Button    xpath=//button[@ng-click='toggleSidebar()']
134     Input Text    xpath=//input[@id='input-table-search']    ${Test_LoginID}
135     Click Element    xpath=(//span[contains(.,'portal')] )[1] 
136         #Click Element    xpath=(//span[contains(.,'demo')] )[1]
137     Click Element    xpath=//*[@id='select-app-xDemo-App']/following::i[@id='i-delete-application']
138     #Click Element    xpath=//*[@id='select-app-Default']/following::i[@id='i-delete-application']
139     Click Element    xpath=//button[@id='div-confirm-ok-button']
140     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
141     Click Element    xpath=//button[@id='admin-div-ok-button']
142     #Is Element Visible      xpath=(//span[contains(.,'Portal')] )[2]
143     #Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2]
144     Element Should Not Contain     xpath=//*[@table-data='admins.adminsTableData']    portal
145         #Element Should Not Contain     xpath=//*[@table-data='admins.adminsTableData']    demo
146         Click Image     xpath=//img[@alt='Onap Logo']
147     Set Selenium Implicit Wait    3000
148
149 Portal admin Add Application admin User New user
150     [Documentation]    Naviage to Users tab
151     Click Link    xpath=//a[@title='Users']
152     Page Should Contain      Users
153         Click Button    xpath=//button[@ng-click='toggleSidebar()']
154     Click Button    xpath=//button[@id='users-button-add']
155     Click Button    xpath=//button[@id='Create-New-User-button']
156     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${App_LoginID}
157     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${GLOBAL_PORTAL_ADMIN_USER}
158     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${App_Email_Address}
159     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${App_LoginID}
160     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${GLOBAL_PORTAL_ADMIN_PWD}
161     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${GLOBAL_PORTAL_ADMIN_PWD}
162     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
163     ${Result}=    Get Element Count     xpath=//*[contains(text(),'User with same loginId already exists')]
164
165     #log ${Result}
166     #${type_result}= Evaluate type(${Result})
167     #log ${type_result}
168
169     Run Keyword if     '${Result}'== 0     AdminUser does not exist already
170     ...    ELSE     Goto Home Image
171     Set Selenium Implicit Wait    3000
172
173 Goto Home Image
174     Click Image    xpath=//img[@alt='Onap Logo']
175
176 AdminUser does not exist already        
177     Click Button    xpath=//button[@id='next-button']
178     #Scroll Element Into View    xpath=//div[@id='div-app-name-dropdown-xDemo-App']
179     Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
180     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
181     Set Selenium Implicit Wait    3000
182     Click Button    xpath=//button[@id='new-user-save-button']
183     Set Selenium Implicit Wait    3000
184     Go To    ${PORTAL_HOME_PAGE}
185     Click Link    xpath=//a[@title='Users']
186     Click Element    xpath=//input[@id='dropdown1']
187     Click Element    xpath=//li[contains(.,'xDemo App')]
188         Table Column Should Contain    xpath=//*[@table-data='users.accountUsers']    1    ${App_LoginID}
189     #Input Text    xpath=//input[@id='input-table-search']    ${App_LoginID}
190     #Element Text Should Be      xpath=(//span[contains(.,'demoapp')] )[1]   ${App_LoginID}
191         Click Image     xpath=//img[@alt='Onap Logo']
192     Set Selenium Implicit Wait    3000
193
194 Portal admin Add Standard User New user
195     [Documentation]    Naviage to Users tab
196     Click Link    xpath=//a[@title='Users']
197     Page Should Contain      Users
198         Click Button    xpath=//button[@ng-click='toggleSidebar()']
199     Click Button    xpath=//button[@id='users-button-add']
200     Click Button    xpath=//button[@id='Create-New-User-button']
201     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${Sta_LoginID}
202     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${GLOBAL_PORTAL_ADMIN_USER}
203     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${Sta_Email_Address}
204     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${Sta_LoginID}
205     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${GLOBAL_PORTAL_ADMIN_PWD}
206     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${GLOBAL_PORTAL_ADMIN_PWD}
207     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
208         
209     ${Result}=    Get Element Count     xpath=//*[contains(text(),'User with same loginId already exists')]
210
211     #log ${Result}
212     #${type_result}= Evaluate type(${Result})
213     #log ${type_result}
214
215     Run Keyword if     '${Result}'== 0     StaUser does not exist already
216     ...    ELSE     Goto Home Image
217     Set Selenium Implicit Wait    3000
218
219 StaUser does not exist already          
220     Click Button    xpath=//button[@id='next-button']
221     #Scroll Element Into View    xpath=//div[@id='div-app-name-dropdown-xDemo-App']
222     Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
223     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
224     Set Selenium Implicit Wait    3000
225     Click Button    xpath=//button[@id='new-user-save-button']
226     Set Selenium Implicit Wait    3000
227     Go To    ${PORTAL_HOME_PAGE}
228     Click Link    xpath=//a[@title='Users']
229     Click Element    xpath=//input[@id='dropdown1']
230     Click Element    xpath=//li[contains(.,'xDemo App')]
231         Table Column Should Contain    xpath=//*[@table-data='users.accountUsers']    1    ${Sta_LoginID}
232     #Input Text    xpath=//input[@id='input-table-search']    ${Sta_LoginID}
233     #Element Text Should Be      xpath=(//span[contains(.,'appdemo')] )[1]   ${Sta_LoginID}
234         Click Image     xpath=//img[@alt='Onap Logo']
235     Set Selenium Implicit Wait    3000
236
237 Portal admin Add Application admin User New user -Test
238     [Documentation]    Naviage to Users tab
239     Click Link    xpath=//a[@title='Users']
240     Page Should Contain      Users
241         Click Button    xpath=//button[@ng-click='toggleSidebar()']
242         Click Button    xpath=//button[@id='users-button-add']
243     Click Button    xpath=//button[@id='Create-New-User-button']
244     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${Test_LoginID}
245     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${GLOBAL_PORTAL_ADMIN_USER}
246     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${Test_Email_Address}
247     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${Test_LoginID}
248     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${GLOBAL_PORTAL_ADMIN_PWD}
249     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${GLOBAL_PORTAL_ADMIN_PWD}
250     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
251         Click Button    xpath=//button[@id='search-users-button-cancel']
252         Click Image     xpath=//img[@alt='Onap Logo']
253     Set Selenium Implicit Wait    3000
254
255
256 Portal admin Add Application Admin Exiting User -APPDEMO 
257     [Documentation]    Naviage to Admins tab
258     Wait Until Element Is Visible    xpath=//a[@title='Admins']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
259     Click Link    xpath=//a[@title='Admins']
260     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
261     Page Should Contain      Admins
262         Click Button    xpath=//button[@ng-click='toggleSidebar()']
263     Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
264     Input Text    xpath=//input[@id='input-user-search']    ${App_LoginID}
265     Click Button    xpath=//button[@id='button-search-users']
266     Click Element    xpath=//span[@id='result-uuid-0']
267     Click Button    xpath=//button[@id='search-users-button-next']
268     Click Button    xpath=//input[@value='Select application']
269     Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App' )])[1]
270     Click Element    xpath=(//li[contains(.,'xDemo App' )])[2]
271     #Select From List    xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App')])[1]   xDemo App
272     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
273     Click Element    xpath=//button[@id='admin-div-ok-button']
274     Click Element    xpath=//button[@id='div-confirm-ok-button']
275     Get Selenium Implicit Wait
276     Click Link    xpath=//a[@aria-label='Admins']
277     Click Element    xpath=//input[@id='dropdown1']
278     Click Element    xpath=//li[contains(.,'xDemo App' )]       
279     Input Text    xpath=//input[@id='input-table-search']    ${App_LoginID}
280     #Element Text Should Be      xpath=(//span[contains(.,'appdemo')])[1]   ${App_LoginID}
281         Table Column Should Contain    xpath=//*[@table-data='admins.adminsTableData']    1    ${App_LoginID}
282         Click Image     xpath=//img[@alt='Onap Logo']
283     Set Selenium Implicit Wait    3000  
284           
285 Portal admin Add Standard User Existing user   
286     [Documentation]    Naviage to Users tab
287     Click Link    xpath=//a[@title='Users']
288     Page Should Contain      Users
289         Click Button    xpath=//button[@ng-click='toggleSidebar()']
290     Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
291     Input Text    xpath=//input[@id='input-user-search']    ${Test_LoginID}
292     Click Button    xpath=//button[@id='button-search-users']
293     Click Element    xpath=//span[@id='result-uuid-0']
294     Click Button    xpath=//button[@id='next-button']
295     #Click Element    xpath=//*[@id='div-app-name-dropdown-Default']
296     #Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
297     Click Element    xpath=//div[@id='app-select-Select roles1']
298     Click Element    xpath=//div[@id='app-select-Select roles1']/following::input[@id='Standard-User-checkbox']
299     Set Selenium Implicit Wait    3000
300     Click Button    xpath=//button[@id='new-user-save-button']
301     Set Selenium Implicit Wait    3000
302     #Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
303     #Select From List    xpath=//input[@value='Select application']    xDemo App
304     #Click Link    xpath=//a[@title='Users']
305     #Page Should Contain      Users
306     #Focus    xpath=//input[@name='dropdown1']
307     Go To    ${PORTAL_HOME_PAGE}
308
309 Portal admin Edit Standard User Existing user
310     [Documentation]    Naviage to Users tab
311     Click Link    xpath=//a[@title='Users']
312     Click Element    xpath=//input[@id='dropdown1']
313     #Click Element    xpath=//li[contains(.,'Default')]
314     #Set Selenium Implicit Wait    3000
315     Click Element    xpath=//li[contains(.,'xDemo App')]
316     #Set Selenium Implicit Wait    3000
317     Input Text    xpath=//input[@id='input-table-search']    ${Test_LoginID}
318     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Standard User
319     Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
320     #Click Element    xpath=//*[@id='div-app-name-dropdown-Default']
321     #Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
322     #Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Portal-Notification-Admin-checkbox']
323     Click Element    xpath=//*[@id='app-select-Standard User1']
324     Click Element    xpath=//*[@id='app-select-Standard User1']/following::input[@id='Standard-User-checkbox']
325     Set Selenium Implicit Wait    3000
326     Click Button    xpath=//button[@id='new-user-save-button']
327     Set Selenium Implicit Wait    3000
328
329     Page Should Contain      Users
330         Click Button    xpath=//button[@ng-click='toggleSidebar()']
331     Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
332     Input Text    xpath=//input[@id='input-user-search']    ${Test_LoginID}
333     Click Button    xpath=//button[@id='button-search-users']
334     Click Element    xpath=//span[@id='result-uuid-0']
335     Click Button    xpath=//button[@id='next-button']
336     Click Element    xpath=//div[@id='app-select-Select roles1']
337     Click Element    xpath=//div[@id='app-select-Select roles1']/following::input[@id='System-Administrator-checkbox']
338     Set Selenium Implicit Wait    3000
339     #Click Element    xpath=//*[@id='app-select-Standard User1']
340     #Click Element    xpath=//*[@id='app-select-Standard User1']/following::input[@id='System-Administrator-checkbox']
341     # Click Element    xpath=//*[@id='div-app-name-dropdown-SDC']
342     # Click Element    xpath=//*[@id='div-app-name-SDC']/following::input[@id='Standard-User-checkbox']
343     # Click Element    xpath=//*[@id='div-app-name-SDC']/following::input[@id='Portal-Notification-Admin-checkbox']
344     Set Selenium Implicit Wait    3000
345     Click Button    xpath=//button[@id='new-user-save-button']
346     Set Selenium Implicit Wait    3000
347     Page Should Contain      Users
348     #Click Button    xpath=//input[@id='dropdown1']
349     #Click Element    xpath=//li[contains(.,'xDemo App')]
350     Input Text    xpath=//input[@id='input-table-search']    ${Test_LoginID}
351     #Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Portal Notification Admin
352     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   System Administrator
353     Set Selenium Implicit Wait    3000
354      
355 Portal admin Delete Standard User Existing user
356     [Documentation]    Naviage to Users tab
357     Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
358     #Scroll Element Into View    xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
359     #Click Element    xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
360     Set Selenium Implicit Wait    9000
361     Scroll Element Into View    xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
362     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
363     #Scroll Element Into View    xpath=//*[@id='div-app-name-SDC']/following::*[@id='app-item-delete'][1]
364     #Click Element    xpath=//*[@id='div-app-name-SDC']/following::*[@id='app-item-delete'][1]
365     Click Element    xpath=//button[@id='div-confirm-ok-button']
366     Click Button    xpath=//button[@id='new-user-save-button']
367     #Input Text    xpath=//input[@id='input-table-search']    ${Test_LoginID}
368     #Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2]
369     Element Should Not Contain     xpath=//*[@table-data='users.accountUsers']    Portal
370     #Element Should Not Contain     xpath=//*[@table-data='users.accountUsers']    demo
371     Set Selenium Implicit Wait    3000
372      
373 Functional Top Menu Get Access     
374     [Documentation]    Naviage to Support tab
375         Go To    ${PORTAL_HOME_URL}
376     Click Link    xpath=//a[contains(.,'Support')]
377     Mouse Over    xpath=//*[contains(text(),'Get Access')]
378     Click Link    xpath=//a[contains(.,'Get Access')]
379     Element Text Should Be    xpath=//h1[contains(.,'Get Access')]    Get Access
380     Set Selenium Implicit Wait    3000
381      
382 Functional Top Menu Contact Us     
383     [Documentation]    Naviage to Support tab
384     Click Link    xpath=//a[contains(.,'Support')]
385     Mouse Over    xpath=//*[contains(text(),'Contact Us')]
386     Click Link    xpath=//a[contains(.,'Contact Us')]
387     Element Text Should Be    xpath=//h1[contains(.,'Contact Us')]    Contact Us
388     Click Image    xpath=//img[@alt='Onap Logo']
389     Set Selenium Implicit Wait    3000
390
391 Portal admin Edit Functional menu
392     [Documentation]    Naviage to Edit Functional menu tab
393     Click Link    xpath=//a[@title='Edit Functional Menu']
394     Click Link    xpath=.//*[@id='Manage']/div/a
395     Click Link    xpath=.//*[@id='Design']/div/a
396     Click Link    xpath=.//*[@id='Product_Design']/div/a
397     Open Context Menu    xpath=//*[@id='Product_Design']/div/span
398     Click Link    xpath=//a[@href='#add']
399     Input Text    xpath=//input[@id='input-title']    ONAP Test
400     #Input Text    xpath=//input[@id='input-url']    http://google.com
401     Click Element     xpath=//input[@id='select-app']
402     Scroll Element Into View    xpath=//li[contains(.,'xDemo App')]
403     Click Element    xpath=//li[contains(.,'xDemo App')]
404     Input Text    xpath=//input[@id='input-url']    http://google.com
405     Click Button    xpath=//button[@id='button-save-continue']
406     #Click Button    xpath=//div[@title='Select Roles']
407     Click Element    xpath=//*[@id='app-select-Select Roles']
408     Click Element    xpath=//input[@id='Standard-User-checkbox']
409     Click Element    xpath=//button[@id='button-save-add']
410     Click Image     xpath=//img[@alt='Onap Logo']
411     Set Selenium Implicit Wait    3000
412     Click Link    xpath=//a[contains(.,'Manage')]
413     Mouse Over    xpath=//*[contains(text(),'Design')]
414     Set Selenium Implicit Wait    3000
415     Element Text Should Be    xpath=//a[contains(.,'ONAP Test')]      ONAP Test
416     Set Selenium Implicit Wait    3000
417         Click Image     xpath=//img[@alt='Onap Logo']
418     Click Link    xpath=//a[@title='Edit Functional Menu']
419     Click Link    xpath=.//*[@id='Manage']/div/a
420     Click Link    xpath=.//*[@id='Design']/div/a
421     Click Link    xpath=.//*[@id='Product_Design']/div/a
422     Open Context Menu    xpath=//*[@id='ONAP_Test']
423     Click Link    xpath=//a[@href='#delete']
424     Set Selenium Implicit Wait    3000
425     Click Element    xpath=//button[@id='div-confirm-ok-button']
426     Click Image     xpath=//img[@alt='Onap Logo']
427     Set Selenium Implicit Wait    3000
428     Click Link    xpath=//a[contains(.,'Manage')]
429     Mouse Over    xpath=//*[contains(text(),'Design')]
430     Set Selenium Implicit Wait    3000
431     Element Should Not Contain    xpath=(.//*[contains(.,'Design')]/following::ul[1])[1]      ONAP Test
432     Set Selenium Implicit Wait    3000
433     Click Image     xpath=//img[@alt='Onap Logo']
434     Set Selenium Implicit Wait    3000
435         
436 Portal admin Microservice Onboarding
437     [Documentation]    Naviage to Edit Functional menu tab
438     Click Link    xpath=//a[@title='Microservice Onboarding']
439     Click Button    xpath=//button[@id='microservice-onboarding-button-add']
440     Input Text    xpath=//input[@name='name']    Test Microservice
441     Input Text    xpath=//*[@name='desc']    Test
442     Click Element    xpath=//input[@id='microservice-details-input-app']
443     Scroll Element Into View    xpath=//li[contains(.,'xDemo App')]
444     Click Element    xpath=//li[contains(.,'xDemo App')]
445     Click Element     xpath=//*[@name='desc']
446     Input Text    xpath=//input[@name='url']    ${PORTAL_MICRO_ENDPOINT}
447     Click Element    xpath=//input[@id='microservice-details-input-security-type']
448     Scroll Element Into View    xpath=//li[contains(.,'Basic Authentication')]
449     Click Element    xpath=//li[contains(.,'Basic Authentication')]
450     Input Text    xpath=//input[@name='username']    ${GLOBAL_PORTAL_ADMIN_USER}
451     Input Text    xpath=//input[@name='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
452     Click Button    xpath=//button[@id='microservice-details-save-button']
453     Table Column Should Contain    xpath=//*[@table-data='serviceList']    1    Test Microservice
454     #Element Text Should Be    xpath=//*[@table-data='serviceList']    Test Microservice
455     Set Selenium Implicit Wait    3000
456
457 Portal admin Microservice Delete
458     [Documentation]    Naviage to Edit Functional menu tab
459     Click Link    xpath=//a[@title='Microservice Onboarding']
460     Click Button    xpath=//button[@id='microservice-onboarding-button-add']
461     Input Text    xpath=//input[@name='name']    TestMS
462     Input Text    xpath=//*[@name='desc']    TestMS
463     Click Element    xpath=//input[@id='microservice-details-input-app']
464     Scroll Element Into View    xpath=//li[contains(.,'xDemo App')]
465     Click Element    xpath=//li[contains(.,'xDemo App')]
466     Click Element     xpath=//*[@name='desc']
467     Input Text    xpath=//input[@name='url']    ${PORTAL_MICRO_ENDPOINT}
468     Click Element    xpath=//input[@id='microservice-details-input-security-type']
469     Scroll Element Into View    xpath=//li[contains(.,'Basic Authentication')]
470     Click Element    xpath=//li[contains(.,'Basic Authentication')]
471     Input Text    xpath=//input[@name='username']    ${GLOBAL_PORTAL_ADMIN_USER}
472     Input Text    xpath=//input[@name='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
473     Click Button    xpath=//button[@id='microservice-details-save-button']
474     Execute Javascript      window.scrollTo(0,document.body.scrollHeight);
475     Click Element    xpath=(.//*[contains(text(),'TestMS')]/following::*[@ng-click='microserviceOnboarding.deleteService(rowData)'])[1]
476     Click Button    xpath=//button[@id="div-confirm-ok-button"]
477     Set Selenium Implicit Wait    3000
478          
479 Portal Admin Create Widget for All users 
480     [Documentation]    Navigate to Create Widget menu tab
481     ${WidgetAttachment}=    Catenate    ${PORTAL_ASSETS_DIRECTORY}news_widget.zip
482     Wait until page contains Element    xpath=//a[@title='Widget Onboarding']     ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
483     Click Link    xpath=//a[@title='Widget Onboarding']
484         Click Button    xpath=//button[@ng-click='toggleSidebar()']
485     Click Button    xpath=//button[@id='widget-onboarding-button-add']
486     Input Text    xpath=//*[@name='name']    ONAP-xDemo
487     Input Text    xpath=//*[@name='desc']    ONAP xDemo
488     Click Element    xpath=//*[@id='widgets-details-input-endpoint-url']
489     Scroll Element Into View    xpath=//li[contains(.,'News Microservice')]
490     Click Element    xpath=//li[contains(.,'News Microservice')]
491     Click Element    xpath=//*[contains(text(),'Allow all user access')]/preceding::input[@ng-model='widgetOnboardingDetails.widget.allUser'][1] 
492     Choose File    xpath=//input[@id='widget-onboarding-details-upload-file']    ${WidgetAttachment}
493     Click Button    xpath=//button[@id='widgets-details-save-button']
494     Wait Until Page Contains      ONAP-xDemo    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
495     Page Should Contain    ONAP-xDemo
496     Set Selenium Implicit Wait    3000
497     GO TO    ${PORTAL_HOME_PAGE}
498
499 Portal Admin Delete Widget for All users 
500     [Documentation]    Naviage to delete Widget menu tab
501     #Wait Until Page Contains    ONAP-xDemo    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
502     #Page Should Contain    ONAP-xDemo
503     #Click Image    xpath=//img[@alt='Onap Logo']
504     Click Link    xpath=//a[@title='Widget Onboarding']
505     Click Element    xpath=//input[@id='dropdown1']
506     Click Element    xpath=//li[contains(.,'xDemo App')]
507     #Wait Until Page Contains    xpath=(.//*[contains(text(),'ONAP-xDemo')]/followi
508     #Wait Until Page Contains    xpath=(.//*[contains(text(),'ONAP-xDemo')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
509         Click Button    xpath=//button[@ng-click='toggleSidebar()']
510     Click Element    xpath=(.//*[contains(text(),'ONAP-xDemo')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]
511     Click Element    xpath=//button[@id='div-confirm-ok-button']
512     Set Selenium Implicit Wait    3000
513     Element Should Not Contain     xpath=//*[@table-data='portalAdmin.portalAdminsTableData']    ONAP-xDemo
514     #Is Element Visible    xpath=//*[@table-data='portalAdmin.portalAdminsTableData']
515     #Table Column Should Contain    .//*[@table-data='portalAdmin.portalAdminsTableData']    0       ONAP-xDemo
516     #Set Selenium Implicit Wait    3000
517     
518 Portal Admin Create Widget for Application Roles 
519     [Documentation]    Naviage to Create Widget menu tab 
520     ${WidgetAttachment}=    Catenate    ${PORTAL_ASSETS_DIRECTORY}news_widget.zip
521     Click Link    xpath=//a[@title='Widget Onboarding'] 
522         Click Button    xpath=//button[@ng-click='toggleSidebar()']
523     Click Button    xpath=//button[@id='widget-onboarding-button-add'] 
524     Input Text    xpath=//*[@name='name']    ONAP-xDemo 
525     Input Text    xpath=//*[@name='desc']    ONAP xDemo 
526     Click Element    xpath=//*[@id='widgets-details-input-endpoint-url'] 
527     Scroll Element Into View    xpath=//li[contains(.,'News Microservice')] 
528     Click Element    xpath=//li[contains(.,'News Microservice')] 
529     Click element    xpath=//*[@id="app-select-Select Applications"] 
530     Click element    xpath=//*[@id="xDemo-App-checkbox"]
531     Click element    xpath=//*[@name='desc'] 
532     Click element    xpath=//*[@id="app-select-Select Roles0"]
533     Click element    xpath=//*[@id="Standard-User-checkbox"]
534     Click element    xpath=//*[@name='desc'] 
535     Scroll Element Into View    xpath=//input[@id='widget-onboarding-details-upload-file'] 
536     Choose File    xpath=//input[@id='widget-onboarding-details-upload-file']    ${WidgetAttachment} 
537     Click Button    xpath=//button[@id='widgets-details-save-button'] 
538     Click Image     xpath=//img[@alt='Onap Logo']
539     Set Selenium Implicit Wait    3000
540     #Wait Until Page Contains    ONAP-xDemo    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
541     Click Link    xpath=//a[@title='Widget Onboarding'] 
542     Click Element    xpath=//input[@id='dropdown1']
543     Click Element    xpath=//li[contains(.,'xDemo App')]
544     Page Should Contain    ONAP-xDemo 
545     Set Selenium Implicit Wait    3000 
546     GO TO    ${PORTAL_HOME_PAGE}
547         
548 Portal Admin Delete Widget for Application Roles 
549     #Wait Until Page Contains    ONAP-xDemo    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
550     #Page Should Contain    ONAP-xDemo
551     #Click Image    xpath=//img[@alt='Onap Logo']
552     Click Link    xpath=//a[@title='Widget Onboarding']
553     Click Element    xpath=//input[@id='dropdown1']
554     Click Element    xpath=//li[contains(.,'xDemo App')]
555     #Wait Until Page Contains    xpath=(.//*[contains(text(),'ONAP-xDemo')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
556         Click Button    xpath=//button[@ng-click='toggleSidebar()']
557         Scroll Element Into View        xpath=//*[contains(text(),'ONAP-xDemo')]/following::td[3]/div
558     Click Element    xpath=//*[contains(text(),'ONAP-xDemo')]/following::td[3]/div
559     Click Element    xpath=//button[@id='div-confirm-ok-button']
560     Set Selenium Implicit Wait    3000
561     Element Should Not Contain     xpath=//*[@table-data='portalAdmin.portalAdminsTableData']    ONAP-xDemo
562     Set Selenium Implicit Wait    3000
563
564 Portal Admin Edit Widget
565     [Documentation]    Naviage to Home tab  
566     #Mouse Over    xpath=(//h3[contains(text(),'News')]/following::span[1])[1]
567     Click Element    xpath=(//h3[contains(text(),'News')]/following::span[1])[1]
568     Set Browser Implicit Wait    8000
569     #Wait Until Element Is Visible    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1]    60
570     Mouse Over    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1] 
571     Click Link    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1]
572     Input Text    xpath=//input[@name='title']    ONAP_VID
573     Input Text    xpath=//input[@name='url']    http://about.att.com/news/international.html
574     Input Text    xpath=//input[@id='widget-input-add-order']    5
575     Click Link    xpath=//a[contains(.,'Add New')]
576     Click Element    xpath=//div[@id='close-button']
577     Element Should Contain    xpath=//*[@table-data='ignoredTableData']    ONAP_VID
578     Click Element    xpath=.//div[contains(text(),'ONAP_VID')]/following::*[contains(text(),'5')][1]/following::div[@ng-click='remove($index);'][1]
579     Click Element    xpath=//div[@id='confirmation-button-next']
580     Element Should Not Contain    xpath=//*[@table-data='ignoredTableData']    ONAP_VID
581     Click Link    xpath=//a[@id='close-button']
582     Set Selenium Implicit Wait    3000    
583     
584 Portal Admin Broadcast Notifications 
585     [Documentation]   Portal Test Admin Broadcast Notifications 
586     ${CurrentDay}=    Get Current Date    increment=24:00:00    result_format=%m/%d/%Y 
587     ${NextDay}=    Get Current Date    increment=48:00:00    result_format=%m/%d/%Y 
588     ${CurrentDate}=    Get Current Date    increment=24:00:00    result_format=%m%d%y%H%M
589     ${AdminBroadCastMsg}=    catenate    ONAP VID Broadcast Automation${CurrentDate} 
590     Go To    ${PORTAL_HOME_URL}
591         Click Image     xpath=//img[@alt='Onap Logo']
592     Set Selenium Implicit Wait    3000
593     Click Link    xpath=//*[@id="parent-item-User-Notifications"] 
594     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
595     Click button    xpath=//*[@id="button-openAddNewApp"] 
596     Input Text    xpath=//input[@id='datepicker-start']     ${CurrentDay} 
597     Input Text    xpath=//input[@id='datepicker-end']     ${NextDay} 
598     Input Text    xpath=//*[@id="add-notification-input-title"]    ONAP VID Broadcast Automation 
599     Input Text    xpath=//*[@id="user-notif-input-message"]    ${AdminBroadCastMsg} 
600     Click element    xpath=//*[@id="button-notification-save"]
601     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
602     Click element    xpath=//*[@id="megamenu-notification-button"]
603     Click element    xpath=//*[@id="notification-history-link"]
604     # Notification bug, Uncomment the code when PORTAL-232 is fixed
605     # Wait until Element is visible    xpath=//*[@id="notification-history-table"]    timeout=10 
606     # Table Column Should Contain    xpath=//*[@id="notification-history-table"]    2    ${AdminBroadCastMsg}
607     Set Selenium Implicit Wait    3000     
608     log    ${AdminBroadCastMsg} 
609     [Return]     ${AdminBroadCastMsg}
610         
611 Portal Admin Category Notifications 
612     [Documentation]   Portal Admin Broadcast Notifications 
613     ${CurrentDay}=    Get Current Date    increment=24:00:00    result_format=%m/%d/%Y 
614     ${NextDay}=    Get Current Date    increment=48:00:00    result_format=%m/%d/%Y
615     #${CurrentDay}=    Get Current Date    result_format=%m/%d/%Y
616     ${CurrentDate}=    Get Current Date    increment=24:00:00    result_format=%m%d%y%H%M
617     ${AdminCategoryMsg}=    catenate    ONAP VID Category Automation${CurrentDate} 
618     Click Link    xpath=//a[@id='parent-item-Home'] 
619     Click Link    xpath=//*[@id="parent-item-User-Notifications"] 
620     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
621     Click button    xpath=//*[@id="button-openAddNewApp"]
622     #Select Radio Button    NO     radio-button-no
623     Click Element    //*[contains(text(),'Broadcast to All Categories')]/following::*[contains(text(),'No')][1]
624     #Select Radio Button    //label[@class='radio']    radio-button-approles
625     Click Element    xpath=//*[contains(text(),'Categories')]/following::*[contains(text(),'Application Roles')][1]
626     Click Element    xpath=//*[contains(text(),'xDemo App')]/preceding::input[@ng-model='member.isSelected'][1] 
627     Input Text    xpath=//input[@id='datepicker-start']     ${CurrentDay} 
628     Input Text    xpath=//input[@id='datepicker-end']     ${NextDay} 
629     Input Text    xpath=//*[@id="add-notification-input-title"]    ONAP VID Category Automation 
630     Input Text    xpath=//*[@id='user-notif-input-message']    ${AdminCategoryMsg} 
631     Click element    xpath=//*[@id="button-notification-save"]
632     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
633     Click element    xpath=//*[@id="megamenu-notification-button"]
634     Click element    xpath=//*[@id="notification-history-link"]
635 # Notification bug, Uncomment the code when PORTAL-232 is fixed
636     # Wait until Element is visible    xpath=//*[@id="notification-history-table"]    timeout=10 
637     # Table Column Should Contain    xpath=//*[@id="notification-history-table"]    2    ${AdminCategoryMsg}
638     Set Selenium Implicit Wait    3000 
639     log    ${AdminCategoryMsg}   
640     [Return]     ${AdminCategoryMsg}  
641     
642 Portal admin Logout from Portal GUI
643     [Documentation]   Logout from Portal GUI
644     Click Element    xpath=//div[@id='header-user-icon']
645     Run Keyword And Ignore Error    Click Button    xpath=//button[contains(.,'Log out')]
646     # TODO: Rework Logout tests to deal with intermittent "document unloaded while waiting for result" errors
647     # Sleep    5s
648     # Title Should Be    Login
649     
650 Application admin Login To Portal GUI
651     [Documentation]   Logs into Portal GUI
652     # Setup Browser Now being managed by test case
653     ##Setup Browser
654     Go To    ${PORTAL_LOGIN_URL}
655     Title Should Be    Login
656     Input Text    xpath=//input[@ng-model='loginId']    ${App_LoginID}
657     Input Password    xpath=//input[@ng-model='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
658     Click Link    xpath=//a[@id='loginBtn']
659     Sleep    5s
660     Go To    ${PORTAL_HOME_URL}
661     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}    
662     Log    Logged in to ${PORTAL_URL}${PORTAL_ENV}    
663     
664 Application Admin Navigation Application Link Tab    
665     [Documentation]   Logs into Portal GUI as application admin
666     Click Link    xpath=//a[@id='parent-item-Home']
667     Click Element    xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
668     Page Should Contain    ONAP Portal
669         Scroll Element Into View        xpath=//i[@class='ion-close-round']
670     Click Element    xpath=//i[@class='ion-close-round']
671     Set Selenium Implicit Wait    3000   
672     #Click Element    xpath=(.//span[@id='tab-Home'])[1]
673
674 Application Admin Navigation Functional Menu     
675     [Documentation]   Logs into Portal GUI as application admin
676     Click Link    xpath=//a[contains(.,'Manage')]
677     Mouse Over    xpath=//*[contains(text(),'Technology Insertion')]
678     Click Link    xpath= //*[contains(text(),'Infrastructure VNF Provisioning')]
679     Page Should Contain    ONAP Portal
680     Click Element    xpath=//i[@class='ion-close-round']
681     Click Element    xpath=(.//span[@id='tab-Home'])[1]
682      
683 Application admin Add Standard User Existing user
684     [Documentation]    Naviage to Users tab
685     Click Link    xpath=//a[@title='Users']
686     Page Should Contain      Users
687         Click Button    xpath=//button[@ng-click='toggleSidebar()']
688     Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
689     Input Text    xpath=//input[@id='input-user-search']    ${Test_LoginID}
690     Click Button    xpath=//button[@id='button-search-users']
691     Click Element    xpath=//span[@id='result-uuid-0']
692     Click Button    xpath=//button[@id='next-button']
693     Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
694     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
695     # Click Element    xpath=//*[@id='div-app-name-dropdown-Default']
696     # Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
697     # Set Selenium Implicit Wait    3000
698     Click Button    xpath=//button[@id='new-user-save-button']
699     Set Selenium Implicit Wait    3000
700     #Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
701     #Select From List    xpath=//input[@value='Select application']    xDemo App
702     #Click Link    xpath=//a[@title='Users']
703     #Page Should Contain      Users
704     Go To    ${PORTAL_HOME_PAGE}
705     Set Selenium Implicit Wait    3000
706     Click Link    xpath=//a[@title='Users']
707     Click Element    xpath=//input[@id='dropdown1']
708     #Click Element    xpath=//li[contains(.,'Default')]
709     Click Element    xpath=//li[contains(.,'xDemo App')]
710     Input Text    xpath=//input[@id='input-table-search']    ${Test_LoginID}
711     #Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Account Administrator
712     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Standard User
713      
714 Application admin Edit Standard User Existing user
715     [Documentation]    Naviage to Users tab
716     Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
717     #Click Element    xpath=//*[@id='div-app-name-dropdown-Default']
718     #Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
719     #Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Portal-Notification-Admin-checkbox']
720     Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
721     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
722     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='System-Administrator-checkbox']
723     Set Selenium Implicit Wait    3000
724     Click Button    xpath=//button[@id='new-user-save-button']
725     Set Selenium Implicit Wait    3000
726     Page Should Contain      Users
727     #Click Button    xpath=//input[@id='dropdown1']
728     #Click Element    xpath=//li[contains(.,'xDemo App')]
729     Input Text    xpath=//input[@id='input-table-search']    ${Test_LoginID}
730     #Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Account Administrator
731     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   System Administrator
732      
733 Application admin Delete Standard User Existing user    
734     [Documentation]    Naviage to Users tab
735     Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
736     #Scroll Element Into View    xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
737     #Click Element    xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
738     Scroll Element Into View    xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
739     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
740     Click Element    xpath=//button[@id='div-confirm-ok-button']
741     Click Button    xpath=//button[@id='new-user-save-button']
742     #Input Text    xpath=//input[@id='input-table-search']    ${Test_LoginID}
743     #Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2]
744     Element Should Not Contain     xpath=//*[@table-data='users.accountUsers']    Portal
745         #Click Image     xpath=//img[@alt='Onap Logo']
746     Set Selenium Implicit Wait    3000
747      
748 Application admin Logout from Portal GUI
749     [Documentation]   Logout from Portal GUI
750     Click Element    xpath=//div[@id='header-user-icon']
751         #Set Selenium Implicit Wait    3000
752     Run Keyword And Ignore Error    Click Button    xpath=//button[contains(text(),'Log out')]
753         #Set Selenium Implicit Wait    3000
754     # TODO: Rework Logout tests to deal with intermittent "document unloaded while waiting for result" errors
755     # Sleep    5s
756     # Title Should Be    Login  
757     
758 Standared user Login To Portal GUI
759     [Documentation]   Logs into Portal GUI
760     # Setup Browser Now being managed by test case
761     ##Setup Browser
762     #Go To    ${PORTAL_LOGIN_URL}
763     #Maximize Browser Window
764     #Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
765     #Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
766     #Log    Logging in to ${PORTAL_URL}${PORTAL_ENV}
767     # Handle Proxy Warning
768     Go To    ${PORTAL_LOGIN_URL}
769     Title Should Be    Login
770     Input Text    xpath=//input[@ng-model='loginId']    ${Sta_LoginID}
771     Input Password    xpath=//input[@ng-model='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
772     Click Link    xpath=//a[@id='loginBtn']
773     Sleep    5s
774     Go To    ${PORTAL_HOME_URL}
775     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}    
776     Log    Logged in to ${PORTAL_URL}${PORTAL_ENV}       
777      
778 Standared user Navigation Application Link Tab    
779     [Documentation]   Logs into Portal GUI as application admin
780     #Portal admin Go To Portal HOME
781     Click Element    xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
782     Page Should Contain    ONAP Portal    
783     Click Element    xpath=(.//span[@id='tab-Home'])[1]
784     Set Selenium Implicit Wait    3000
785     
786 Standared user Navigation Functional Menu     
787     [Documentation]   Logs into Portal GUI as application admin
788     Click Link    xpath=//a[contains(.,'Manage')]
789     Mouse Over    xpath=//*[contains(text(),'Technology Insertion')]
790     Click Link    xpath= //*[contains(text(),'Infrastructure VNF Provisioning')] 
791     Page Should Contain    Welcome to VID
792     Click Element    xpath=(.//span[@id='tab-Home'])[1]   
793     Set Selenium Implicit Wait    3000     
794
795 Standared user Broadcast Notifications 
796     [Documentation]   Logs into Portal GUI as application admin 
797     [Arguments]    ${AdminBroadCastMsg}
798     Click element    xpath=//*[@id='megamenu-notification-button'] 
799     Click element    xpath=//*[@id='notification-history-link'] 
800     Wait until Element is visible    xpath=//*[@id='app-title']    timeout=10 
801     Table Column Should Contain    xpath=//*[@id='notification-history-table']    2    ${AdminBroadCastMsg} 
802     log    ${AdminBroadCastMsg}   
803
804 Standared user Category Notifications 
805     [Documentation]   Logs into Portal GUI as application admin 
806     [Arguments]    ${AdminCategoryMsg}
807     #click element    xpath=//*[@id='megamenu-notification-button'] 
808     #click element    xpath=//*[@id="notification-history-link"] 
809     Wait until Element is visible    xpath=//*[@id='app-title']    timeout=10 
810     Table Column Should Contain    xpath=//*[@id='notification-history-table']    2    ${AdminCategoryMsg} 
811     log    ${AdminCategoryMsg} 
812     
813 Standared user Logout from Portal GUI
814     [Documentation]   Logout from Portal GUI
815     Click Element    xpath=//div[@id='header-user-icon']
816     Run Keyword And Ignore Error    Click Button    xpath=//button[contains(.,'Log out')]
817     #Confirm Action
818     # TODO: Rework Logout tests to deal with intermittent "document unloaded while waiting for result" errors
819     # Sleep    5s
820     # Title Should Be    Login     
821         
822 Portal admin Add New Account
823     Click Link    //*[@id="parent-item-App-Account-Management"]
824     Click Button    xpath=//button[@ng-click='toggleSidebar()']
825     Set Selenium Implicit Wait    3000
826     Click Button    //*[@id="account-onboarding-button-add"]
827     Set Selenium Implicit Wait    3000
828     Input Text    //*[@id="account-details-input-name"]    ${AppUserName}
829     Input Text    //*[@id="account-details-input-username"]    ${AppUserName}
830     Input Text    //*[@id="account-details-input-password"]    ${AppPassword}
831     Input Text    //*[@id="account-details-input-repassword"]    ${AppPassword}
832     #Click Button    xpath=//*[@ng-click='accountAddDetails.saveChanges()']
833     ##Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
834     #account-details-next-button
835     Click Button    xpath=//button[@ng-click='accountAddDetails.saveChanges()']
836          
837 Portal admin Delete Account
838     Click Link    //*[@id="parent-item-App-Account-Management"]
839     Click Button    xpath=//button[@ng-click='toggleSidebar()']
840     Set Selenium Implicit Wait    3000
841     Click Button    //*[@id="account-onboarding-button-add"]
842     Set Selenium Implicit Wait    3000
843                 
844 Enhanced Notification on ONAP Portal
845     [Documentation]     Runs portal Post request
846     [Arguments]     ${data_path}     ${data}
847     #Log     Creating session         ${GLOBAL_PORTAL_SERVER_URL}
848     ${session}=         Create Session     portal         ${PORTAL_URL}
849     ${headers}=     Create Dictionary     Accept=application/json    Content-Type=application/json    Authorization=Basic amlyYTpfcGFzcw==    username=jira    password=_pass
850     ${resp}=     Post Request     portal     ${data_path}     data=${data}     headers=${headers}
851     #Log     Received response from portal     ${resp.text}
852     [Return]     ${resp}    
853      
854 Notification on ONAP Portal
855     [Documentation]     Create Config portal
856     ${configportal}=     Create Dictionary     jira_id=${jira}
857     ${output} =     Fill JSON Template File     ${portal_Template}     ${configportal}
858     ${post_resp} =     Enhanced Notification on ONAP Portal     ${RESOURCE_PATH}     ${output}
859     Should Be Equal As Strings     ${post_resp.status_code}     200
860     
861 Portal Application Account Management
862     [Documentation]    Naviage to Application Account Management tab
863     Click Link    xpath=//a[@title='App Account Management']
864     Click Button    xpath=//button[@id='account-onboarding-button-add']
865     Input Text    xpath=//input[@name='name']    JIRA
866     Input Text    xpath=//input[@name='username']    jira
867     Input Text    xpath=//input[@name='password']    _pass
868     Input Text    xpath=//input[@name='repassword']    _pass
869     Click Element    xpath=//div[@ng-click='accountAddDetails.saveChanges()']
870     Element Text Should Be    xpath=//*[@table-data='serviceList']    JIRA
871
872 Portal Application Account Management validation
873     [Documentation]    Naviage to user notification tab
874     Click Link    xpath=//a[@id='parent-item-User-Notifications']
875     Click Element    xpath=//*[@id="megamenu-notification-button"]
876     Click Element    xpath=//*[@id="notification-history-link"]
877     Wait until Element is visible    xpath=//*[@id="notification-history-table"]    timeout=10 
878     Table Column Should Contain    xpath=//*[@id="notification-history-table"]    1    JIRA
879
880 Portal AAF new fields
881     [Documentation]    Naviage to user Application details tab
882     Click Link    xpath=//a[@title='Application Onboarding']
883     Click Element    xpath=//td[contains(.,'xDemo App')]
884     Page Should Contain    Name Space
885     Page Should Contain    Centralized
886         Click Element    xpath=//button[@id='button-notification-cancel']
887         Set Selenium Implicit Wait    3000
888
889 Portal Change REST URL
890     [Documentation]    Naviage to user Application details tab 
891     Click Link    xpath=//a[@title='Application Onboarding']
892     Click Element    xpath=//td[contains(.,'xDemo App')]
893     Input Text    xpath=//input[@name='restUrl']    ${PORTAL_XDEMPAPP_REST_URL}
894         Click Element    xpath=//button[@id='button-save-app']
895         Set Selenium Implicit Wait    6000
896         Go To    ${PORTAL_HOME_PAGE}
897     Wait Until Element Is Visible    xpath=//a[@title='Application Onboarding']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
898         
899 Admin widget download   
900     Go To    ${PORTAL_HOME_URL}
901         Wait until page contains Element    xpath=//a[@title='Widget Onboarding']     ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
902     Click Link  xpath=//a[@title='Widget Onboarding']
903     Wait until page contains Element    xpath=//table[@class='ng-scope']
904     ${td_id}=  get element attribute    xpath=//*[contains(text(),'Events')]    id
905     log    ${td_id}
906     ${test}=    Get Substring     ${td_id}   -1
907     log    ${test}
908     ${download_link_id}=    Catenate    'widget-onboarding-div-download-widget-${test}'
909     click Element  xpath=//*[@id=${download_link_id}]
910
911 Reset widget layout option
912     Go To    ${PORTAL_HOME_URL}
913     Wait Until Page Contains Element    xpath=//div[@id='widget-boarder']     ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
914     Execute Javascript      document.getElementById('widgets').scrollTo(0,1400)
915     Wait Until Page Contains Element     xpath=//*[@id='widget-gridster-Events-icon']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
916     Execute Javascript      document.getElementById('widgets').scrollTo(0,1800)
917     Drag And Drop By Offset   xpath=//*[@id='widget-gridster-Events-icon']   500  500    
918     Execute Javascript      document.getElementById('widgets').scrollTo(0,document.getElementById('widgets').scrollHeight);
919     Execute Javascript      document.getElementById('dashboardDefaultPreference').click()
920     Execute Javascript      document.getElementById('div-confirm-ok-button').click()
921
922 Add Portal Admin
923     Click Link    xpath=//a[@id='parent-item-Portal-Admins']
924     Scroll Element Into View    xpath=//button[@id='portal-admin-button-add']
925     Click Button    xpath=//button[@id='portal-admin-button-add']
926     Input Text    xpath=//input[@id='input-user-search']    ${Test_LoginID}
927     Click Button    xpath=//button[@id='button-search-users']
928     Wait Until Page Contains Element     xpath=//span[@id='result-uuid-0']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
929     Click Element    xpath=//span[@id='result-uuid-0']
930     Click Button     xpath=//button[@id='pa-search-users-button-save']
931     Click Button     xpath=//button[@id='admin-div-ok-button']
932
933 Delete Portal Admin
934         Wait Until Page Does Not Contain Element     xpath=//*[@class='b2b-modal-header']
935     Click Link    xpath=//a[@id='parent-item-Portal-Admins']
936     Click Element    xpath=//td[contains(.,'portal')]/following::span[@id='1-button-portal-admin-remove']
937     Click Button     xpath=//*[@id='div-confirm-ok-button']