blob: 2281b1eb5766fdd19791875222e97889cb3c89be [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
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
Brian Freeman053ce592018-04-11 09:40:57 -050062Login To Portal GUI
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
67 Setup Browser
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}
73 Handle Proxy Warning
74 Title Should Be Login
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
82
Brian Freemanb9d6fbf2018-04-11 19:15:27 -050083Run 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
88 Setup Browser
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}
94 Handle Proxy Warning
95 Title Should Be Login
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
102 Sleep 5
103 Click Element id=${click_element}
104 Sleep 5
105 Select Frame id=${tabframe}
106 Sleep 5
107 Page Should Contain ${match_string}
108 Log To Console Portal Application Access SUCCESS ${click_element}
109
Brian Freeman053ce592018-04-11 09:40:57 -0500110Go To Portal HOME
111 [Documentation] Naviage to Portal Home
112 Go To ${PORTAL_HOME_URL}
113 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
114
115Click 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}
120
121Click 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}
126
127Select 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}
132
133Input 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}
138