2 Documentation The main interface for interacting with Portal. It handles low level stuff like managing the http request library and Portal required fields
3 Library RequestsLibrary
4 Library ONAPLibrary.Utilities
5 Library SeleniumLibrary
9 Resource global_properties.robot
10 Resource browser_setup.robot
13 ${PORTAL_HEALTH_CHECK_PATH} /ONAPPORTAL/portalApi/healthCheck
14 ${PORTAL_ENDPOINT} ${GLOBAL_PORTAL_SERVER_PROTOCOL}://${GLOBAL_INJECTED_PORTAL_IP_ADDR}:${GLOBAL_PORTAL_SERVER_PORT}
15 #${PORTAL_GUI_ENDPOINT} ${GLOBAL_PORTAL_SERVER_PROTOCOL}://portal.api.simpledemo.onap.org:${GLOBAL_PORTAL_SERVER_PORT}
16 #${PORTAL_GUI_ENDPOINT} ${GLOBAL_PORTAL_SERVER_PROTOCOL}://portal-app.onap:${GLOBAL_PORTAL_SERVER_PORT}
17 ${PORTAL_GUI_ENDPOINT} https://portal.api.simpledemo.onap.org:30225
18 ${PORTAL_ENV} /ONAPPORTAL
19 ${PORTAL_LOGIN_URL} ${PORTAL_GUI_ENDPOINT}${PORTAL_ENV}/login.htm
20 ${PORTAL_HOME_URL} ${PORTAL_GUI_ENDPOINT}${PORTAL_ENV}/applicationsHome
23 Run Portal Health Check
24 [Documentation] Runs Portal Health check
25 ${resp}= Run Portal Get Request ${PORTAL_HEALTH_CHECK_PATH}
26 Should Be Equal As Strings ${resp.status_code} 200
27 Should Be Equal As Strings ${resp.json()['statusCode']} 200
29 Run Portal Get Request
30 [Documentation] Runs Portal Get request
31 [Arguments] ${data_path}
32 ${session}= Create Session portal ${PORTAL_ENDPOINT}
33 ${uuid}= Generate UUID4
34 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
35 ${resp}= Get Request portal ${data_path} headers=${headers}
36 Log Received response from portal ${resp.text}
39 Run Portal Login Tests
40 [Documentation] Runs Portal Login Tests
42 Login To Portal GUI demo demo123456!
44 Login To Portal GUI cs0008 demo123456!
46 Login To Portal GUI jm0007 demo123456!
48 Login To Portal GUI gv0001 demo123456!
50 Login To Portal GUI op0001 demo123456!
53 Run Portal Application Access Tests
54 [Documentation] Runs Portal Application Access Tests
55 Log Testing SDC,VID,Policy console=yes
56 ${status} ${resp} Run Keyword And Ignore Error Run Portal Application Login Test cs0008 demo123456! gridster-SDC-icon-link tabframe-SDC Welcome to SDC
57 Log SDC ${status} console=yes
59 ${status} ${resp} Run Keyword And Ignore Error Run Portal Application Login Test demo demo123456! gridster-Virtual-Infrastructure-Deployment-icon-link tabframe-Virtual-Infrastructure-Deployment Welcome to VID
60 Log VID ${status} console=yes
62 ${status} ${resp} Run Keyword And Ignore Error Run Portal Application Login Test demo demo123456! gridster-A&AI-UI-icon-link tabframe-A&AI-UI A&AI
63 Log A&AI UI ${status} console=yes
65 ${status} ${resp} Run Keyword And Ignore Error Run Portal Application Login Test demo demo123456! gridster-Policy-icon-link tabframe-Policy Policy Editor
66 Log Policy ${status} console=yes
68 ${status} ${resp} Run Keyword And Ignore Error Run Portal Application Login Test demo demo123456! gridster-SO-Monitoring-icon-link tabframe-SO-Monitoring SO
69 Log SO-Monitoring ${status} console=yes
72 Login To Portal GUI And Go Home
73 [Documentation] Logs in to Portal GUI
74 [Arguments] ${loginId} ${password}
75 Login To Portal GUI ${loginId} ${password}
79 [Documentation] Logs in to Portal GUI
80 [Arguments] ${loginId} ${password}
81 # Setup Browser Now being managed by test case
82 ### revert to local Setup Browser for Login test
84 Go To ${PORTAL_LOGIN_URL}
85 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
86 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
87 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
91 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
92 Input Password xpath=//input[@ng-model='password'] ${password}
93 Click Element xpath=//a[@id='loginBtn']
95 #Go To ${PORTAL_HOME_URL}
96 #Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
97 Wait Until Page Contains Applications 30
98 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
99 Log ${loginId} SUCCESS
101 Logout From Portal GUI
102 [Documentation] Logs out of Portal GUI
103 Go To ${PORTAL_LOGIN_URL}
104 Click Element xpath=//div[@id='header-user-icon']
105 Run Keyword And Ignore Error Click Button xpath=//button[contains(.,'Log out')]
106 Log Logged out of ${PORTAL_ENDPOINT}${PORTAL_ENV}
108 Run Portal Application Login Test
109 [Documentation] Login to Portal Application
110 [Arguments] ${loginId} ${password} ${click_element} ${tabframe} ${match_string}
111 # Setup Browser Now being managed by test case
112 ### revert to local Setup Browser for Login test
114 Set Window Size 2000 1000
115 Go To ${PORTAL_LOGIN_URL}
116 #Maximize Browser Window
117 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
118 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
119 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
121 Title Should Be Login
122 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
123 Input Password xpath=//input[@ng-model='password'] ${password}
124 Click Element xpath=//a[@id='loginBtn']
126 #Go To ${PORTAL_HOME_URL}
127 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
128 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
129 Log ${loginId} SUCCESS
131 Click Element id=${click_element}
133 Select Frame id=${tabframe}
135 Wait Until Page Contains ${match_string} 60
138 [Documentation] Naviage to Portal Home
139 Go To ${PORTAL_HOME_URL}
140 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
142 Click On Button When Enabled
143 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
144 Wait Until Page Contains Element xpath=${xpath} ${timeout}
145 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
146 Click Button xpath=${xpath}
148 Click On Element When Visible
149 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
150 Wait Until Page Contains Element xpath=${xpath} ${timeout}
151 Wait Until Element Is Visible xpath=${xpath} ${timeout}
152 Click Element xpath=${xpath}
154 Select From List When Enabled
155 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
156 Wait Until Page Contains Element xpath=${xpath} ${timeout}
157 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
158 Select From List By Label xpath=${xpath} ${value}
160 Input Text When Enabled
161 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
162 Wait Until Page Contains Element xpath=${xpath} ${timeout}
163 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
164 Input Text xpath=${xpath} ${value}