blob: 6ba8458286121c4c9afa7b166aadcbb87299fcfb [file] [log] [blame]
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -05001*** Settings ***
2
Rahul Maheshwari142642d2021-08-24 00:00:15 -05003Documentation Test OpenBMC GUI "Server power operations" sub-menu of "Operations".
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -05004
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
manashsarma77560152021-07-20 03:46:28 -050090 Wait Until Page Contains Boot settings override timeout=5
manashsarma61649752020-08-19 07:01:19 -050091 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
rramyasr-in96ba2202022-01-13 06:29:40 -0600109 Wait Until Keyword Succeeds 15 sec 5 sec Element Should Contain ${xpath_current_power_state} On
110
manashsarma7cbe1c02020-08-20 05:36:30 -0500111Verify PowerOn Button Should Present At Power Off
112 [Documentation] Verify existence of poweron button at power off.
113 [Tags] Verify_PowerOn_Button_Should_Present_At_Power_Off
114
115 Redfish Power Off stack_mode=skip
116 # TODO: Implement power off using GUI later.
117 Page Should Contain Element ${xpath_poweron_button}
118
119
120Verify Shutdown And Reboot Buttons Presence At Power On
121 [Documentation] Verify existence of shutdown and reboot buttons at power on.
122 [Tags] Verify_Shutdown_And_Reboot_Buttons_Presence_At_Power_On
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600123 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
124 ... AND Navigate to Server Power Operation Page
manashsarma7cbe1c02020-08-20 05:36:30 -0500125
manashsarma7cbe1c02020-08-20 05:36:30 -0500126 # TODO: Implement power on using GUI later.
127 Page Should Contain Element ${xpath_shutdown_button}
128 Page Should Contain Element ${xpath_reboot_button}
129
130
manashsarma66f9a622020-08-23 06:39:53 -0500131Verify Existence Of Buttons In Host Os Boot Settings
132 [Documentation] Verify existence of buttons in Host OS boot settings.
133 [Tags] Verify_Existence_Of_Buttons_In_Host_Os_Boot_Settings
134
Ashwini Chandrappaad2443d2021-07-07 08:20:54 -0500135 # Added a delay for the page to load boot settings section.
136 Wait Until Page Contains Boot settings timeout=5
manashsarma66f9a622020-08-23 06:39:53 -0500137 Page Should Contain Element ${xpath_tpm_policy_button}
138 Page Should Contain Element ${xpath_save_button}
139
140
manashsarma348585c2020-08-27 06:52:39 -0500141Verify Host Immediate Reboot
142 [Documentation] Verify host reboot after triggering immediate reboot.
143 [Tags] Verify_Host_Immediate_Reboot
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600144 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
145 ... AND Navigate to Server Power Operation Page
manashsarma348585c2020-08-27 06:52:39 -0500146
manashsarma348585c2020-08-27 06:52:39 -0500147 Click Element At Coordinates ${xpath_reboot_immediate_radio} 0 0
148 Click Element ${xpath_reboot_button}
149 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
150 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600151 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500152 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600153 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500154
155
156Verify Host Orderly Reboot
157 [Documentation] Verify host reboot after triggering orderly reboot.
158 [Tags] Verify_Host_Orderly_Reboot
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600159 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
160 ... AND Navigate to Server Power Operation Page
manashsarma348585c2020-08-27 06:52:39 -0500161
manashsarma348585c2020-08-27 06:52:39 -0500162 Click Element At Coordinates ${xpath_reboot_orderly_radio} 0 0
163 Click Element ${xpath_reboot_button}
164 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
165 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600166 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500167 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600168 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500169
170
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500171*** Keywords ***
172
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600173Navigate to Server Power Operation Page
174 [Documentation] Go to server power operation page.
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500175
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500176 Click Element ${xpath_operations_menu}
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500177 Click Element ${xpath_server_power_operations_sub_menu}
178 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-power-operations