[SO] SO release image for CSIT testing
[integration/csit.git] / tests / portal / testsuites / test1.robot
1 *** Settings ***
2 Documentation    CSIT cases for basic ONAP functionalities
3 Library         ExtendedSelenium2Library
4 Library         OperatingSystem
5 Library         RequestsLibrary
6 Library         ONAPLibrary.Utilities
7 Library         ONAPLibrary.Templating
8 Library         DateTime
9 Library         Collections
10 Library         String
11 Library         XvfbRobot
12
13 *** Variables ***
14 ${PORTAL_URL}        http://portal.api.simpledemo.onap.org:8989
15 ${PORTAL_ENV}            /ONAPPORTAL
16 ${PORTAL_LOGIN_URL}                ${PORTAL_URL}${PORTAL_ENV}/login.htm
17 ${PORTAL_HOME_PAGE}        ${PORTAL_URL}${PORTAL_ENV}/applicationsHome
18 ${PORTAL_MICRO_ENDPOINT}    ${PORTAL_URL}${PORTAL_ENV}/commonWidgets
19 ${PORTAL_HOME_URL}                ${PORTAL_URL}${PORTAL_ENV}/applicationsHome
20 ${App_First_Name}    demoapp
21 ${App_Last_Name}    demo
22 ${App_Email_Address}    demoapp@onap.com
23 ${App_LoginID}     demoapp
24 ${App_Loginpwd}    demo123456!
25 ${App_LoginPwdCheck}    demo123456!
26 ${Sta_First_Name}    demosta
27 ${Sta_Last_Name}    demo
28 ${Sta_Email_Address}    demosta@onap.com
29 ${Sta_LoginID}    demosta
30 ${Sta_Loginpwd}    demo123456!
31 ${Sta_LoginPwdCheck}    demo123456!
32 ${Test_First_Name}    portal
33 ${Test_Last_Name}    demo
34 ${Test_Email_Address}    portal@onap.com
35 ${Test_LoginID}    portal
36 ${Test_Loginpwd}    demo123456!
37 ${Test_LoginPwdCheck}    demo123456!
38 ${Existing_User}    portal
39 ${PORTAL_HEALTH_CHECK_PATH}        /ONAPPORTAL/portalApi/healthCheck
40 ${PORTAL_XDEMPAPP_REST_URL}        http://portal-sdk:8080/ONAPPORTALSDK/api/v2
41 ${PORTAL_ASSETS_DIRECTORY}    ${CURDIR}
42 ${GLOBAL_APPLICATION_ID}           robot-functional
43 ${GLOBAL_PORTAL_ADMIN_USER}     demo
44 ${GLOBAL_PORTAL_ADMIN_PWD}     demo123456!
45 ${AppAccountName}        testApp
46 ${AppUserName}           testApp
47 ${AppPassword}           testApp123!
48 ${GLOBAL_MSO_STATUS_PATH}    /ecomp/mso/infra/orchestrationRequests/v2/
49 ${GLOBAL_SELENIUM_BROWSER}        chrome
50 ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES}        Create Dictionary
51 ${GLOBAL_SELENIUM_DELAY}          0
52 ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}        5
53 ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}        45
54 ${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE}    orchestration
55 ${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE}    volume
56 ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE}    compute
57 ${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE}    network
58 ${GLOBAL_OPENSTACK_GLANCE_SERVICE_TYPE}    image
59 ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE}    identity
60 ${GLOBAL_BUILD_NUMBER}    0
61 ${GLOBAL_VM_PRIVATE_KEY}   ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt
62 ${jira}    jira
63 ${RESOURCE_PATH}    ONAPPORTAL/auxapi/ticketevent
64 ${portal_Template}    portal.template
65
66 ${Result}    FALSE
67 ${td_id}    0
68 ${download_link_id}    0
69
70 *** Test Cases ***
71
72 Portal Health Check
73      Run Portal Health Check
74
75 #Login into Portal URL
76 #    Portal admin Login To Portal GUI
77
78 ## Portal R1 Release
79 #   # [Documentation]    ONAP Portal R1 functionality  test
80 #    # Notification on ONAP Portal
81 #    # Portal Application Account Management validation
82
83 #Portal Change REST URL Of X-DemoApp
84 #   [Documentation]    Portal Change REST URL Of X-DemoApp
85 #      Portal Change REST URL
86
87 #Portal R1 Release for AAF
88 #   [Documentation]    ONAP Portal R1 functionality for AAF test
89 #      Portal AAF new fields
90
91 #Create Microservice onboarding
92 #   Portal admin Microservice Onboarding
93
94 ###Delete Microservice
95 #   ##Portal admin Microservice Delete
96
97 #Create Widget for all users
98 #   Portal Admin Create Widget for All users
99
100 #Delete Widget for all users
101 #   Portal Admin Delete Widget for All users
102
103 #Create Widget for Application Roles
104 #   Portal Admin Create Widget for Application Roles
105
106 ##Delete Widget for Application Roles
107 # #Portal Admin Delete Widget for Application Roles
108
109 ##EP Admin widget download
110 #   #Admin widget download
111
112 #EP Admin widget layout reset
113 #   Reset widget layout option
114
115 #Validate Functional Top Menu Get Access
116 #   Functional Top Menu Get Access
117
118 #Validate Functional Top Menu Contact Us
119 #   Functional Top Menu Contact Us
120
121 #Edit Functional Menu
122 #   Portal admin Edit Functional menu
123
124 #Broadcast Notification functionality
125 #   ${AdminBroadCastMsg}=    Portal Admin Broadcast Notifications
126 #   set global variable    ${AdminBroadCastMsg}
127
128 #Category Notification functionality
129 #   ${AdminCategoryMsg}=   Portal Admin Category Notifications
130 #   set global variable    ${AdminCategoryMsg}
131
132 #Create a Test user for Application Admin -Test
133 #   Portal admin Add Application admin User New user -Test
134
135 #Create a Test User for Application Admin
136 #   Portal admin Add Application admin User New user
137
138 #Add Application Admin for Existing User Test user
139 #   Portal admin Add Application Admin Existing User -APPDEMO
140
141 #Create a Test user for Standard User
142 #   Portal admin Add Standard User New user
143
144 #Add Application Admin for Existing User
145 #   Portal admin Add Application Admin Existing User
146
147 #Delete Application Admin for Exisitng User
148 #   Portal admin Delete Application Admin Existing User
149
150 #Add Standard User Role for Existing user
151 #   Portal admin Add Standard User Existing user
152
153 #Edit Standard User Role for Existing user
154 #   Portal admin Edit Standard User Existing user
155
156 #Delete Standard User Role for Existing user
157 #   Portal admin Delete Standard User Existing user
158
159 ##Add Account new account from App Account Management
160 #   #Portal admin Add New Account
161
162 ##Delete Account new account from App Account Management
163 #   #Portal admin Delete Account
164
165 ##EP Create Portal Admin
166 #   #Add Portal Admin
167
168 ##EP Portal Admin delete
169 #    #Delete Portal Admin
170
171 #Logout from Portal GUI as Portal Admin
172 #    Portal admin Logout from Portal GUI
173
174 ## Application Admin user Test cases
175
176 #Login To Portal GUI as APP Admin
177 #   Application admin Login To Portal GUI
178
179 ##Navigate Functional Link as APP Admin
180    ##Application Admin Navigation Functional Menu
181
182 #Add Standard User Role for Existing user as APP Admin
183 #   Application admin Add Standard User Existing user
184
185 #Edit Standard User Role for Existing user as APP Admin
186 #   Application admin Edit Standard User Existing user
187
188 #Delete Standard User Role for Existing user as APP Admin
189 #   Application admin Delete Standard User Existing user
190
191 ##Navigate Application Link as APP Admin
192 #   #Application Admin Navigation Application Link Tab
193
194 #Logout from Portal GUI as APP Admin
195 #   Application admin Logout from Portal GUI
196
197 ##Standard User Test cases
198
199 #Login To Portal GUI as Standard User
200 #   Standard user Login To Portal GUI
201
202 ##Navigate Application Link as Standard User
203 #   #Standard user Navigation Application Link Tab
204
205 ##Navigate Functional Link as Standard User
206 #   #Standard user Navigation Functional Menu
207
208 ##Broadcast Notifications Standard user
209 #   #Standard user Broadcast Notifications    ${AdminBroadCastMsg}
210
211 ##Category Notifications Standard user
212 #   #Standard user Category Notifications    ${AdminCategoryMsg}
213
214 #Logout from Portal GUI as Standard User
215 #   Standard User Logout from Portal GUI
216
217 Teardown
218      [Documentation]    Close All Open browsers
219      Close All Browsers
220
221 *** Keywords ***
222
223 Setup Browser
224     [Documentation]   Sets up browser based upon the value of ${GLOBAL_SELENIUM_BROWSER}
225 #    Run Keyword If    '${GLOBAL_SELENIUM_BROWSER}' == 'firefox'    Setup Browser Firefox
226     Run Keyword If    '${GLOBAL_SELENIUM_BROWSER}' == 'chrome'    Setup Browser Chrome
227     Log    Running with ${GLOBAL_SELENIUM_BROWSER}
228
229 Setup Browser Chrome
230     ${chrome options}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys
231     Call Method    ${chrome options}    add_argument    no-sandbox
232     ${dc}   Evaluate    sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME  sys, selenium.webdriver
233     Set To Dictionary   ${dc}   elementScrollBehavior    1
234     Create Webdriver    Chrome   chrome_options=${chrome_options}    desired_capabilities=${dc}
235     Set Global Variable    ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES}    ${dc}
236
237 Handle Proxy Warning
238     [Documentation]    Handle Intermediate Warnings from Proxies
239     ${status}    ${data}=    Run Keyword And Ignore Error   Variable Should Exist    \${GLOBAL_PROXY_WARNING_TITLE}
240     Return From Keyword if    '${status}' != 'PASS'
241     ${status}    ${data}=    Run Keyword And Ignore Error   Variable Should Exist    \${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}
242     Return From Keyword if    '${status}' != 'PASS'
243     Return From Keyword if    "${GLOBAL_PROXY_WARNING_TITLE}" == ''
244     Return From Keyword if    "${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}" == ''
245     ${test}    ${value}=    Run keyword and ignore error    Title Should Be     ${GLOBAL_PROXY_WARNING_TITLE}
246     Run keyword If    '${test}' == 'PASS'    Click Element    xpath=${GLOBAL_PROXY_WARNING_CONTINUE_XPATH}
247
248 Run Portal Health Check
249      [Documentation]    Runs Portal Health check
250      ${resp}=    Run Portal Get Request    ${PORTAL_HEALTH_CHECK_PATH}
251      Should Be Equal As Strings     ${resp.status_code}    200
252      Should Be Equal As Strings     ${resp.json()['statusCode']}    200
253
254 Run Portal Get Request
255      [Documentation]    Runs Portal Get request
256      [Arguments]    ${data_path}
257      ${session}=    Create Session    portal    ${PORTAL_URL}
258      ${uuid}=    Generate UUID4
259      ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json    X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
260      ${resp}=    Get Request    portal    ${data_path}     headers=${headers}
261      Log    Received response from portal ${resp.text}
262      [Return]    ${resp}
263
264 Portal admin Login To Portal GUI
265     [Documentation]   Logs into Portal GUI
266     ## Setup Browser Now being managed by test case
267 #    Setup Browser
268     Start Virtual Display    1920    1080
269     Open Browser    ${PORTAL_LOGIN_URL}    chrome
270 #    Go To    ${PORTAL_LOGIN_URL}
271     Maximize Browser Window
272     Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
273     Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
274     Log    Logging in to ${PORTAL_URL}${PORTAL_ENV}
275    # Handle Proxy Warning
276     Title Should Be    Login
277     Input Text    xpath=//input[@ng-model='loginId']    ${GLOBAL_PORTAL_ADMIN_USER}
278     Input Password    xpath=//input[@ng-model='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
279     Click Link    xpath=//a[@id='loginBtn']
280     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
281     #Execute Javascript    document.getElementById('w-ecomp-footer').style.display = 'none'
282     Log    Logged in to ${PORTAL_URL}${PORTAL_ENV}
283
284 Portal admin Go To Portal HOME
285     [Documentation]    Navigate to Portal Home
286     Go To    ${PORTAL_HOME_URL}
287     Wait Until Page Contains Element    xpath=//div[@class='applicationWindow']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}   
288
289 Portal admin User Notifications
290     [Documentation]    Navigate to User notification tab
291     Click Link    xpath=//a[@id='parent-item-User-Notifications']
292     Wait Until Element Is Visible    xpath=//h1[@class='heading-page']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
293     Click Button    xpath=//button[@id='button-openAddNewApp']
294     Click Button    xpath=(//button[@id='undefined'])[1]
295     #Click Button    xpath=//input[@id='datepicker-start']
296
297 Portal admin Add Application Admin Existing User
298     [Documentation]    Navigate to Admins tab
299     Wait Until Element Is Visible    xpath=//a[@title='Admins']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
300     Click Link    xpath=//a[@title='Admins']
301     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
302     Page Should Contain      Admins
303     Click Button    xpath=//button[@ng-click='toggleSidebar()']
304     Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
305     Input Text    xpath=//input[@id='input-user-search']    ${Existing_User}
306     Click Button    xpath=//button[@id='button-search-users']
307     Click Element    xpath=//span[@id='result-uuid-0']
308     Click Button    xpath=//button[@id='search-users-button-next']
309     Click Button    xpath=//input[@value='Select application']
310     Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App' )])[1]
311     Click Element    xpath=(//li[contains(.,'xDemo App' )])[2]
312 #    Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'Default' )])[1]
313 #    Click Element    xpath=(//li[contains(.,'Default' )])[2]
314     #Select From List    xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App')])[1]   xDemo App
315     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
316     Click Element    xpath=//button[@id='admin-div-ok-button']
317     Click Element    xpath=//button[@id='div-confirm-ok-button']
318     Get Selenium Implicit Wait
319     Click Link    xpath=//a[@aria-label='Admins']
320     Click Element    xpath=//input[@id='dropdown1']
321 #    Click Element    xpath=//li[contains(.,'Default' )]
322     Click Element    xpath=//li[contains(.,'xDemo App' )]
323     Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
324     Table Column Should Contain    xpath=//*[@table-data='admins.adminsTableData']    1    ${Existing_User}
325     #Element Text Should Be      xpath=(//span[contains(.,'portal')])[1]   ${Existing_User}
326     #Element Text Should Be      xpath=(//span[contains(.,'demo')])[1]   ${Existing_User}
327
328 Portal admin Delete Application Admin Existing User
329     [Documentation]    Navigate to Admins tab
330     Wait Until Element Is Visible    xpath=//a[@title='Admins']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
331     Click Link    xpath=//a[@title='Admins']
332     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
333     Page Should Contain      Admins
334     Click Button    xpath=//button[@ng-click='toggleSidebar()']
335     Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
336     Click Element    xpath=(//span[contains(.,'portal')] )[1]
337     #Click Element    xpath=(//span[contains(.,'demo')] )[1]
338     Click Element    xpath=//*[@id='select-app-xDemo-App']/following::i[@id='i-delete-application']
339 #    Click Element    xpath=//*[@id='select-app-Default']/following::i[@id='i-delete-application']
340     Click Element    xpath=//button[@id='div-confirm-ok-button']
341     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
342     Click Element    xpath=//button[@id='admin-div-ok-button']
343     #Is Element Visible      xpath=(//span[contains(.,'Portal')] )[2]
344     #Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2]
345     Element Should Not Contain     xpath=//*[@table-data='admins.adminsTableData']    portal
346     #Element Should Not Contain     xpath=//*[@table-data='admins.adminsTableData']    demo
347     Click Image     xpath=//img[@alt='Onap Logo']
348     Set Selenium Implicit Wait    3000
349
350 Portal admin Add Application admin User New user
351     [Documentation]    Navigate to Users tab
352     Click Link    xpath=//a[@title='Users']
353     Page Should Contain      Users
354     Click Button    xpath=//button[@ng-click='toggleSidebar()']
355     Click Button    xpath=//button[@id='users-button-add']
356     Click Button    xpath=//button[@id='Create-New-User-button']
357     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${App_First_Name}
358     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${App_Last_Name}
359     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${App_Email_Address}
360     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${App_LoginID}
361     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${App_Loginpwd}
362     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${App_LoginPwdCheck}
363     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
364
365     ${Result}=    Get Matching XPath Count     xpath=//*[contains(text(),'User with same loginId already exists')]
366
367     #log ${Result}
368     #${type_result}= Evaluate type(${Result})
369     #log ${type_result}
370
371     Run Keyword if     '${Result}'== 0     AdminUser does not exist already
372     ...    ELSE     Goto Home Image
373     Set Selenium Implicit Wait    3000
374
375 Goto Home Image
376     Click Image    xpath=//img[@alt='Onap Logo']
377
378 AdminUser does not exist already
379     Click Button    xpath=//button[@id='next-button']
380     #Scroll Element Into View    xpath=//div[@id='div-app-name-dropdown-xDemo-App']
381     Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
382     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
383     Set Selenium Implicit Wait    3000
384     Click Button    xpath=//button[@id='new-user-save-button']
385     Set Selenium Implicit Wait    3000
386     Go To    ${PORTAL_HOME_PAGE}
387     Click Link    xpath=//a[@title='Users']
388     Click Element    xpath=//input[@id='dropdown1']
389     Click Element    xpath=//li[contains(.,'xDemo App')]
390     Table Column Should Contain    xpath=//*[@table-data='users.accountUsers']    1    ${App_First_Name}
391     #Input Text    xpath=//input[@id='input-table-search']    ${App_First_Name}
392     #Element Text Should Be      xpath=(//span[contains(.,'demoapp')] )[1]   ${App_First_Name}
393     Click Image     xpath=//img[@alt='Onap Logo']
394     Set Selenium Implicit Wait    3000
395
396 Portal admin Add Standard User New user
397     [Documentation]    Navigate to Users tab
398     Click Link    xpath=//a[@title='Users']
399     Page Should Contain      Users
400     Click Button    xpath=//button[@ng-click='toggleSidebar()']
401     Click Button    xpath=//button[@id='users-button-add']
402     Click Button    xpath=//button[@id='Create-New-User-button']
403     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${Sta_First_Name}
404     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${Sta_Last_Name}
405     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${Sta_Email_Address}
406     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${Sta_LoginID}
407     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${Sta_Loginpwd}
408     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${Sta_LoginPwdCheck}
409     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
410
411     ${Result}=    Get Matching XPath Count     xpath=//*[contains(text(),'User with same loginId already exists')]
412
413     #log ${Result}
414     #${type_result}= Evaluate type(${Result})
415     #log ${type_result}
416
417     Run Keyword if     '${Result}'== 0     StaUser does not exist already
418     ...    ELSE     Goto Home Image
419     Set Selenium Implicit Wait    3000
420
421 StaUser does not exist already
422     Click Button    xpath=//button[@id='next-button']
423     #Scroll Element Into View    xpath=//div[@id='div-app-name-dropdown-xDemo-App']
424     Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
425     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
426     Set Selenium Implicit Wait    3000
427     Click Button    xpath=//button[@id='new-user-save-button']
428     Set Selenium Implicit Wait    3000
429     Go To    ${PORTAL_HOME_PAGE}
430     Click Link    xpath=//a[@title='Users']
431     Click Element    xpath=//input[@id='dropdown1']
432     Click Element    xpath=//li[contains(.,'xDemo App')]
433     Table Column Should Contain    xpath=//*[@table-data='users.accountUsers']    1    ${Sta_First_Name}
434     #Input Text    xpath=//input[@id='input-table-search']    ${Sta_First_Name}
435     #Element Text Should Be      xpath=(//span[contains(.,'appdemo')] )[1]   ${Sta_First_Name}
436     Click Image     xpath=//img[@alt='Onap Logo']
437     Set Selenium Implicit Wait    3000
438
439 Portal admin Add Application admin User New user -Test
440     [Documentation]    Navigate to Users tab
441     Click Link    xpath=//a[@title='Users']
442     Page Should Contain      Users
443     Click Button    xpath=//button[@ng-click='toggleSidebar()']
444     Click Button    xpath=//button[@id='users-button-add']
445     Click Button    xpath=//button[@id='Create-New-User-button']
446     Input Text    xpath=//input[@ng-model='searchUsers.newUser.firstName']    ${Test_First_Name}
447     Input Text    xpath=//input[@ng-model='searchUsers.newUser.lastName']    ${Test_Last_Name}
448     Input Text    xpath=//input[@ng-model='searchUsers.newUser.emailAddress']    ${Test_Email_Address}
449     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginId']    ${Test_LoginID}
450     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwd']    ${Test_Loginpwd}
451     Input Text    xpath=//input[@ng-model='searchUsers.newUser.loginPwdCheck']    ${Test_LoginPwdCheck}
452     Click Button    xpath=//button[@ng-click='searchUsers.addNewUserFun()']
453     Click Button    xpath=//button[@id='search-users-button-cancel']
454     Click Image     xpath=//img[@alt='Onap Logo']
455     Set Selenium Implicit Wait    3000
456
457     #Click Button    xpath=//button[@id='next-button']
458     #Scroll Element Into View    xpath=//div[@id='div-app-name-dropdown-xDemo-App']
459     #Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
460     #Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
461     #Set Selenium Implicit Wait    3000
462     #Click Button    xpath=//button[@id='new-user-save-button']
463     #Set Selenium Implicit Wait    3000
464     #Go To    ${PORTAL_HOME_PAGE}
465     #Click Link    xpath=//a[@title='Users']
466     #Click Element    xpath=//input[@id='dropdown1']
467     #Click Element    xpath=//li[contains(.,'xDemo App')]
468     #Table Column Should Contain    xpath=//*[@table-data='users.accountUsers']    1    ${Test_First_Name}
469     #Input Text    xpath=//input[@id='input-table-search']    ${Test_First_Name}
470     #Element Text Should Be      xpath=(//span[contains(.,'appdemo')] )[1]   ${Test_First_Name}
471
472 Portal admin Add Application Admin Existing User -APPDEMO
473     [Documentation]    Navigate to Admins tab
474     Wait Until Element Is Visible    xpath=//a[@title='Admins']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 
475     Click Link    xpath=//a[@title='Admins']
476     Wait Until Element Is Visible    xpath=//h1[contains(.,'Admins')]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
477     Page Should Contain      Admins
478     Click Button    xpath=//button[@ng-click='toggleSidebar()']
479     Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
480     Input Text    xpath=//input[@id='input-user-search']    ${App_First_Name}
481     Click Button    xpath=//button[@id='button-search-users']
482     Click Element    xpath=//span[@id='result-uuid-0']
483     Click Button    xpath=//button[@id='search-users-button-next']
484     Click Button    xpath=//input[@value='Select application']
485     Scroll Element Into View    xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App' )])[1]
486     Click Element    xpath=(//li[contains(.,'xDemo App' )])[2]
487     #Select From List    xpath=(//input[@value='Select application']/following::*[contains(text(),'xDemo App')])[1]   xDemo App
488     Click Button    xpath=//button[@id='div-updateAdminAppsRoles']
489     Click Element    xpath=//button[@id='admin-div-ok-button']
490     Click Element    xpath=//button[@id='div-confirm-ok-button']
491     Get Selenium Implicit Wait
492     Click Link    xpath=//a[@aria-label='Admins']
493     Click Element    xpath=//input[@id='dropdown1']
494     Click Element    xpath=//li[contains(.,'xDemo App' )]
495     Input Text    xpath=//input[@id='input-table-search']    ${App_First_Name}
496     #Element Text Should Be      xpath=(//span[contains(.,'appdemo')])[1]   ${App_First_Name}
497     Table Column Should Contain    xpath=//*[@table-data='admins.adminsTableData']    1    ${App_First_Name}
498     Click Image     xpath=//img[@alt='Onap Logo']
499     Set Selenium Implicit Wait    3000
500
501 Portal admin Add Standard User Existing user
502     [Documentation]    Navigate to Users tab
503     Click Link    xpath=//a[@title='Users']
504     Page Should Contain      Users
505     Click Button    xpath=//button[@ng-click='toggleSidebar()']
506     Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
507     Input Text    xpath=//input[@id='input-user-search']    ${Existing_User}
508     Click Button    xpath=//button[@id='button-search-users']
509     Click Element    xpath=//span[@id='result-uuid-0']
510     Click Button    xpath=//button[@id='next-button']
511 #    Click Element    xpath=//*[@id='div-app-name-dropdown-Default']
512 #    Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
513     Click Element    xpath=//div[@id='app-select-Select roles1']
514     Click Element    xpath=//div[@id='app-select-Select roles1']/following::input[@id='Standard-User-checkbox']
515     Set Selenium Implicit Wait    3000
516     Click Button    xpath=//button[@id='new-user-save-button']
517     Set Selenium Implicit Wait    3000
518 #    Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
519 #    Select From List    xpath=//input[@value='Select application']    xDemo App
520 #    Click Link    xpath=//a[@title='Users']
521 #    Page Should Contain      Users
522 #    Focus    xpath=//input[@name='dropdown1']
523     Go To    ${PORTAL_HOME_PAGE}
524 #    Click Link    xpath=//a[@title='Users']
525 #    Click Element    xpath=//input[@id='dropdown1']
526 #    Click Element    xpath=//li[contains(.,'Default')]
527 #    Click Element    xpath=//li[contains(.,'XDemo App')]
528 #    Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
529 #    Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Standard User
530 #    Set Selenium Implicit Wait    3000
531
532 Portal admin Edit Standard User Existing user
533     [Documentation]    Navigate to Users tab
534     Click Link    xpath=//a[@title='Users']
535     Click Element    xpath=//input[@id='dropdown1']
536 #    Click Element    xpath=//li[contains(.,'Default')]
537 #    Set Selenium Implicit Wait    3000
538     Click Element    xpath=//li[contains(.,'xDemo App')]
539 #    Set Selenium Implicit Wait    3000
540     Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
541     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Standard User
542     Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
543 #    Click Element    xpath=//*[@id='div-app-name-dropdown-Default']
544 #    Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
545 #    Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Portal-Notification-Admin-checkbox']
546     Click Element    xpath=//*[@id='app-select-Standard User1']
547     Click Element    xpath=//*[@id='app-select-Standard User1']/following::input[@id='Standard-User-checkbox']
548     Set Selenium Implicit Wait    3000
549     Click Button    xpath=//button[@id='new-user-save-button']
550     Set Selenium Implicit Wait    3000
551
552     Page Should Contain      Users
553     Click Button    xpath=//button[@ng-click='toggleSidebar()']
554     Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
555     Input Text    xpath=//input[@id='input-user-search']    ${Existing_User}
556     Click Button    xpath=//button[@id='button-search-users']
557     Click Element    xpath=//span[@id='result-uuid-0']
558     Click Button    xpath=//button[@id='next-button']
559     Click Element    xpath=//div[@id='app-select-Select roles1']
560     Click Element    xpath=//div[@id='app-select-Select roles1']/following::input[@id='System-Administrator-checkbox']
561     Set Selenium Implicit Wait    3000
562 #    Click Element    xpath=//*[@id='app-select-Standard User1']
563 #    Click Element    xpath=//*[@id='app-select-Standard User1']/following::input[@id='System-Administrator-checkbox']
564     # Click Element    xpath=//*[@id='div-app-name-dropdown-SDC']
565     # Click Element    xpath=//*[@id='div-app-name-SDC']/following::input[@id='Standard-User-checkbox']
566     # Click Element    xpath=//*[@id='div-app-name-SDC']/following::input[@id='Portal-Notification-Admin-checkbox']
567     Set Selenium Implicit Wait    3000
568     Click Button    xpath=//button[@id='new-user-save-button']
569     Set Selenium Implicit Wait    3000
570     Page Should Contain      Users
571     #Click Button    xpath=//input[@id='dropdown1']
572     #Click Element    xpath=//li[contains(.,'xDemo App')]
573     Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
574    #     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Portal Notification Admin
575     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   System Administrator
576     Set Selenium Implicit Wait    3000
577
578 Portal admin Delete Standard User Existing user
579     [Documentation]    Navigate to Users tab
580     Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
581 #    Scroll Element Into View    xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
582 #    Click Element    xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
583     Set Selenium Implicit Wait    9000
584     Scroll Element Into View    xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
585     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
586 #    Scroll Element Into View    xpath=//*[@id='div-app-name-SDC']/following::*[@id='app-item-delete'][1]
587 #    Click Element    xpath=//*[@id='div-app-name-SDC']/following::*[@id='app-item-delete'][1]
588     Click Element    xpath=//button[@id='div-confirm-ok-button']
589     Click Button    xpath=//button[@id='new-user-save-button']
590     #Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
591     #Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2]
592     Element Should Not Contain     xpath=//*[@table-data='users.accountUsers']    Portal
593     #Element Should Not Contain     xpath=//*[@table-data='users.accountUsers']    demo
594     Set Selenium Implicit Wait    3000
595
596 Functional Top Menu Get Access
597     [Documentation]    Navigate to Support tab
598     Go To    ${PORTAL_HOME_URL}
599      Click Link    xpath=//a[contains(.,'Support')]
600      Mouse Over    xpath=//*[contains(text(),'Get Access')]
601      Click Link    xpath=//a[contains(.,'Get Access')]
602      Element Text Should Be    xpath=//h1[contains(.,'Get Access')]    Get Access
603      Set Selenium Implicit Wait    3000
604
605 Functional Top Menu Contact Us
606     [Documentation]    Navigate to Support tab
607      Click Link    xpath=//a[contains(.,'Support')]
608      Mouse Over    xpath=//*[contains(text(),'Contact Us')]
609      Click Link    xpath=//a[contains(.,'Contact Us')]
610      Element Text Should Be    xpath=//h1[contains(.,'Contact Us')]    Contact Us
611      Click Image    xpath=//img[@alt='Onap Logo']
612      Set Selenium Implicit Wait    3000
613
614 Portal admin Edit Functional menu
615     [Documentation]    Navigate to Edit Functional menu tab
616     Click Link    xpath=//a[@title='Edit Functional Menu']
617     Click Link    xpath=.//*[@id='Manage']/div/a
618     Click Link    xpath=.//*[@id='Design']/div/a
619     Click Link    xpath=.//*[@id='Product_Design']/div/a
620     Open Context Menu    xpath=//*[@id='Product_Design']/div/span
621     Click Link    xpath=//a[@href='#add']
622     Input Text    xpath=//input[@id='input-title']    ONAP Test
623     #Input Text    xpath=//input[@id='input-url']    http://google.com
624     Click Element     xpath=//input[@id='select-app']
625     Scroll Element Into View    xpath=//li[contains(.,'xDemo App')]
626     Click Element    xpath=//li[contains(.,'xDemo App')]
627     Input Text    xpath=//input[@id='input-url']    http://google.com
628     Click Button    xpath=//button[@id='button-save-continue']
629     #Click Button    xpath=//div[@title='Select Roles']
630     Click Element    xpath=//*[@id='app-select-Select Roles']
631     Click Element    xpath=//input[@id='Standard-User-checkbox']
632     Click Element    xpath=//button[@id='button-save-add']
633     Click Image     xpath=//img[@alt='Onap Logo']
634     Set Selenium Implicit Wait    3000
635     Click Link    xpath=//a[contains(.,'Manage')]
636     Mouse Over    xpath=//*[contains(text(),'Design')]
637     Set Selenium Implicit Wait    3000
638     Element Text Should Be    xpath=//a[contains(.,'ONAP Test')]      ONAP Test
639     Set Selenium Implicit Wait    3000
640     Click Image    xpath=//img[@alt='Onap Logo']
641     Click Link    xpath=//a[@title='Edit Functional Menu']
642     Click Link    xpath=.//*[@id='Manage']/div/a
643     Click Link    xpath=.//*[@id='Design']/div/a
644     Click Link    xpath=.//*[@id='Product_Design']/div/a
645     Open Context Menu    xpath=//*[@id='ONAP_Test']
646     Click Link    xpath=//a[@href='#delete']
647     Set Selenium Implicit Wait    3000
648     Click Element    xpath=//button[@id='div-confirm-ok-button']
649     Click Image     xpath=//img[@alt='Onap Logo']
650     Set Selenium Implicit Wait    3000
651     Click Link    xpath=//a[contains(.,'Manage')]
652     Mouse Over    xpath=//*[contains(text(),'Design')]
653     Set Selenium Implicit Wait    3000
654     Element Should Not Contain    xpath=(.//*[contains(.,'Design')]/following::ul[1])[1]      ONAP Test
655     Set Selenium Implicit Wait    3000
656     Click Image     xpath=//img[@alt='Onap Logo']
657     Set Selenium Implicit Wait    3000
658
659 Portal admin Microservice Onboarding
660     [Documentation]    Navigate to Edit Functional menu tab
661     Click Link    xpath=//a[@title='Microservice Onboarding']
662     Click Button    xpath=//button[@id='microservice-onboarding-button-add']
663     Input Text    xpath=//input[@name='name']    Test Microservice
664     Input Text    xpath=//*[@name='desc']    Test
665     Click Element    xpath=//input[@id='microservice-details-input-app']
666     Scroll Element Into View    xpath=//li[contains(.,'xDemo App')]
667     Click Element    xpath=//li[contains(.,'xDemo App')]
668     Click Element     xpath=//*[@name='desc']
669     Input Text    xpath=//input[@name='url']    ${PORTAL_MICRO_ENDPOINT}
670     Click Element    xpath=//input[@id='microservice-details-input-security-type']
671     Scroll Element Into View    xpath=//li[contains(.,'Basic Authentication')]
672     Click Element    xpath=//li[contains(.,'Basic Authentication')]
673     Input Text    xpath=//input[@name='username']    ${GLOBAL_PORTAL_ADMIN_USER}
674     Input Text    xpath=//input[@name='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
675     Click Button    xpath=//button[@id='microservice-details-save-button']
676     Table Column Should Contain    xpath=//*[@table-data='serviceList']    1    Test Microservice
677     #Element Text Should Be    xpath=//*[@table-data='serviceList']    Test Microservice
678     Set Selenium Implicit Wait    3000
679
680 Portal admin Microservice Delete
681      [Documentation]    Navigate to Edit Functional menu tab
682      Click Link    xpath=//a[@title='Microservice Onboarding']
683      Click Button    xpath=//button[@id='microservice-onboarding-button-add']
684      Input Text    xpath=//input[@name='name']    TestMS
685      Input Text    xpath=//*[@name='desc']    TestMS
686      Click Element    xpath=//input[@id='microservice-details-input-app']
687      Scroll Element Into View    xpath=//li[contains(.,'xDemo App')]
688      Click Element    xpath=//li[contains(.,'xDemo App')]
689      Click Element     xpath=//*[@name='desc']
690      Input Text    xpath=//input[@name='url']    ${PORTAL_MICRO_ENDPOINT}
691      Click Element    xpath=//input[@id='microservice-details-input-security-type']
692      Scroll Element Into View    xpath=//li[contains(.,'Basic Authentication')]
693      Click Element    xpath=//li[contains(.,'Basic Authentication')]
694      Input Text    xpath=//input[@name='username']    ${GLOBAL_PORTAL_ADMIN_USER}
695      Input Text    xpath=//input[@name='password']    ${GLOBAL_PORTAL_ADMIN_PWD}
696      Click Button    xpath=//button[@id='microservice-details-save-button']
697      Execute Javascript     window.scrollTo(0,document.body.scrollHeight);
698      Click Element    xpath=(.//*[contains(text(),'TestMS')]/following::*[@ng-click='microserviceOnboarding.deleteService(rowData)'])[1]
699      Click Button    xpath=//button[@id="div-confirm-ok-button"]
700      Set Selenium Implicit Wait    3000
701
702 Portal Admin Create Widget for All users
703     [Documentation]    Navigate to Create Widget menu tab
704     ${WidgetAttachment}=    Catenate    ${PORTAL_ASSETS_DIRECTORY}//news_widget.zip
705     Wait Until Page Contains Element    xpath=//a[@title='Widget Onboarding']     ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
706     Click Link    xpath=//a[@title='Widget Onboarding']
707     Click Button    xpath=//button[@ng-click='toggleSidebar()']
708     Click Button    xpath=//button[@id='widget-onboarding-button-add']
709     Input Text    xpath=//*[@name='name']    ONAP-xDemo
710     Input Text    xpath=//*[@name='desc']    ONAP xDemo
711     Click Element    xpath=//*[@id='widgets-details-input-endpoint-url']
712     Scroll Element Into View    xpath=//li[contains(.,'News Microservice')]
713     Click Element    xpath=//li[contains(.,'News Microservice')]
714     Click Element    xpath=//*[contains(text(),'Allow all user access')]/preceding::input[@ng-model='widgetOnboardingDetails.widget.allUser'][1]
715     Choose File    xpath=//input[@id='widget-onboarding-details-upload-file']    ${WidgetAttachment}
716     Click Button    xpath=//button[@id='widgets-details-save-button']
717     Wait Until Page Contains      ONAP-xDemo    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
718     Page Should Contain    ONAP-xDemo
719     Set Selenium Implicit Wait    3000
720     GO TO    ${PORTAL_HOME_PAGE}
721
722 Portal Admin Delete Widget for All users
723     [Documentation]    Navigate to delete Widget menu tab
724     #Wait Until Page Contains    ONAP-xDemo    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
725     #Page Should Contain    ONAP-xDemo
726     #Click Image    xpath=//img[@alt='Onap Logo']
727     Click Link    xpath=//a[@title='Widget Onboarding']
728     Click Element    xpath=//input[@id='dropdown1']
729     Click Element    xpath=//li[contains(.,'xDemo App')]
730     #Wait Until Page Contains    xpath=(.//*[contains(text(),'ONAP-xDemo')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
731     Click Button    xpath=//button[@ng-click='toggleSidebar()']
732     Click Element    xpath=(.//*[contains(text(),'ONAP-xDemo')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]
733     Click Element    xpath=//button[@id='div-confirm-ok-button']
734     Set Selenium Implicit Wait    3000
735     Element Should Not Contain     xpath=//*[@table-data='portalAdmin.portalAdminsTableData']    ONAP-xDemo
736     #Is Element Visible    xpath=//*[@table-data='portalAdmin.portalAdminsTableData']
737     #Table Column Should Contain    .//*[@table-data='portalAdmin.portalAdminsTableData']    0       ONAP-xDemo
738     #Set Selenium Implicit Wait    3000
739
740 Portal Admin Create Widget for Application Roles
741     [Documentation]    Navigate to Create Widget menu tab
742     ${WidgetAttachment}=    Catenate    ${PORTAL_ASSETS_DIRECTORY}//news_widget.zip
743     Click Link    xpath=//a[@title='Widget Onboarding']
744     Click Button    xpath=//button[@ng-click='toggleSidebar()']
745     Click Button    xpath=//button[@id='widget-onboarding-button-add']
746     Input Text    xpath=//*[@name='name']    ONAP-xDemo
747     Input Text    xpath=//*[@name='desc']    ONAP xDemo
748     Click Element    xpath=//*[@id='widgets-details-input-endpoint-url']
749     Scroll Element Into View    xpath=//li[contains(.,'News Microservice')]
750     Click Element    xpath=//li[contains(.,'News Microservice')]
751     Click Element    xpath=//*[@id="app-select-Select Applications"]
752     Click Element    xpath=//*[@id="xDemo-App-checkbox"]
753     Click Element    xpath=//*[@name='desc']
754     Click Element    xpath=//*[@id="app-select-Select Roles0"]
755     Click Element    xpath=//*[@id="Standard-User-checkbox"]
756     Click Element    xpath=//*[@name='desc']
757     Scroll Element Into View    xpath=//input[@id='widget-onboarding-details-upload-file']
758     Choose File    xpath=//input[@id='widget-onboarding-details-upload-file']    ${WidgetAttachment}
759     Click Button    xpath=//button[@id='widgets-details-save-button']
760     Click Image     xpath=//img[@alt='Onap Logo']
761     Set Selenium Implicit Wait    3000
762     #Wait Until Page Contains    ONAP-xDemo    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
763     Click Link    xpath=//a[@title='Widget Onboarding']
764     Click Element    xpath=//input[@id='dropdown1']
765     Click Element    xpath=//li[contains(.,'xDemo App')]
766     Page Should Contain    ONAP-xDemo
767     Set Selenium Implicit Wait    3000
768     GO TO    ${PORTAL_HOME_PAGE}
769
770 Portal Admin Delete Widget for Application Roles
771     #Wait Until Page Contains    ONAP-xDemo    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
772     #Page Should Contain    ONAP-xDemo
773     #Click Image    xpath=//img[@alt='Onap Logo']
774     Click Link    xpath=//a[@title='Widget Onboarding']
775     Click Element    xpath=//input[@id='dropdown1']
776    Click Element    xpath=//li[contains(.,'xDemo App')]
777     #Wait Until Page Contains    xpath=(.//*[contains(text(),'ONAP-xDemo')]/following::*[@ng-click='widgetOnboarding.deleteWidget(rowData)'])[1]    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
778     Click Button    xpath=//button[@ng-click='toggleSidebar()']
779     Scroll Element Into View    xpath=//*[contains(text(),'ONAP-xDemo')]/following::td[3]/div
780     Click Element    xpath=//*[contains(text(),'ONAP-xDemo')]/following::td[3]/div
781     Click Element    xpath=//button[@id='div-confirm-ok-button']
782     Set Selenium Implicit Wait    3000
783     Element Should Not Contain     xpath=//*[@table-data='portalAdmin.portalAdminsTableData']    ONAP-xDemo
784     #Is Element Visible    xpath=//*[@table-data='portalAdmin.portalAdminsTableData']
785     #Table Column Should Contain    .//*[@table-data='portalAdmin.portalAdminsTableData']    0       ONAP-xDemo
786     Set Selenium Implicit Wait    3000
787
788 Portal Admin Edit Widget
789     [Documentation]    Navigate to Home tab
790     #Mouse Over    xpath=(//h3[contains(text(),'News')]/following::span[1])[1]
791     Click Element    xpath=(//h3[contains(text(),'News')]/following::span[1])[1]
792     Set Browser Implicit Wait    8000
793     #Wait Until Element Is Visible    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1]    60
794     Mouse Over    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1]
795     Click Link    xpath=(//h3[contains(text(),'News')]/following::span[1]/following::a[contains(text(),'Edit')])[1]
796     Input Text    xpath=//input[@name='title']    ONAP_VID
797     Input Text    xpath=//input[@name='url']    http://about.att.com/news/international.html
798     Input Text    xpath=//input[@id='widget-input-add-order']    5
799     Click Link    xpath=//a[contains(.,'Add New')]
800     Click Element    xpath=//div[@id='close-button']
801     Element Should Contain    xpath=//*[@table-data='ignoredTableData']    ONAP_VID
802     Click Element    xpath=.//div[contains(text(),'ONAP_VID')]/following::*[contains(text(),'5')][1]/following::div[@ng-click='remove($index);'][1]
803     Click Element    xpath=//div[@id='confirmation-button-next']
804     Element Should Not Contain    xpath=//*[@table-data='ignoredTableData']    ONAP_VID
805     Click Link    xpath=//a[@id='close-button']
806     Set Selenium Implicit Wait    3000
807
808 Portal Admin Broadcast Notifications
809     [Documentation]   Portal Test Admin Broadcast Notifications
810     ${CurrentDay}=    Get Current Date    increment=24:00:00    result_format=%m/%d/%Y
811     ${NextDay}=    Get Current Date    increment=48:00:00    result_format=%m/%d/%Y
812     ${CurrentDate}=    Get Current Date    increment=24:00:00    result_format=%m%d%y%H%M
813     ${AdminBroadCastMsg}=    catenate    ONAP VID Broadcast Automation${CurrentDate}
814     Go To    ${PORTAL_HOME_URL}
815     Click Image     xpath=//img[@alt='Onap Logo']
816     Set Selenium Implicit Wait    3000
817     Click Link    xpath=//*[@id="parent-item-User-Notifications"]
818     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10 
819     Click button    xpath=//*[@id="button-openAddNewApp"]
820     Input Text    xpath=//input[@id='datepicker-start']     ${CurrentDay}
821     Input Text    xpath=//input[@id='datepicker-end']     ${NextDay}
822     Input Text    xpath=//*[@id="add-notification-input-title"]    ONAP VID Broadcast Automation
823     Input Text    xpath=//*[@id="user-notif-input-message"]    ${AdminBroadCastMsg}
824     Click Element    xpath=//*[@id="button-notification-save"]
825     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10
826     Click Element    xpath=//*[@id="megamenu-notification-button"]
827     Click Element    xpath=//*[@id="notification-history-link"]
828 # Notification bug, Uncomment the code when PORTAL-232 is fixed
829     # Wait until Element is visible    xpath=//*[@id="notification-history-table"]    timeout=10
830     # Table Column Should Contain    xpath=//*[@id="notification-history-table"]    2    ${AdminBroadCastMsg}
831     Set Selenium Implicit Wait    3000
832     Log    ${AdminBroadCastMsg}
833     [Return]     ${AdminBroadCastMsg}
834
835 Portal Admin Category Notifications
836     [Documentation]   Portal Admin Broadcast Notifications
837     ${CurrentDay}=    Get Current Date    increment=24:00:00    result_format=%m/%d/%Y
838     ${NextDay}=    Get Current Date    increment=48:00:00    result_format=%m/%d/%Y
839 #    ${CurrentDay}=    Get Current Date    result_format=%m/%d/%Y
840     ${CurrentDate}=    Get Current Date    increment=24:00:00    result_format=%m%d%y%H%M
841     ${AdminCategoryMsg}=    catenate    ONAP VID Category Automation${CurrentDate}
842     Click Link    xpath=//a[@id='parent-item-Home']
843     Click Link    xpath=//*[@id="parent-item-User-Notifications"]
844     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10
845     Click button    xpath=//*[@id="button-openAddNewApp"]
846     #Select Radio Button    NO     radio-button-no
847     Click Element    //*[contains(text(),'Broadcast to All Categories')]/following::*[contains(text(),'No')][1]
848     #Select Radio Button    //label[@class='radio']    radio-button-approles
849     Click Element    xpath=//*[contains(text(),'Categories')]/following::*[contains(text(),'Application Roles')][1]
850     Click Element    xpath=//*[contains(text(),'xDemo App')]/preceding::input[@ng-model='member.isSelected'][1]
851     Input Text    xpath=//input[@id='datepicker-start']     ${CurrentDay}
852     Input Text    xpath=//input[@id='datepicker-end']     ${NextDay}
853     Input Text    xpath=//*[@id="add-notification-input-title"]    ONAP VID Category Automation
854     Input Text    xpath=//*[@id='user-notif-input-message']    ${AdminCategoryMsg}
855     Click Element    xpath=//*[@id="button-notification-save"]
856     Wait until Element is visible    xpath=//*[@id="button-openAddNewApp"]    timeout=10
857     Click Element    xpath=//*[@id="megamenu-notification-button"]
858     Click Element    xpath=//*[@id="notification-history-link"]
859 # Notification bug, Uncomment the code when PORTAL-232 is fixed
860     # Wait until Element is visible    xpath=//*[@id="notification-history-table"]    timeout=10
861     # Table Column Should Contain    xpath=//*[@id="notification-history-table"]    2    ${AdminCategoryMsg}
862     Set Selenium Implicit Wait    3000
863     Log    ${AdminCategoryMsg}
864     [Return]     ${AdminCategoryMsg}
865
866 Portal admin Logout from Portal GUI
867     [Documentation]   Logout from Portal GUI
868     Click Element    xpath=//div[@id='header-user-icon']
869     Click Button    xpath=//button[contains(.,'Log out')]
870     Title Should Be    Login
871
872 Application admin Login To Portal GUI
873     [Documentation]   Logs into Portal GUI
874     # Setup Browser Now being managed by test case
875     ##Setup Browser
876 #    Go To    ${PORTAL_LOGIN_URL}
877 #    Maximize Browser Window
878 #    Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
879 #    Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
880 #    Log    Logging in to ${PORTAL_URL}${PORTAL_ENV}
881    # Handle Proxy Warning
882     Title Should Be    Login
883     Input Text    xpath=//input[@ng-model='loginId']    ${App_LoginID}
884     Input Password    xpath=//input[@ng-model='password']    ${App_Loginpwd}
885     Click Link    xpath=//a[@id='loginBtn']
886     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
887     Log    Logged in to ${PORTAL_URL}${PORTAL_ENV}
888
889 Application Admin Navigation Application Link Tab
890     [Documentation]   Logs into Portal GUI as application admin
891     Click Link    xpath=//a[@id='parent-item-Home']
892     Click Element    xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
893     Page Should Contain    ONAP Portal
894     Scroll Element Into View    xpath=//i[@class='ion-close-round']
895     Click Element    xpath=//i[@class='ion-close-round']
896     Set Selenium Implicit Wait    3000
897     #Click Element    xpath=(.//span[@id='tab-Home'])[1]
898
899 Application Admin Navigation Functional Menu
900     [Documentation]   Logs into Portal GUI as application admin
901     Click Link    xpath=//a[contains(.,'Manage')]
902      Mouse Over    xpath=//*[contains(text(),'Technology Insertion')]
903      Click Link    xpath= //*[contains(text(),'Infrastructure VNF Provisioning')]
904      Page Should Contain    ONAP Portal
905      Click Element    xpath=//i[@class='ion-close-round']
906      Click Element    xpath=(.//span[@id='tab-Home'])[1]
907
908 Application admin Add Standard User Existing user
909     [Documentation]    Navigate to Users tab
910     Click Link    xpath=//a[@title='Users']
911     Page Should Contain      Users
912     Click Button        xpath=//button[@ng-click='toggleSidebar()']
913     Click Button    xpath=//button[@ng-click='users.openAddNewUserModal()']
914     Input Text    xpath=//input[@id='input-user-search']    ${Existing_User}
915     Click Button    xpath=//button[@id='button-search-users']
916     Click Element    xpath=//span[@id='result-uuid-0']
917     Click Button    xpath=//button[@id='next-button']
918     Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
919     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
920     # Click Element    xpath=//*[@id='div-app-name-dropdown-Default']
921     # Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
922     # Set Selenium Implicit Wait    3000
923     Click Button    xpath=//button[@id='new-user-save-button']
924     Set Selenium Implicit Wait    3000
925     #Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
926     #Select From List    xpath=//input[@value='Select application']    xDemo App
927     #Click Link    xpath=//a[@title='Users']
928     #Page Should Contain      Users
929     Go To    ${PORTAL_HOME_PAGE}
930     Set Selenium Implicit Wait    3000
931     Click Link    xpath=//a[@title='Users']
932     Click Element    xpath=//input[@id='dropdown1']
933     #Click Element    xpath=//li[contains(.,'Default')]
934     Click Element    xpath=//li[contains(.,'xDemo App')]
935     Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
936    #     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Account Administrator
937     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Standard User
938
939 Application admin Edit Standard User Existing user
940     [Documentation]    Navigate to Users tab
941     Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
942    #    Click Element    xpath=//*[@id='div-app-name-dropdown-Default']
943    #    Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Standard-User-checkbox']
944    #    Click Element    xpath=//*[@id='div-app-name-Default']/following::input[@id='Portal-Notification-Admin-checkbox']
945     Click Element    xpath=//*[@id='div-app-name-dropdown-xDemo-App']
946     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='Standard-User-checkbox']
947     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::input[@id='System-Administrator-checkbox']
948     Set Selenium Implicit Wait    3000
949     Click Button    xpath=//button[@id='new-user-save-button']
950     Set Selenium Implicit Wait    3000
951     Page Should Contain      Users
952     #Click Button    xpath=//input[@id='dropdown1']
953     #Click Element    xpath=//li[contains(.,'xDemo App')]
954     Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
955    #     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   Account Administrator
956     Element Text Should Be      xpath=(.//*[@id='rowheader_t1_0'])[2]   System Administrator
957
958 Application admin Delete Standard User Existing user
959     [Documentation]    Navigate to Users tab
960     Click Element    xpath=(.//*[@id='rowheader_t1_0'])[2]
961 #    Scroll Element Into View    xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
962 #    Click Element    xpath=//*[@id='div-app-name-Default']/following::*[@id='app-item-delete'][1]
963     Scroll Element Into View    xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
964     Click Element    xpath=//*[@id='div-app-name-xDemo-App']/following::*[@id='app-item-delete'][1]
965     Click Element    xpath=//button[@id='div-confirm-ok-button']
966     Click Button    xpath=//button[@id='new-user-save-button']
967 #    Input Text    xpath=//input[@id='input-table-search']    ${Existing_User}
968 #    Is Element Visible    xpath=(//*[contains(.,'Portal')] )[2]
969     Element Should Not Contain     xpath=//*[@table-data='users.accountUsers']    Portal
970     #Click Image     xpath=//img[@alt='Onap Logo']
971     Set Selenium Implicit Wait    3000
972
973 Application admin Logout from Portal GUI
974     [Documentation]   Logout from Portal GUI
975     Click Element    xpath=//div[@id='header-user-icon']
976     #Set Selenium Implicit Wait    3000
977     Click Button    xpath=//button[contains(text(),'Log out')]
978     #Set Selenium Implicit Wait    3000
979     Title Should Be    Login
980
981 Standard user Login To Portal GUI
982     [Documentation]   Logs into Portal GUI
983     # Setup Browser Now being managed by test case
984     ##Setup Browser
985 #    Go To    ${PORTAL_LOGIN_URL}
986 #    Maximize Browser Window
987 #    Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
988 #    Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
989 #    Log    Logging in to ${PORTAL_URL}${PORTAL_ENV}
990    # Handle Proxy Warning
991     Title Should Be    Login
992     Input Text    xpath=//input[@ng-model='loginId']    ${Sta_LoginID}
993     Input Password    xpath=//input[@ng-model='password']    ${Sta_Loginpwd}
994     Click Link    xpath=//a[@id='loginBtn']
995     Wait Until Page Contains Element    xpath=//img[@alt='Onap Logo']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
996     Log    Logged in to ${PORTAL_URL}${PORTAL_ENV}
997
998 Standard user Navigation Application Link Tab
999     [Documentation]   Logs into Portal GUI as application admin
1000     #Portal admin Go To Portal HOME
1001     Click Element    xpath=.//h3[contains(text(),'xDemo App')]/following::div[1]
1002     Page Should Contain    ONAP Portal
1003     Click Element    xpath=(.//span[@id='tab-Home'])[1]
1004     Set Selenium Implicit Wait    3000
1005
1006 Standard user Navigation Functional Menu
1007     [Documentation]   Logs into Portal GUI as application admin
1008     Click Link    xpath=//a[contains(.,'Manage')]
1009     Mouse Over    xpath=//*[contains(text(),'Technology Insertion')]
1010     Click Link    xpath= //*[contains(text(),'Infrastructure VNF Provisioning')]
1011     Page Should Contain    Welcome to VID
1012     Click Element    xpath=(.//span[@id='tab-Home'])[1]
1013     Set Selenium Implicit Wait    3000
1014
1015 Standard user Broadcast Notifications
1016     [Documentation]   Logs into Portal GUI as application admin
1017     [Arguments]    ${AdminBroadCastMsg}
1018     Click Element    xpath=//*[@id='megamenu-notification-button']
1019     Click Element    xpath=//*[@id='notification-history-link']
1020     Wait until Element is visible    xpath=//*[@id='app-title']    timeout=10
1021     Table Column Should Contain    xpath=//*[@id='notification-history-table']    2    ${AdminBroadCastMsg}
1022     Log    ${AdminBroadCastMsg}
1023
1024 Standard user Category Notifications
1025     [Documentation]   Logs into Portal GUI as application admin
1026     [Arguments]    ${AdminCategoryMsg}
1027     #Click Element    xpath=//*[@id='megamenu-notification-button']
1028     #Click Element    xpath=//*[@id="notification-history-link"]
1029     Wait until Element is visible    xpath=//*[@id='app-title']    timeout=10
1030     Table Column Should Contain    xpath=//*[@id='notification-history-table']    2    ${AdminCategoryMsg}
1031     Log    ${AdminCategoryMsg}
1032
1033 Standard user Logout from Portal GUI
1034     [Documentation]   Logout from Portal GUI
1035     Click Element    xpath=//div[@id='header-user-icon']
1036     Click Button    xpath=//button[contains(.,'Log out')]
1037     #Confirm Action
1038     Title Should Be    Login
1039
1040 Portal admin Add New Account
1041     Click Link    //*[@id="parent-item-App-Account-Management"]
1042     Click Button    xpath=//button[@ng-click='toggleSidebar()']
1043     Set Selenium Implicit Wait    3000
1044     Click Button    //*[@id="account-onboarding-button-add"]
1045     Set Selenium Implicit Wait    3000
1046     Input Text    //*[@id="account-details-input-name"]    ${AppAccountName}
1047     Input Text    //*[@id="account-details-input-username"]    ${AppUserName}
1048     Input Text    //*[@id="account-details-input-password"]    ${AppPassword}
1049     Input Text    //*[@id="account-details-input-repassword"]    ${AppPassword}
1050     #    Click Button    xpath=//*[@ng-click='accountAddDetails.saveChanges()']
1051     #    #Click Button    xpath=//button[@ng-click='admins.openAddNewAdminModal()']
1052     #account-details-next-button
1053     Click Button    xpath=//button[@ng-click='accountAddDetails.saveChanges()']
1054
1055 Portal admin Delete Account
1056     Click Link    //*[@id="parent-item-App-Account-Management"]
1057     Click Button    xpath=//button[@ng-click='toggleSidebar()']
1058     Set Selenium Implicit Wait    3000
1059     Click Button    //*[@id="account-onboarding-button-add"]
1060     Set Selenium Implicit Wait    3000
1061
1062 Tear Down
1063     [Documentation]   Close all browsers
1064     Close All Browsers
1065
1066 Enhanced Notification on ONAP Portal
1067     [Documentation]     Runs portal Post request
1068     [Arguments]     ${data_path}     ${data}
1069     #   Log     Creating session         ${GLOBAL_PORTAL_SERVER_URL}
1070     ${session}=         Create Session     portal         ${PORTAL_URL}
1071     ${headers}=     Create Dictionary     Accept=application/json    Content-Type=application/json    Authorization=Basic amlyYTpfcGFzcw==    username=jira    password=_pass
1072     ${resp}=     Post Request     portal     ${data_path}     data=${data}     headers=${headers}
1073     #    Log     Received response from portal     ${resp.text}
1074     [Return]     ${resp}
1075
1076 Notification on ONAP Portal
1077     [Documentation]     Create Config portal
1078     ${configportal}=     Create Dictionary     jira_id=${jira}
1079     Create Environment    portal    ${CURDIR}
1080     ${output} =     Apply Template    portal     ${portal_Template}     ${configportal}
1081     ${post_resp} =     Enhanced Notification on ONAP Portal     ${RESOURCE_PATH}     ${output}
1082     Should Be Equal As Strings     ${post_resp.status_code}     200
1083
1084 Portal Application Account Management
1085     [Documentation]    Navigate to Application Account Management tab
1086     Click Link    xpath=//a[@title='App Account Management']
1087     Click Button    xpath=//button[@id='account-onboarding-button-add']
1088     Input Text    xpath=//input[@name='name']    JIRA
1089     Input Text    xpath=//input[@name='username']    jira
1090     Input Text    xpath=//input[@name='password']    _pass
1091     Input Text    xpath=//input[@name='repassword']    _pass
1092     Click Element    xpath=//div[@ng-click='accountAddDetails.saveChanges()']
1093     Element Text Should Be    xpath=//*[@table-data='serviceList']    JIRA
1094
1095 Portal Application Account Management validation
1096     [Documentation]    Navigate to user notification tab
1097     Click Link    xpath=//a[@id='parent-item-User-Notifications']
1098     Click Element    xpath=//*[@id="megamenu-notification-button"]
1099     Click Element    xpath=//*[@id="notification-history-link"]
1100     Wait until Element is visible    xpath=//*[@id="notification-history-table"]    timeout=10
1101     Table Column Should Contain    xpath=//*[@id="notification-history-table"]    1    JIRA
1102
1103 Portal AAF new fields
1104      [Documentation]    Navigate to user Application details tab
1105     Click Link    xpath=//a[@title='Application Onboarding']
1106     Click Element    xpath=//td[contains(.,'xDemo App')]
1107     Page Should Contain    Name Space
1108     Page Should Contain    Centralized
1109     Click Element    xpath=//button[@id='button-notification-cancel']
1110     Set Selenium Implicit Wait    3000
1111
1112 Portal Change REST URL
1113     [Documentation]    Navigate to user Application details tab
1114     Click Link    xpath=//a[@title='Application Onboarding']
1115     Click Element    xpath=//td[contains(.,'xDemo App')]
1116     Input Text    xpath=//input[@name='restUrl']    ${PORTAL_XDEMPAPP_REST_URL}
1117     Click Element    xpath=//button[@id='button-save-app']
1118     Set Selenium Implicit Wait    6000
1119     Go To    ${PORTAL_HOME_PAGE}
1120     Wait Until Element Is Visible    xpath=//a[@title='Application Onboarding']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
1121
1122 Admin widget download
1123     Go To    ${PORTAL_HOME_URL}
1124     Wait Until Page Contains Element    xpath=//a[@title='Widget Onboarding']     ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
1125     Click Link  xpath=//a[@title='Widget Onboarding']
1126     Wait Until Page Contains Element    xpath=//table[@class='ng-scope']
1127     ${td_id}=  get element attribute    xpath=//*[contains(text(),'Events')]@id
1128     Log    ${td_id}
1129     ${test}=    Get Substring     ${td_id}   -1
1130     Log    ${test}
1131     ${download_link_id}=    Catenate    'widget-onboarding-div-download-widget-${test}'
1132     Click Element  xpath=//*[@id=${download_link_id}]
1133
1134 Reset widget layout option
1135     Go To    ${PORTAL_HOME_URL}
1136     Wait Until Page Contains Element    xpath=//div[@id='widget-boarder']     ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
1137     Execute Javascript      document.getElementById('widgets').scrollTo(0,1400)
1138     Wait Until Page Contains Element     xpath=//*[@id='widget-gridster-Events-icon']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
1139     Execute Javascript      document.getElementById('widgets').scrollTo(0,1800)
1140     Drag And Drop By Offset   xpath=//*[@id='widget-gridster-Events-icon']   500  500
1141     Execute Javascript      document.getElementById('widgets').scrollTo(0,document.getElementById('widgets').scrollHeight);
1142     Execute Javascript      document.getElementById('dashboardDefaultPreference').click()
1143     Execute Javascript      document.getElementById('div-confirm-ok-button').click()
1144
1145 Add Portal Admin
1146     Click Link    xpath=//a[@id='parent-item-Portal-Admins']
1147     Scroll Element Into View    xpath=//button[@id='portal-admin-button-add']
1148     Click Button    xpath=//button[@id='portal-admin-button-add']
1149     Input Text    xpath=//input[@id='input-user-search']    ${Existing_User}
1150     Click Button    xpath=//button[@id='button-search-users']
1151     Wait Until Page Contains Element     xpath=//span[@id='result-uuid-0']    ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
1152     Click Element    xpath=//span[@id='result-uuid-0']
1153     Click Button     xpath=//button[@id='pa-search-users-button-save']
1154     Click Button     xpath=//button[@id='admin-div-ok-button']
1155
1156 Delete Portal Admin
1157     Wait Until Page Does Not Contain Element     xpath=//*[@class='b2b-modal-header']
1158     Click Link    xpath=//a[@id='parent-item-Portal-Admins']
1159     Click Element    xpath=//td[contains(.,'portal')]/following::span[@id='1-button-portal-admin-remove']
1160     Click Button     xpath=//*[@id='div-confirm-ok-button']