blob: bc9250122e34a83b0e2c047e39c2868e78129189 [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 RequestsLibrary
4Library UUID
DR695H910097e2019-05-08 13:55:32 -04005Library SeleniumLibrary
Brian Freeman053ce592018-04-11 09:40:57 -05006Library Collections
7Library String
DR695Hccff30b2017-02-17 18:44:24 -05008
Brian Freeman053ce592018-04-11 09:40:57 -05009Resource global_properties.robot
10Resource browser_setup.robot
DR695Hccff30b2017-02-17 18:44:24 -050011
12*** Variables ***
Eric Debeau85b749b2017-10-21 15:22:02 +000013${PORTAL_HEALTH_CHECK_PATH} /ONAPPORTAL/portalApi/healthCheck
DR695Hbf5a3a32017-06-30 13:09:57 -040014${PORTAL_ENDPOINT} ${GLOBAL_PORTAL_SERVER_PROTOCOL}://${GLOBAL_INJECTED_PORTAL_IP_ADDR}:${GLOBAL_PORTAL_SERVER_PORT}
Brian Freeman053ce592018-04-11 09:40:57 -050015${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
DR695Hccff30b2017-02-17 18:44:24 -050019
20*** Keywords ***
21Run 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
26
27Run Portal Get Request
28 [Documentation] Runs Portal Get request
29 [Arguments] ${data_path}
DR695Hbf5a3a32017-06-30 13:09:57 -040030 ${session}= Create Session portal ${PORTAL_ENDPOINT}
DR695Hccff30b2017-02-17 18:44:24 -050031 ${uuid}= Generate UUID
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}
35 [Return] ${resp}
36
Brian Freeman053ce592018-04-11 09:40:57 -050037Run Portal Login Tests
38 [Documentation] Runs Portal Login Tests
39 Close All Browsers
40 Login To Portal GUI demo demo123456!
41 Close All Browsers
42 Login To Portal GUI cs0008 demo123456!
43 Close All Browsers
44 Login To Portal GUI jm0007 demo123456!
45 Close All Browsers
46 Login To Portal GUI gv0001 demo123456!
47 Close All Browsers
48 Login To Portal GUI op0001 demo123456!
49 Close All Browsers
50
Brian Freemanb9d6fbf2018-04-11 19:15:27 -050051Run Portal Application Access Tests
52 [Documentation] Runs Portal Application Access Tests
53 Log To Console Testing SDC,VID,Policy
54 Run Portal Application Login Test cs0008 demo123456! gridster-SDC-icon-link tabframe-SDC Welcome to SDC
55 Close All Browsers
56 Run Portal Application Login Test demo demo123456! gridster-Virtual-Infrastructure-Deployment-icon-link tabframe-Virtual-Infrastructure-Deployment Welcome to VID
57 Close All Browsers
58 Run Portal Application Login Test demo demo123456! gridster-Policy-icon-link tabframe-Policy Policy Editor
59 Close All Browsers
60
DR695H910097e2019-05-08 13:55:32 -040061Login To Portal GUI And Go Home
62 [Documentation] Logs in to Portal GUI
63 [Arguments] ${loginId} ${password}
64 Login To Portal GUI ${loginId} ${password}
65 Go To Portal HOME
66
Brian Freeman053ce592018-04-11 09:40:57 -050067Login To Portal GUI
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
72 Setup Browser
73 Go To ${PORTAL_LOGIN_URL}
Brian Freeman053ce592018-04-11 09:40:57 -050074 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}
77 Handle Proxy Warning
78 Title Should Be Login
79 Input Text xpath=//input[@ng-model='loginId'] ${loginId}
80 Input Password xpath=//input[@ng-model='password'] ${password}
Brian Freeman053ce592018-04-11 09:40:57 -050081 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 To Console ${loginId} SUCCESS
DR695H910097e2019-05-08 13:55:32 -040085
86Logout 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}
Brian Freeman053ce592018-04-11 09:40:57 -050092
Brian Freemanb9d6fbf2018-04-11 19:15:27 -050093Run 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
98 Setup Browser
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}
104 Handle Proxy Warning
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 To Console ${loginId} SUCCESS
112 Sleep 5
113 Click Element id=${click_element}
114 Sleep 5
115 Select Frame id=${tabframe}
116 Sleep 5
117 Page Should Contain ${match_string}
118 Log To Console Portal Application Access SUCCESS ${click_element}
119
Brian Freeman053ce592018-04-11 09:40:57 -0500120Go To Portal HOME
121 [Documentation] Naviage to Portal Home
122 Go To ${PORTAL_HOME_URL}
123 Wait Until Page Contains Applications ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
124
125Click 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}
130
131Click 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}
136
137Select 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 xpath=${xpath} ${value}
142
143Input 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}
148