Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test OpenBMC GUI "Server power operations" sub-menu of "Server control". |
| 4 | |
| 5 | Resource ../../lib/resource.robot |
manashsarma | 73d24f1 | 2020-08-25 07:42:53 -0500 | [diff] [blame] | 6 | Resource ../../../lib/state_manager.robot |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 7 | |
| 8 | Suite Setup Launch Browser And Login GUI |
| 9 | Suite Teardown Close Browser |
| 10 | Test Setup Test Setup Execution |
| 11 | |
| 12 | |
| 13 | *** Variables *** |
| 14 | |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 15 | ${xpath_server_power_heading} //h1[text()="Server power operations"] |
manashsarma | 6164975 | 2020-08-19 07:01:19 -0500 | [diff] [blame] | 16 | ${xpath_enable_onetime_boot_checkbox} //*[contains(@class,'custom-checkbox')] |
| 17 | ${xpath_boot_option_select} //*[@id='boot-option'] |
manashsarma | 66f9a62 | 2020-08-23 06:39:53 -0500 | [diff] [blame] | 18 | ${xpath_shutdown_button} //*[@data-test-id='serverPowerOperations-button-shutDown'] |
| 19 | ${xpath_reboot_button} //*[@data-test-id='serverPowerOperations-button-reboot'] |
| 20 | ${xpath_poweron_button} //*[@data-test-id='serverPowerOperations-button-powerOn'] |
| 21 | ${xpath_tpm_policy_button} //input[@id='tpm-required-policy'] |
| 22 | ${xpath_save_button} //button[contains(text(),'Save')] |
manashsarma | 73d24f1 | 2020-08-25 07:42:53 -0500 | [diff] [blame] | 23 | ${xpath_shutdown_orderly_radio} //*[@data-test-id='serverPowerOperations-radio-shutdownOrderly'] |
| 24 | ${xpath_shutdown_immediate_radio} //*[@data-test-id='serverPowerOperations-radio-shutdownImmediate'] |
| 25 | ${xpath_confirm_button} //button[contains(text(),'Confirm')] |
| 26 | ${xpath_current_power_state} //*[contains(@class,'row mb-4')] |
manashsarma | 348585c | 2020-08-27 06:52:39 -0500 | [diff] [blame] | 27 | ${xpath_reboot_orderly_radio} //*[@data-test-id='serverPowerOperations-radio-rebootOrderly'] |
| 28 | ${xpath_reboot_immediate_radio} //*[@data-test-id='serverPowerOperations-radio-rebootImmediate'] |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 29 | |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 30 | *** Test Cases *** |
| 31 | |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 32 | Verify Navigation To Server Power Operations Page |
| 33 | [Documentation] Verify navigation to server power operations page. |
| 34 | [Tags] Verify_Navigation_To_Server_Power_Operations_Page |
manashsarma | 484fefc | 2020-08-23 12:38:49 -0500 | [diff] [blame] | 35 | |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 36 | Page Should Contain Element ${xpath_server_power_heading} |
manashsarma | 484fefc | 2020-08-23 12:38:49 -0500 | [diff] [blame] | 37 | |
| 38 | |
manashsarma | 73d24f1 | 2020-08-25 07:42:53 -0500 | [diff] [blame] | 39 | Verify Immediate Shutdown |
| 40 | [Documentation] Verify shutdown after clicking immediate shutdown button. |
| 41 | [Tags] Verify_Immediate_Shutdown |
| 42 | |
| 43 | Redfish Power On stack_mode=skip |
| 44 | Click Element At Coordinates ${xpath_shutdown_immediate_radio} 0 0 |
| 45 | Click Element ${xpath_shutdown_button} |
| 46 | Wait Until Page Contains Element ${xpath_confirm_button} timeout=10 |
| 47 | Click Element ${xpath_confirm_button} |
| 48 | Wait Until Keyword Succeeds 3 min 0 sec Element Should Contain ${xpath_current_power_state} Off |
| 49 | |
| 50 | |
| 51 | Verify Orderly Shutdown |
| 52 | [Documentation] Verify shutdown after clicking orderly shutdown button. |
| 53 | [Tags] Verify_Orderly_Shutdown |
| 54 | |
| 55 | Redfish Power On stack_mode=skip |
| 56 | Click Element At Coordinates ${xpath_shutdown_orderly_radio} 0 0 |
| 57 | Click Element ${xpath_shutdown_button} |
| 58 | Wait Until Page Contains Element ${xpath_confirm_button} timeout=10 |
| 59 | Click Element ${xpath_confirm_button} |
| 60 | Wait Until Keyword Succeeds 10 min 0 sec Element Should Contain ${xpath_current_power_state} Off |
| 61 | |
| 62 | |
manashsarma | 66f9a62 | 2020-08-23 06:39:53 -0500 | [diff] [blame] | 63 | Verify Existence Of All Sections In Server Power Operations Page |
| 64 | [Documentation] Verify existence of all sections in Server Power Operations page. |
| 65 | [Tags] Verify_Existence_Of_All_Sections_In_Server_Power_Operations_Page |
| 66 | |
| 67 | Page Should Contain Current status |
| 68 | Page Should Contain Host OS boot settings |
| 69 | Page Should Contain Operations |
| 70 | |
| 71 | |
manashsarma | 6164975 | 2020-08-19 07:01:19 -0500 | [diff] [blame] | 72 | Verify Existence Of All Input Boxes In Host Os Boot Settings |
| 73 | [Documentation] Verify existence of all input boxes in host os boot settings. |
| 74 | [Tags] Verify_Existence_Of_Input_Boxes_In_Host_Os_Boot_Settings |
| 75 | |
| 76 | Page Should Contain Element ${xpath_enable_onetime_boot_checkbox} |
| 77 | Page Should Contain Element ${xpath_boot_option_select} |
| 78 | |
| 79 | |
| 80 | Verify Existence Of All Sections In Host Os Boot Settings |
| 81 | [Documentation] Verify existence of all sections in host os boot settings. |
| 82 | [Tags] Verify_Existence_Of_All_Sections_In_Host_Os_Boot_Settings |
| 83 | |
| 84 | Page Should Contain Boot settings override |
| 85 | Page Should Contain TPM required policy |
| 86 | |
| 87 | |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 88 | Verify System State At Power Off |
| 89 | [Documentation] Verify state of the system in power off state. |
| 90 | [Tags] Verify_System_State_At_Power_Off |
| 91 | |
| 92 | Redfish Power Off stack_mode=skip |
manashsarma | 73d24f1 | 2020-08-25 07:42:53 -0500 | [diff] [blame] | 93 | Page Should Contain Element ${xpath_current_power_state} |
| 94 | Element Should Contain ${xpath_current_power_state} Off |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 95 | |
| 96 | |
| 97 | Verify System State At Power On |
| 98 | [Documentation] Verify state of the system in power on state. |
| 99 | [Tags] Verify_System_State_At_Power_On |
| 100 | |
| 101 | Redfish Power On stack_mode=skip |
manashsarma | 73d24f1 | 2020-08-25 07:42:53 -0500 | [diff] [blame] | 102 | Page Should Contain Element ${xpath_current_power_state} |
| 103 | Element Should Contain ${xpath_current_power_state} On |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 104 | |
| 105 | |
manashsarma | 7cbe1c0 | 2020-08-20 05:36:30 -0500 | [diff] [blame] | 106 | Verify PowerOn Button Should Present At Power Off |
| 107 | [Documentation] Verify existence of poweron button at power off. |
| 108 | [Tags] Verify_PowerOn_Button_Should_Present_At_Power_Off |
| 109 | |
| 110 | Redfish Power Off stack_mode=skip |
| 111 | # TODO: Implement power off using GUI later. |
| 112 | Page Should Contain Element ${xpath_poweron_button} |
| 113 | |
| 114 | |
| 115 | Verify Shutdown And Reboot Buttons Presence At Power On |
| 116 | [Documentation] Verify existence of shutdown and reboot buttons at power on. |
| 117 | [Tags] Verify_Shutdown_And_Reboot_Buttons_Presence_At_Power_On |
| 118 | |
| 119 | Redfish Power On stack_mode=skip |
| 120 | # TODO: Implement power on using GUI later. |
| 121 | Page Should Contain Element ${xpath_shutdown_button} |
| 122 | Page Should Contain Element ${xpath_reboot_button} |
| 123 | |
| 124 | |
manashsarma | 66f9a62 | 2020-08-23 06:39:53 -0500 | [diff] [blame] | 125 | Verify Existence Of Buttons In Host Os Boot Settings |
| 126 | [Documentation] Verify existence of buttons in Host OS boot settings. |
| 127 | [Tags] Verify_Existence_Of_Buttons_In_Host_Os_Boot_Settings |
| 128 | |
| 129 | Page Should Contain Element ${xpath_tpm_policy_button} |
| 130 | Page Should Contain Element ${xpath_save_button} |
| 131 | |
| 132 | |
manashsarma | 348585c | 2020-08-27 06:52:39 -0500 | [diff] [blame] | 133 | Verify Host Immediate Reboot |
| 134 | [Documentation] Verify host reboot after triggering immediate reboot. |
| 135 | [Tags] Verify_Host_Immediate_Reboot |
| 136 | |
| 137 | Redfish Power On stack_mode=skip |
| 138 | Click Element At Coordinates ${xpath_reboot_immediate_radio} 0 0 |
| 139 | Click Element ${xpath_reboot_button} |
| 140 | Wait Until Page Contains Element ${xpath_confirm_button} timeout=10 |
| 141 | Click Element ${xpath_confirm_button} |
| 142 | Wait Until Keyword Succeeds 3 min 0 sec Element Should Contain ${xpath_current_power_state} Off |
| 143 | Click Element ${xpath_refresh_button} |
| 144 | Wait Until Keyword Succeeds 3 min 0 sec Element Should Contain ${xpath_current_power_state} On |
| 145 | |
| 146 | |
| 147 | Verify Host Orderly Reboot |
| 148 | [Documentation] Verify host reboot after triggering orderly reboot. |
| 149 | [Tags] Verify_Host_Orderly_Reboot |
| 150 | |
| 151 | Redfish Power On stack_mode=skip |
| 152 | Click Element At Coordinates ${xpath_reboot_orderly_radio} 0 0 |
| 153 | Click Element ${xpath_reboot_button} |
| 154 | Wait Until Page Contains Element ${xpath_confirm_button} timeout=10 |
| 155 | Click Element ${xpath_confirm_button} |
| 156 | Wait Until Keyword Succeeds 10 min 0 sec Element Should Contain ${xpath_current_power_state} Off |
| 157 | Click Element ${xpath_refresh_button} |
| 158 | Wait Until Keyword Succeeds 10 min 0 sec Element Should Contain ${xpath_current_power_state} On |
| 159 | |
| 160 | |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 161 | *** Keywords *** |
| 162 | |
| 163 | Test Setup Execution |
| 164 | [Documentation] Do test case setup tasks. |
| 165 | |
| 166 | Click Element ${xpath_control_menu} |
| 167 | Click Element ${xpath_server_power_operations_sub_menu} |
| 168 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-power-operations |