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