blob: 67c98889d62bff418d6c1672e1a69be8174e7381 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with Portal. It handles low level stuff like managing the http request library and Portal required fields
Brian Freeman053ce592018-04-11 09:40:57 -05003Library RequestsClientCert
4Library RequestsLibrary
5Library UUID
DR695H910097e2019-05-08 13:55:32 -04006Library SeleniumLibrary
Brian Freeman053ce592018-04-11 09:40:57 -05007Library Collections
8Library String
DR695Hccff30b2017-02-17 18:44:24 -05009
Brian Freeman053ce592018-04-11 09:40:57 -050010Resource global_properties.robot
11Resource browser_setup.robot
DR695Hccff30b2017-02-17 18:44:24 -050012
13*** Variables ***
Eric Debeau85b749b2017-10-21 15:22:02 +000014${PORTAL_HEALTH_CHECK_PATH} /ONAPPORTAL/portalApi/healthCheck
DR695Hbf5a3a32017-06-30 13:09:57 -040015${PORTAL_ENDPOINT} ${GLOBAL_PORTAL_SERVER_PROTOCOL}://${GLOBAL_INJECTED_PORTAL_IP_ADDR}:${GLOBAL_PORTAL_SERVER_PORT}
Brian Freeman053ce592018-04-11 09:40:57 -050016${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
DR695Hccff30b2017-02-17 18:44:24 -050020
21*** Keywords ***
22Run 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
27
28Run Portal Get Request
29 [Documentation] Runs Portal Get request
30 [Arguments] ${data_path}
DR695Hbf5a3a32017-06-30 13:09:57 -040031 ${session}= Create Session portal ${PORTAL_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -050032 ${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}
36 [Return] ${resp}
37
Brian Freeman053ce592018-04-11 09:40:57 -050038Run Portal Login Tests
39 [Documentation] Runs Portal Login Tests
40 Close All Browsers
41 Login To Portal GUI demo demo123456!
42 Close All Browsers
43 Login To Portal GUI cs0008 demo123456!
44 Close All Browsers
45 Login To Portal GUI jm0007 demo123456!
46 Close All Browsers
47 Login To Portal GUI gv0001 demo123456!
48 Close All Browsers
49 Login To Portal GUI op0001 demo123456!
50 Close All Browsers
51
Brian Freemanb9d6fbf2018-04-11 19:15:27 -050052Run 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
56 Close All Browsers
57 Run Portal Application Login Test demo demo123456! gridster-Virtual-Infrastructure-Deployment-icon-link tabframe-Virtual-Infrastructure-Deployment Welcome to VID
58 Close All Browsers
59 Run Portal Application Login Test demo demo123456! gridster-Policy-icon-link tabframe-Policy Policy Editor
60 Close All Browsers
61
DR695H910097e2019-05-08 13:55:32 -040062Login To Portal GUI And Go Home
63 [Documentation] Logs in to Portal GUI
64 [Arguments] ${loginId} ${password}
65 Login To Portal GUI ${loginId} ${password}
66 Go To Portal HOME
67
Brian Freeman053ce592018-04-11 09:40:57 -050068Login To Portal GUI
69 [Documentation] Logs in to Portal GUI
70 [Arguments] ${loginId} ${password}
71 # Setup Browser Now being managed by test case
72 ### revert to local Setup Browser for Login test
73 Setup Browser
74 Go To ${PORTAL_LOGIN_URL}
Brian Freeman053ce592018-04-11 09:40:57 -050075 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
76 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
77 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
78 Handle Proxy Warning
79 Title Should Be Login
80 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
81 Input Password xpath=//input[@ng-model='password'] ${password}
Brian Freeman053ce592018-04-11 09:40:57 -050082 Click Element xpath=//a[@id='loginBtn']
83 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
84 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
85 Log To Console ${loginId} SUCCESS
DR695H910097e2019-05-08 13:55:32 -040086
87Logout From Portal GUI
88 [Documentation] Logs out of Portal GUI
89 Go To ${PORTAL_LOGIN_URL}
90 Click Element xpath=//div[@id='header-user-icon']
91 Run Keyword And Ignore Error Click Button xpath=//button[contains(.,'Log out')]
92 Log Logged out of ${PORTAL_ENDPOINT}${PORTAL_ENV}
Brian Freeman053ce592018-04-11 09:40:57 -050093
Brian Freemanb9d6fbf2018-04-11 19:15:27 -050094Run Portal Application Login Test
95 [Documentation] Login to Portal Application
96 [Arguments] ${loginId} ${password} ${click_element} ${tabframe} ${match_string}
97 # Setup Browser Now being managed by test case
98 ### revert to local Setup Browser for Login test
99 Setup Browser
100 Go To ${PORTAL_LOGIN_URL}
101 #Maximize Browser Window
102 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
103 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
104 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
105 Handle Proxy Warning
106 Title Should Be Login
107 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
108 Input Password xpath=//input[@ng-model='password'] ${password}
109 Click Element xpath=//a[@id='loginBtn']
110 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
111 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
112 Log To Console ${loginId} SUCCESS
113 Sleep 5
114 Click Element id=${click_element}
115 Sleep 5
116 Select Frame id=${tabframe}
117 Sleep 5
118 Page Should Contain ${match_string}
119 Log To Console Portal Application Access SUCCESS ${click_element}
120
Brian Freeman053ce592018-04-11 09:40:57 -0500121Go To Portal HOME
122 [Documentation] Naviage to Portal Home
123 Go To ${PORTAL_HOME_URL}
124 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
125
126Click On Button When Enabled
127 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
128 Wait Until Page Contains Element xpath=${xpath} ${timeout}
129 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
130 Click Button xpath=${xpath}
131
132Click On Element When Visible
133 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
134 Wait Until Page Contains Element xpath=${xpath} ${timeout}
135 Wait Until Element Is Visible xpath=${xpath} ${timeout}
136 Click Element xpath=${xpath}
137
138Select From List When Enabled
139 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
140 Wait Until Page Contains Element xpath=${xpath} ${timeout}
141 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
142 Select From List xpath=${xpath} ${value}
143
144Input Text When Enabled
145 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
146 Wait Until Page Contains Element xpath=${xpath} ${timeout}
147 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
148 Input Text xpath=${xpath} ${value}
149