blob: fb0db34885456df8135046f21cd6fe73b946112b [file] [log] [blame]
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "Server power operations" sub-menu of "Server control".
4
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
manashsarma73d24f12020-08-25 07:42:53 -05006Resource ../../../lib/state_manager.robot
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -05007
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -06008Test Setup Run Keywords Launch Browser And Login GUI AND Navigate to Server Power Operation Page
9Test Teardown Close Browser
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050010
11
12*** Variables ***
13
Rahul Maheshwari317c7102020-08-30 21:10:22 -050014${xpath_server_power_heading} //h1[text()="Server power operations"]
manashsarma61649752020-08-19 07:01:19 -050015${xpath_enable_onetime_boot_checkbox} //*[contains(@class,'custom-checkbox')]
16${xpath_boot_option_select} //*[@id='boot-option']
manashsarma66f9a622020-08-23 06:39:53 -050017${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')]
manashsarma73d24f12020-08-25 07:42:53 -050022${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')]
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060025${xpath_current_power_state} //*[@data-test-id='powerServerOps-text-hostStatus']
manashsarma348585c2020-08-27 06:52:39 -050026${xpath_reboot_orderly_radio} //*[@data-test-id='serverPowerOperations-radio-rebootOrderly']
27${xpath_reboot_immediate_radio} //*[@data-test-id='serverPowerOperations-radio-rebootImmediate']
Rahul Maheshwari317c7102020-08-30 21:10:22 -050028
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060029
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050030*** Test Cases ***
31
Rahul Maheshwari317c7102020-08-30 21:10:22 -050032Verify Navigation To Server Power Operations Page
33 [Documentation] Verify navigation to server power operations page.
34 [Tags] Verify_Navigation_To_Server_Power_Operations_Page
manashsarma484fefc2020-08-23 12:38:49 -050035
Rahul Maheshwari317c7102020-08-30 21:10:22 -050036 Page Should Contain Element ${xpath_server_power_heading}
manashsarma484fefc2020-08-23 12:38:49 -050037
38
manashsarma73d24f12020-08-25 07:42:53 -050039Verify Immediate Shutdown
40 [Documentation] Verify shutdown after clicking immediate shutdown button.
41 [Tags] Verify_Immediate_Shutdown
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060042 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
43 ... AND Navigate to Server Power Operation Page
manashsarma73d24f12020-08-25 07:42:53 -050044
manashsarma73d24f12020-08-25 07:42:53 -050045 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}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060049 Wait Until Keyword Succeeds 3 min 15 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma73d24f12020-08-25 07:42:53 -050050
51
52Verify Orderly Shutdown
53 [Documentation] Verify shutdown after clicking orderly shutdown button.
54 [Tags] Verify_Orderly_Shutdown
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060055 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
56 ... AND Navigate to Server Power Operation Page
manashsarma73d24f12020-08-25 07:42:53 -050057
manashsarma73d24f12020-08-25 07:42:53 -050058 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}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060062 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma73d24f12020-08-25 07:42:53 -050063
64
manashsarma66f9a622020-08-23 06:39:53 -050065Verify 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
Ashwini Chandrappaad2443d2021-07-07 08:20:54 -050069 # Added a delay for the page to load boot settings section.
70 Wait Until Page Contains Boot settings timeout=5
manashsarma66f9a622020-08-23 06:39:53 -050071 Page Should Contain Current status
Rahul Maheshwarie1222fb2021-06-23 04:26:25 -050072 Page Should Contain Boot settings
manashsarma66f9a622020-08-23 06:39:53 -050073 Page Should Contain Operations
74
75
manashsarma61649752020-08-19 07:01:19 -050076Verify 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
Ashwini Chandrappaad2443d2021-07-07 08:20:54 -050080 # Added a delay for the page to load boot settings section.
81 Wait Until Page Contains Boot settings timeout=5
manashsarma61649752020-08-19 07:01:19 -050082 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 Page Should Contain Boot settings override
91 Page Should Contain TPM required policy
92
93
Rahul Maheshwari317c7102020-08-30 21:10:22 -050094Verify 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
manashsarma73d24f12020-08-25 07:42:53 -050099 Page Should Contain Element ${xpath_current_power_state}
100 Element Should Contain ${xpath_current_power_state} Off
Rahul Maheshwari317c7102020-08-30 21:10:22 -0500101
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
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600106 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
107 ... AND Navigate to Server Power Operation Page
Rahul Maheshwari317c7102020-08-30 21:10:22 -0500108
manashsarma73d24f12020-08-25 07:42:53 -0500109 Page Should Contain Element ${xpath_current_power_state}
110 Element Should Contain ${xpath_current_power_state} On
Rahul Maheshwari317c7102020-08-30 21:10:22 -0500111
112
manashsarma7cbe1c02020-08-20 05:36:30 -0500113Verify 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
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600125 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
126 ... AND Navigate to Server Power Operation Page
manashsarma7cbe1c02020-08-20 05:36:30 -0500127
manashsarma7cbe1c02020-08-20 05:36:30 -0500128 # 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
manashsarma66f9a622020-08-23 06:39:53 -0500133Verify 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
Ashwini Chandrappaad2443d2021-07-07 08:20:54 -0500137 # Added a delay for the page to load boot settings section.
138 Wait Until Page Contains Boot settings timeout=5
manashsarma66f9a622020-08-23 06:39:53 -0500139 Page Should Contain Element ${xpath_tpm_policy_button}
140 Page Should Contain Element ${xpath_save_button}
141
142
manashsarma348585c2020-08-27 06:52:39 -0500143Verify Host Immediate Reboot
144 [Documentation] Verify host reboot after triggering immediate reboot.
145 [Tags] Verify_Host_Immediate_Reboot
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600146 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
147 ... AND Navigate to Server Power Operation Page
manashsarma348585c2020-08-27 06:52:39 -0500148
manashsarma348585c2020-08-27 06:52:39 -0500149 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}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600153 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500154 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600155 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500156
157
158Verify Host Orderly Reboot
159 [Documentation] Verify host reboot after triggering orderly reboot.
160 [Tags] Verify_Host_Orderly_Reboot
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600161 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
162 ... AND Navigate to Server Power Operation Page
manashsarma348585c2020-08-27 06:52:39 -0500163
manashsarma348585c2020-08-27 06:52:39 -0500164 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}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600168 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500169 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600170 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500171
172
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500173*** Keywords ***
174
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600175Navigate to Server Power Operation Page
176 [Documentation] Go to server power operation page.
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500177
178 Click Element ${xpath_control_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