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