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_ENV} /ONAPPORTAL
17 ${PORTAL_LOGIN_URL} ${PORTAL_GUI_ENDPOINT}${PORTAL_ENV}/login.htm
18 ${PORTAL_HOME_URL} ${PORTAL_GUI_ENDPOINT}${PORTAL_ENV}/applicationsHome
21 Run Portal Health Check
22 [Documentation] Runs Portal Health check
23 ${resp}= Run Portal Get Request ${PORTAL_HEALTH_CHECK_PATH}
24 Should Be Equal As Strings ${resp.status_code} 200
25 Should Be Equal As Strings ${resp.json()['statusCode']} 200
27 Run Portal Get Request
28 [Documentation] Runs Portal Get request
29 [Arguments] ${data_path}
30 ${session}= Create Session portal ${PORTAL_ENDPOINT}
31 ${uuid}= Generate UUID4
32 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
33 ${resp}= Get Request portal ${data_path} headers=${headers}
34 Log Received response from portal ${resp.text}
37 Run Portal Login Tests
38 [Documentation] Runs Portal Login Tests
40 Login To Portal GUI demo demo123456!
42 Login To Portal GUI cs0008 demo123456!
44 Login To Portal GUI jm0007 demo123456!
46 Login To Portal GUI gv0001 demo123456!
48 Login To Portal GUI op0001 demo123456!
51 Run Portal Application Access Tests
52 [Documentation] Runs Portal Application Access Tests
53 Log Testing SDC,VID,Policy
54 Run Portal Application Login Test cs0008 demo123456! gridster-SDC-icon-link tabframe-SDC Welcome to SDC
56 Run Portal Application Login Test demo demo123456! gridster-Virtual-Infrastructure-Deployment-icon-link tabframe-Virtual-Infrastructure-Deployment Welcome to VID
58 Run Portal Application Login Test demo demo123456! gridster-Policy-icon-link tabframe-Policy Policy Editor
61 Login To Portal GUI And Go Home
62 [Documentation] Logs in to Portal GUI
63 [Arguments] ${loginId} ${password}
64 Login To Portal GUI ${loginId} ${password}
68 [Documentation] Logs in to Portal GUI
69 [Arguments] ${loginId} ${password}
70 # Setup Browser Now being managed by test case
71 ### revert to local Setup Browser for Login test
73 Go To ${PORTAL_LOGIN_URL}
74 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
75 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
76 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
79 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
80 Input Password xpath=//input[@ng-model='password'] ${password}
81 Click Element xpath=//a[@id='loginBtn']
82 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
83 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
84 Log ${loginId} SUCCESS
86 Logout From Portal GUI
87 [Documentation] Logs out of Portal GUI
88 Go To ${PORTAL_LOGIN_URL}
89 Click Element xpath=//div[@id='header-user-icon']
90 Run Keyword And Ignore Error Click Button xpath=//button[contains(.,'Log out')]
91 Log Logged out of ${PORTAL_ENDPOINT}${PORTAL_ENV}
93 Run Portal Application Login Test
94 [Documentation] Login to Portal Application
95 [Arguments] ${loginId} ${password} ${click_element} ${tabframe} ${match_string}
96 # Setup Browser Now being managed by test case
97 ### revert to local Setup Browser for Login test
99 Go To ${PORTAL_LOGIN_URL}
100 #Maximize Browser Window
101 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
102 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
103 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
105 Title Should Be Login
106 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
107 Input Password xpath=//input[@ng-model='password'] ${password}
108 Click Element xpath=//a[@id='loginBtn']
109 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
110 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
111 Log ${loginId} SUCCESS
113 Click Element id=${click_element}
115 Select Frame id=${tabframe}
117 Page Should Contain ${match_string}
118 Log Portal Application Access SUCCESS ${click_element}
121 [Documentation] Naviage to Portal Home
122 Go To ${PORTAL_HOME_URL}
123 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
125 Click On Button When Enabled
126 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
127 Wait Until Page Contains Element xpath=${xpath} ${timeout}
128 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
129 Click Button xpath=${xpath}
131 Click On Element When Visible
132 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
133 Wait Until Page Contains Element xpath=${xpath} ${timeout}
134 Wait Until Element Is Visible xpath=${xpath} ${timeout}
135 Click Element xpath=${xpath}
137 Select From List When Enabled
138 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
139 Wait Until Page Contains Element xpath=${xpath} ${timeout}
140 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
141 Select From List By Value xpath=${xpath} ${value}
143 Input Text When Enabled
144 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
145 Wait Until Page Contains Element xpath=${xpath} ${timeout}
146 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
147 Input Text xpath=${xpath} ${value}