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 RequestsClientCert
4 Library RequestsLibrary
6 Library ExtendedSelenium2Library
10 Resource global_properties.robot
11 Resource browser_setup.robot
14 ${PORTAL_HEALTH_CHECK_PATH} /ONAPPORTAL/portalApi/healthCheck
15 ${PORTAL_ENDPOINT} ${GLOBAL_PORTAL_SERVER_PROTOCOL}://${GLOBAL_INJECTED_PORTAL_IP_ADDR}:${GLOBAL_PORTAL_SERVER_PORT}
16 ${PORTAL_GUI_ENDPOINT} ${GLOBAL_PORTAL_SERVER_PROTOCOL}://portal.api.simpledemo.onap.org:${GLOBAL_PORTAL_SERVER_PORT}
17 ${PORTAL_ENV} /ONAPPORTAL
18 ${PORTAL_LOGIN_URL} ${PORTAL_GUI_ENDPOINT}${PORTAL_ENV}/login.htm
19 ${PORTAL_HOME_URL} ${PORTAL_GUI_ENDPOINT}${PORTAL_ENV}/applicationsHome
22 Run Portal Health Check
23 [Documentation] Runs Portal Health check
24 ${resp}= Run Portal Get Request ${PORTAL_HEALTH_CHECK_PATH}
25 Should Be Equal As Strings ${resp.status_code} 200
26 Should Be Equal As Strings ${resp.json()['statusCode']} 200
28 Run Portal Get Request
29 [Documentation] Runs Portal Get request
30 [Arguments] ${data_path}
31 ${session}= Create Session portal ${PORTAL_ENDPOINT}
32 ${uuid}= Generate UUID
33 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
34 ${resp}= Get Request portal ${data_path} headers=${headers}
35 Log Received response from portal ${resp.text}
38 Run Portal Login Tests
39 [Documentation] Runs Portal Login Tests
41 Login To Portal GUI demo demo123456!
43 Login To Portal GUI cs0008 demo123456!
45 Login To Portal GUI jm0007 demo123456!
47 Login To Portal GUI gv0001 demo123456!
49 Login To Portal GUI op0001 demo123456!
52 Run Portal Application Access Tests
53 [Documentation] Runs Portal Application Access Tests
54 Log To Console Testing SDC,VID,Policy
55 Run Portal Application Login Test cs0008 demo123456! gridster-SDC-icon-link tabframe-SDC Welcome to SDC
57 Run Portal Application Login Test demo demo123456! gridster-Virtual-Infrastructure-Deployment-icon-link tabframe-Virtual-Infrastructure-Deployment Welcome to VID
59 Run Portal Application Login Test demo demo123456! gridster-Policy-icon-link tabframe-Policy Policy Editor
63 [Documentation] Logs in to Portal GUI
64 [Arguments] ${loginId} ${password}
65 # Setup Browser Now being managed by test case
66 ### revert to local Setup Browser for Login test
68 Go To ${PORTAL_LOGIN_URL}
69 #Maximize Browser Window
70 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
71 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
72 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
75 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
76 Input Password xpath=//input[@ng-model='password'] ${password}
77 #Click Button xpath=//a[@ng-click='loginExternal();']
78 Click Element xpath=//a[@id='loginBtn']
79 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
80 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
81 Log To Console ${loginId} SUCCESS
83 Run Portal Application Login Test
84 [Documentation] Login to Portal Application
85 [Arguments] ${loginId} ${password} ${click_element} ${tabframe} ${match_string}
86 # Setup Browser Now being managed by test case
87 ### revert to local Setup Browser for Login test
89 Go To ${PORTAL_LOGIN_URL}
90 #Maximize Browser Window
91 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
92 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
93 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
96 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
97 Input Password xpath=//input[@ng-model='password'] ${password}
98 Click Element xpath=//a[@id='loginBtn']
99 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
100 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
101 Log To Console ${loginId} SUCCESS
103 Click Element id=${click_element}
105 Select Frame id=${tabframe}
107 Page Should Contain ${match_string}
108 Log To Console Portal Application Access SUCCESS ${click_element}
111 [Documentation] Naviage to Portal Home
112 Go To ${PORTAL_HOME_URL}
113 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
115 Click On Button When Enabled
116 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
117 Wait Until Page Contains Element xpath=${xpath} ${timeout}
118 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
119 Click Button xpath=${xpath}
121 Click On Element When Visible
122 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
123 Wait Until Page Contains Element xpath=${xpath} ${timeout}
124 Wait Until Element Is Visible xpath=${xpath} ${timeout}
125 Click Element xpath=${xpath}
127 Select From List When Enabled
128 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
129 Wait Until Page Contains Element xpath=${xpath} ${timeout}
130 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
131 Select From List xpath=${xpath} ${value}
133 Input Text When Enabled
134 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
135 Wait Until Page Contains Element xpath=${xpath} ${timeout}
136 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
137 Input Text xpath=${xpath} ${value}