Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This is a resource file of OpenBMC ASMI It contains the |
| 3 | ... user-defined keywords which are available to all gui modules |
| 4 | |
| 5 | Library String |
| 6 | Library Collections |
| 7 | Library DateTime |
| 8 | Library XvfbRobot |
| 9 | Library OperatingSystem |
Rahul Maheshwari | 2b666cc | 2019-09-02 23:53:37 -0500 | [diff] [blame] | 10 | Library SeleniumLibrary |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 11 | Library AngularJSLibrary |
| 12 | Library SSHLibrary 30 Seconds |
| 13 | Library Process |
| 14 | Library supporting_libs.py |
Rahul Maheshwari | 439ce71 | 2019-03-07 03:23:13 -0600 | [diff] [blame] | 15 | Library ../../lib/gen_print.py |
| 16 | Library ../../lib/gen_robot_print.py |
| 17 | Library ../../lib/gen_valid.py |
| 18 | Library ../../lib/gen_robot_ssh.py |
| 19 | Library ../../lib/bmc_ssh_utils.py |
| 20 | Resource ../../lib/resource.robot |
| 21 | Resource ../../lib/rest_client.robot |
| 22 | Resource ../../lib/state_manager.robot |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 23 | Variables ../data/resource_variables.py |
| 24 | |
| 25 | *** Variables *** |
Sivas SRR | c70e9ae | 2018-02-14 23:53:49 -0600 | [diff] [blame] | 26 | ${obmc_gui_url} https://${OPENBMC_HOST} |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 27 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 28 | ${obmc_PowerOff_state} Off |
| 29 | ${obmc_PowerRunning_state} Running |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 30 | ${obmc_PowerStandby_state} Standby |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 31 | |
Rahul Maheshwari | dd38aef | 2018-11-15 23:33:10 -0600 | [diff] [blame] | 32 | # Default GUI broswer and mode is set to "Firefox" and "headless" |
| 33 | # respectively here. |
| 34 | ${GUI_BROWSER} ff |
| 35 | ${GUI_MODE} headless |
| 36 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 37 | *** Keywords *** |
| 38 | Launch OpenBMC GUI Browser |
| 39 | [Documentation] Launch the OpenBMC GUI URL on a browser. |
| 40 | # By default uses headless mode, otherwise, the GUI browser. |
| 41 | |
| 42 | ${op_system}= Get Operating System |
| 43 | Run Keyword If '${op_system}' == 'windows' |
Sivas SRR | a011348 | 2018-02-22 22:27:05 -0600 | [diff] [blame] | 44 | ... Launch Header Browser |
| 45 | ... ELSE IF '${op_system}' == 'Darwin' |
| 46 | # Mac OS is currently having some issues with firefox, so using |
| 47 | # chrome. |
| 48 | # TODO: Need to add support for other browsers. Issue #1280. |
| 49 | ... Launch Header Browser chrome |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 50 | ... ELSE |
Sivas SRR | a011348 | 2018-02-22 22:27:05 -0600 | [diff] [blame] | 51 | # Linux OS. |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 52 | ... Launch Headless Browser |
| 53 | |
| 54 | Get Operating System |
| 55 | [Documentation] Identify platform/OS. |
| 56 | |
| 57 | ${curdir_lower_case}= Convert To Lowercase ${CURDIR} |
| 58 | ${windows_platform}= Run Keyword And Return Status |
| 59 | ... Should Contain ${curdir_lower_case} c:\ |
| 60 | ${op_system}= Run Keyword If '${windows_platform}' == 'True' |
Sivas SRR | a011348 | 2018-02-22 22:27:05 -0600 | [diff] [blame] | 61 | ... Set Variable windows |
| 62 | ... ELSE |
| 63 | ... Run uname |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 64 | [Return] ${op_system} |
| 65 | |
Sivas SRR | a011348 | 2018-02-22 22:27:05 -0600 | [diff] [blame] | 66 | Launch Header Browser |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 67 | [Documentation] Open the browser with the URL and |
| 68 | ... login on windows platform. |
Rahul Maheshwari | dd38aef | 2018-11-15 23:33:10 -0600 | [diff] [blame] | 69 | [Arguments] ${browser_type}=${GUI_BROWSER} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 70 | |
Sivas SRR | a011348 | 2018-02-22 22:27:05 -0600 | [diff] [blame] | 71 | # Description of argument(s): |
| 72 | # browser_type Type of browser (e.g. "firefox", "chrome", etc.). |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 73 | |
Sivas SRR | a011348 | 2018-02-22 22:27:05 -0600 | [diff] [blame] | 74 | ${BROWSER_ID}= Open Browser ${obmc_gui_url} ${browser_type} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 75 | Maximize Browser Window |
| 76 | Set Global Variable ${BROWSER_ID} |
| 77 | |
| 78 | Launch Headless Browser |
| 79 | [Documentation] Launch headless browser. |
Rahul Maheshwari | dd38aef | 2018-11-15 23:33:10 -0600 | [diff] [blame] | 80 | [Arguments] ${URL}=${obmc_gui_url} ${browser}=${GUI_BROWSER} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 81 | |
Rahul Maheshwari | 79e276c | 2018-06-11 01:23:15 -0500 | [diff] [blame] | 82 | # Description of argument(s): |
| 83 | # URL Openbmc GUI URL to be open |
| 84 | # (e.g. https://openbmc-test.mybluemix.net/#/login). |
| 85 | # browser Browser to open given URL in headless way |
| 86 | # (e.g. gc for google chrome, ff for firefox). |
| 87 | |
| 88 | Start Virtual Display |
| 89 | ${browser_ID}= Open Browser ${URL} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 90 | Set Window Size 1920 1080 |
| 91 | |
Rahul Maheshwari | 79e276c | 2018-06-11 01:23:15 -0500 | [diff] [blame] | 92 | [Return] ${browser_ID} |
| 93 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 94 | Login OpenBMC GUI |
| 95 | [Documentation] Perform login to open BMC GUI. |
| 96 | [Arguments] ${username}=${OPENBMC_USERNAME} |
| 97 | ... ${password}=${OPENBMC_PASSWORD} |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 98 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 99 | # Description of argument(s): |
| 100 | # username The username. |
| 101 | # password The password. |
| 102 | |
Sivas SRR | c70e9ae | 2018-02-14 23:53:49 -0600 | [diff] [blame] | 103 | Go To ${obmc_gui_url} |
Sivas SRR | a692535 | 2018-02-19 08:59:03 -0600 | [diff] [blame] | 104 | Wait Until Element Is Enabled ${xpath_textbox_hostname} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 105 | Input Text ${xpath_textbox_hostname} ${OPENBMC_HOST} |
| 106 | Input Text ${xpath_textbox_username} ${username} |
| 107 | Input Password ${xpath_textbox_password} ${password} |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 108 | Click Element login__submit |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 109 | Wait Until Element Is Enabled ${xpath_button_logout} |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 110 | Page Should Contain Server information |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 111 | |
| 112 | |
| 113 | Test Setup Execution |
| 114 | [Documentation] Verify all the preconditions to be tested. |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 115 | [Arguments] ${obmc_test_setup_state}=${OBMC_PowerOff_state} |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 116 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 117 | # Description of argument(s): |
| 118 | # obmc_test_setup The OpenBMC required state. |
| 119 | |
Michael Walsh | c108e42 | 2019-03-28 12:27:18 -0500 | [diff] [blame] | 120 | Print Timen ${TEST NAME} ==> [STARTED] |
Rahul Maheshwari | 7872f05 | 2018-06-19 01:12:34 -0500 | [diff] [blame] | 121 | Launch Browser And Login OpenBMC GUI |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 122 | Log To Console Verifying the system state and stablity... |
Rahul Maheshwari | 8b5b5a4 | 2018-11-30 01:41:35 -0600 | [diff] [blame] | 123 | |
Anusha Dathatri | f7a407c | 2019-07-22 00:59:38 -0500 | [diff] [blame] | 124 | Click Element ${xpath_select_server_power} |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 125 | Wait Until Page Does Not Contain Unreachable |
Rahul Maheshwari | 8b5b5a4 | 2018-11-30 01:41:35 -0600 | [diff] [blame] | 126 | ${obmc_current_state}= Get Text ${xpath_power_indicator} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 127 | Rpvars obmc_current_state |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 128 | |
| 129 | ${obmc_state_status}= Run Keyword And Return Status |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 130 | ... Should Contain ${obmc_current_state} ${obmc_test_setup_state} |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 131 | Return From Keyword If '${obmc_state_status}' == 'True' |
| 132 | |
| 133 | ${obmc_standby_state}= Run Keyword And Return Status |
| 134 | ... Should Contain ${obmc_current_state} ${obmc_standby_state} |
| 135 | |
| 136 | Run Keyword If '${obmc_standby_state}' == 'True' |
| 137 | ... Reboot OpenBMC |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 138 | Run Keyword If '${obmc_test_setup_state}' == '${obmc_PowerRunning_state}' |
Rahul Maheshwari | 1ea8fec | 2018-12-07 12:42:04 -0600 | [diff] [blame] | 139 | ... Run Keywords Power On OpenBMC AND |
| 140 | ... Wait Until Keyword Succeeds 10 min 60 sec Is Host Running |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 141 | Run Keyword If '${obmc_test_setup_state}' == '${obmc_PowerOff_state}' |
| 142 | ... Power Off OpenBMC |
| 143 | |
| 144 | Power Off OpenBMC |
| 145 | [Documentation] Power off the OBMC system. |
| 146 | |
| 147 | Log To Console Power Off OpenBMC... |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 148 | Click Element ${xpath_select_server_power} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 149 | Execute JavaScript window.scrollTo(0, document.body.scrollHeight) |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 150 | Click Button ${xpath_select_button_orderly_shutdown} |
| 151 | Click Yes Button ${xpath_select_button_orderly_shutdown_yes} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 152 | Wait OpenBMC To Become Stable ${obmc_off_state} |
| 153 | |
| 154 | Power On OpenBMC |
| 155 | [Documentation] Power on the OBMC system. |
| 156 | |
| 157 | Log To Console Power On OpenBMC... |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 158 | Click Element ${xpath_select_server_power} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 159 | Click Button ${xpath_select_button_power_on } |
| 160 | Wait OpenBMC To Become Stable ${obmc_running_state} |
| 161 | |
| 162 | Reboot OpenBMC |
| 163 | [Documentation] Rebooting the OBMC system. |
| 164 | |
| 165 | Log To Console Reboting the OpenBMC... |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 166 | Click Element ${xpath_select_server_power} |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 167 | Click Button ${xpath_select_button_orderly_shutdown} |
| 168 | Click Yes Button ${xpath_select_button_orderly_shutdown_yes} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 169 | Wait OpenBMC To Become Stable ${obmc_off_state} |
| 170 | |
| 171 | Wait OpenBMC To Become Stable |
| 172 | [Documentation] Power off the OBMC. |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 173 | [Arguments] ${obmc_expected_state} ${retry_time}=15 min |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 174 | ... ${retry_interval}=45 sec |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 175 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 176 | # Description of argument(s): |
| 177 | # OBMC_expected_state The OBMC state which is required for test. |
| 178 | # retry_time Total wait time after executing the command. |
| 179 | # retry_interval Time interval for to keep checking with in the |
| 180 | # above total wait time. |
| 181 | |
| 182 | Wait Until Keyword Succeeds ${retry_time} ${retry_interval} |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 183 | ... Wait Until Element Contains ${xpath_select_server_power} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 184 | ... ${obmc_expected_state} |
| 185 | Wait Until Keyword Succeeds ${retry_time} ${retry_interval} |
| 186 | ... Verify OpenBMC State From REST Interface ${obmc_expected_state} |
| 187 | |
| 188 | Verify OpenBMC State From REST Interface |
| 189 | [Documentation] Verify system state from REST Interface. |
| 190 | [Arguments] ${obmc_required_state} |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 191 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 192 | # Description of argument(s): |
| 193 | # obmc_required_state The OBMC state which is required for test. |
| 194 | |
| 195 | ${obmc_current_state_REST}= Get Host State |
| 196 | Should Be Equal ${obmc_current_state_REST} ${obmc_required_state} |
| 197 | |
| 198 | Click Yes Button |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 199 | [Documentation] Click the 'Yes' button. |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 200 | [Arguments] ${xpath_button_yes} |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 201 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 202 | # Description of argument(s): |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 203 | # xpath_button_yes The xpath of 'Yes' button. |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 204 | |
| 205 | Click Button ${xpath_button_yes} |
| 206 | |
| 207 | LogOut OpenBMC GUI |
| 208 | [Documentation] Log out of OpenBMC GUI. |
| 209 | SSHLibrary.Close All Connections |
Sivas SRR | ae39abe | 2018-02-26 02:40:46 -0600 | [diff] [blame] | 210 | # Passing direct id element "header" as an argument to Click Element. |
Rahul Maheshwari | d36b6ac | 2018-06-19 01:44:06 -0500 | [diff] [blame] | 211 | Click Element ${xpath_button_logout} |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 212 | Wait Until Page Contains Element ${xpath_button_login} |
| 213 | |
| 214 | Test Teardown Execution |
| 215 | [Documentation] Do final closure activities of test case execution. |
Michael Walsh | c108e42 | 2019-03-28 12:27:18 -0500 | [diff] [blame] | 216 | Print Pgm Footer |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 217 | Print Dashes 0 100 1 = |
Rahul Maheshwari | cfdec85 | 2018-11-30 03:44:49 -0600 | [diff] [blame] | 218 | Close Browser |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 219 | |
Rahul Maheshwari | 1b5369b | 2018-06-11 00:57:03 -0500 | [diff] [blame] | 220 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 221 | Open Browser With URL |
| 222 | [Documentation] Open browser with specified URL and returns browser id. |
Rahul Maheshwari | dd38aef | 2018-11-15 23:33:10 -0600 | [diff] [blame] | 223 | [Arguments] ${URL} ${browser}=ff ${mode}=${GUI_MODE} |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 224 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 225 | # Description of argument(s): |
| 226 | # URL Openbmc GUI URL to be open |
Rahul Maheshwari | 79e276c | 2018-06-11 01:23:15 -0500 | [diff] [blame] | 227 | # (e.g. https://openbmc-test.mybluemix.net/#/login). |
| 228 | # browser Browser used to open above URL |
| 229 | # (e.g. gc for google chrome, ff for firefox). |
| 230 | # mode Browser opening mode(e.g. headless, header). |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 231 | |
Rahul Maheshwari | 79e276c | 2018-06-11 01:23:15 -0500 | [diff] [blame] | 232 | ${browser_ID}= Run Keyword If '${mode}' == 'headless' |
| 233 | ... Launch Headless Browser ${URL} ${browser} |
| 234 | ... ELSE Open Browser ${URL} ${browser} |
| 235 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 236 | [Return] ${browser_ID} |
| 237 | |
Rahul Maheshwari | 1b5369b | 2018-06-11 00:57:03 -0500 | [diff] [blame] | 238 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 239 | Controller Server Power Click Button |
| 240 | [Documentation] Click main server power in the header section. |
| 241 | [Arguments] ${controller_element} |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 242 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 243 | # Description of argument(s): |
| 244 | # controller_element Server power controller element |
| 245 | # (e.g. power__power-on.) |
| 246 | |
Rahul Maheshwari | dbbf179 | 2018-10-31 05:36:29 -0500 | [diff] [blame] | 247 | Click Element ${xpath_select_server_power} |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 248 | Wait Until Element Is Visible ${controller_element} |
| 249 | Page Should Contain Button ${controller_element} |
| 250 | Click Element ${controller_element} |
| 251 | |
| 252 | Controller Power Operations Confirmation Click Button |
| 253 | [Documentation] Click Common Power Operations Confirmation. |
| 254 | [Arguments] ${main_element} ${sub_element} ${confirm_msg_elt} ${confirmation} |
Sathyajith M S | 2cdab0a | 2018-02-13 19:36:28 -0600 | [diff] [blame] | 255 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 256 | # Description of argument(s): |
| 257 | # main_element Server power operations element |
| 258 | # (e.g. power_operations.) |
| 259 | # sub_element Server power operations sub element |
| 260 | # (e.g. warm_boot, shut_down.) |
| 261 | # confirm_msg_elt Server power operations confirm message element |
| 262 | # (e.g. confirm_msg.) |
| 263 | # confirmation Server power operations confirmation |
| 264 | # (e.g. yes.) |
| 265 | |
Joy Onyerikwu | f4a807b | 2018-06-20 08:43:54 -0500 | [diff] [blame] | 266 | ${element_path}= Catenate //*[@id='power-operations']/div[${main_element}]/div[${sub_element}] |
| 267 | ... /confirm/div/div[${confirm_msg_elt}]/button[${confirmation}] |
| 268 | Click Element ${element_path.replace(" ","")} |
| 269 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 270 | |
| 271 | GUI Power On |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 272 | [Documentation] Power on the host using GUI. |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 273 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 274 | Controller Server Power Click Button power__power-on |
Anusha Dathatri | 7ea44c1 | 2019-09-04 09:28:38 -0500 | [diff] [blame] | 275 | Wait Until Page Contains Running timeout=30s |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 276 | |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 277 | Verify Display Content |
| 278 | [Documentation] Verify text content display. |
| 279 | [Arguments] ${display_text} |
| 280 | |
| 281 | # Description of argument(s): |
| 282 | # display_text The text which is expected to be found on the web page. |
| 283 | |
| 284 | Page Should Contain ${display_text} |
| 285 | |
| 286 | Warm Reboot openBMC |
| 287 | [Documentation] Warm reboot the OBMC system. |
| 288 | |
| 289 | Log To Console Warm Reboting the OpenBMC... |
| 290 | Click Element ${xpath_select_button_warm_reboot} |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 291 | Verify Warning Message Display Text ${xpath_operation_warning_message} |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 292 | ... ${text_warm_reboot_warning_message} |
| 293 | Click Yes Button ${xpath_select_button_warm_reboot_yes} |
| 294 | Wait OpenBMC To Become Stable ${obmc_running_state} |
| 295 | |
| 296 | Click No Button |
| 297 | [Documentation] Click the 'No' button. |
| 298 | [Arguments] ${xpath_button_no} |
| 299 | |
| 300 | # Description of argument(s): |
| 301 | # xpath_button_no The xpath of 'No' button. |
| 302 | |
| 303 | Click Button ${xpath_button_no} |
| 304 | |
| 305 | Cold Reboot openBMC |
| 306 | [Documentation] Cold reboot the OBMC system. |
| 307 | |
| 308 | Log To Console Cold Reboting the OpenBMC... |
| 309 | Click Element ${xpath_select_button_cold_reboot} |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 310 | Verify Warning Message Display Text ${xpath_operation_warning_message} |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 311 | ... ${text_cold_reboot_warning_message} |
| 312 | Click Yes Button ${xpath_select_button_cold_reboot_yes} |
| 313 | Wait OpenBMC To Become Stable ${obmc_running_state} |
| 314 | |
| 315 | Orderly Shutdown OpenBMC |
| 316 | [Documentation] Do orderly shutdown the OBMC system. |
| 317 | |
| 318 | Log To Console Orderly Shutdown the OpenBMC... |
| 319 | Click Element ${xpath_select_button_orderly_shutdown} |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 320 | Verify Warning Message Display Text ${xpath_operation_warning_message} |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 321 | ... ${text_orderly_shutdown_warning_message} |
| 322 | Click Yes Button ${xpath_select_button_orderly_shutdown_yes} |
| 323 | Wait OpenBMC To Become Stable ${obmc_off_state} |
| 324 | |
| 325 | Immediate Shutdown openBMC |
| 326 | [Documentation] Do immediate shutdown the OBMC system. |
| 327 | |
| 328 | Log To Console Immediate Shutdown the OpenBMC... |
| 329 | Click Element ${xpath_select_button_immediate_shutdown} |
| 330 | Verify Warning Message Display Text |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 331 | ... ${xpath_operation_warning_message} |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 332 | ... ${text_immediate_shutdown_warning_message} |
| 333 | Click Yes Button ${xpath_select_button_immediate_shutdown_yes} |
| 334 | Wait OpenBMC To Become Stable ${obmc_off_state} |
| 335 | |
| 336 | Verify Warning Message Display Text |
| 337 | [Documentation] Verify the warning message display text. |
| 338 | [Arguments] ${xpath_text_message} ${text_message} |
| 339 | |
| 340 | # xpath_text_message Xpath of warning message display. |
| 341 | # text_message Content of the display message info. |
| 342 | |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 343 | Element Should Contain ${xpath_text_message} ${text_message} |
Sivas SRR | ca534e6 | 2018-02-20 02:22:02 -0600 | [diff] [blame] | 344 | |
| 345 | |
| 346 | Expected Initial Test State |
| 347 | [Documentation] Power on the host if "Running" expected, Power off the |
| 348 | ... host if "Off" expected as per the requirement of initial test state. |
| 349 | [Arguments] ${expectedState} |
| 350 | # Description of argument(s): |
| 351 | # expectedState Test initial host state. |
| 352 | |
| 353 | Run Keyword If '${expectedState}' == 'Running' |
Rahul Maheshwari | 2349169 | 2018-11-09 03:42:41 -0600 | [diff] [blame] | 354 | ... REST Power On stack_mode=skip quiet=1 |
Sivas SRR | ca534e6 | 2018-02-20 02:22:02 -0600 | [diff] [blame] | 355 | |
| 356 | Run Keyword If '${expectedState}' == 'Off' |
Rahul Maheshwari | 2349169 | 2018-11-09 03:42:41 -0600 | [diff] [blame] | 357 | ... REST Power Off stack_mode=skip quiet=1 |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 358 | |
| 359 | Launch Browser And Login OpenBMC GUI |
| 360 | [Documentation] Launch browser and log into openbmc GUI. |
| 361 | |
| 362 | Open Browser With URL ${obmc_gui_url} |
| 363 | Login OpenBMC GUI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 364 | |
| 365 | Logout And Close Browser |
| 366 | [Documentation] Logout from openbmc application and close the browser. |
| 367 | |
Rahul Maheshwari | 1a6945e | 2018-11-26 03:21:40 -0600 | [diff] [blame] | 368 | Click Element //*[text()='Log out'] |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 369 | Close Browser |