blob: d69d5ffb15f2e0ffc8fbf9e7245083b7c5d1b7e9 [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
6Library ExtendedSelenium2Library
7Library 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
52Login To Portal GUI
53 [Documentation] Logs in to Portal GUI
54 [Arguments] ${loginId} ${password}
55 # Setup Browser Now being managed by test case
56 ### revert to local Setup Browser for Login test
57 Setup Browser
58 Go To ${PORTAL_LOGIN_URL}
59 #Maximize Browser Window
60 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
61 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
62 Log Logging in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
63 Handle Proxy Warning
64 Title Should Be Login
65 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
66 Input Password xpath=//input[@ng-model='password'] ${password}
67 #Click Button xpath=//a[@ng-click='loginExternal();']
68 Click Element xpath=//a[@id='loginBtn']
69 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
70 Log Logged in to ${PORTAL_ENDPOINT}${PORTAL_ENV}
71 Log To Console ${loginId} SUCCESS
72
73Go To Portal HOME
74 [Documentation] Naviage to Portal Home
75 Go To ${PORTAL_HOME_URL}
76 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
77
78Click On Button When Enabled
79 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
80 Wait Until Page Contains Element xpath=${xpath} ${timeout}
81 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
82 Click Button xpath=${xpath}
83
84Click On Element When Visible
85 [Arguments] ${xpath} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
86 Wait Until Page Contains Element xpath=${xpath} ${timeout}
87 Wait Until Element Is Visible xpath=${xpath} ${timeout}
88 Click Element xpath=${xpath}
89
90Select From List When Enabled
91 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
92 Wait Until Page Contains Element xpath=${xpath} ${timeout}
93 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
94 Select From List xpath=${xpath} ${value}
95
96Input Text When Enabled
97 [Arguments] ${xpath} ${value} ${timeout}=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
98 Wait Until Page Contains Element xpath=${xpath} ${timeout}
99 Wait Until Element Is Enabled xpath=${xpath} ${timeout}
100 Input Text xpath=${xpath} ${value}
101