blob: 03866d094035c890e16c808c1b3ab6be66ef5794 [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']
manashsarma66f9a622020-08-23 06:39:53 -050020${xpath_save_button} //button[contains(text(),'Save')]
manashsarma73d24f12020-08-25 07:42:53 -050021${xpath_shutdown_orderly_radio} //*[@data-test-id='serverPowerOperations-radio-shutdownOrderly']
22${xpath_shutdown_immediate_radio} //*[@data-test-id='serverPowerOperations-radio-shutdownImmediate']
23${xpath_confirm_button} //button[contains(text(),'Confirm')]
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060024${xpath_current_power_state} //*[@data-test-id='powerServerOps-text-hostStatus']
manashsarma348585c2020-08-27 06:52:39 -050025${xpath_reboot_orderly_radio} //*[@data-test-id='serverPowerOperations-radio-rebootOrderly']
26${xpath_reboot_immediate_radio} //*[@data-test-id='serverPowerOperations-radio-rebootImmediate']
Rahul Maheshwari317c7102020-08-30 21:10:22 -050027
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060028
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050029*** Test Cases ***
30
Rahul Maheshwari317c7102020-08-30 21:10:22 -050031Verify Navigation To Server Power Operations Page
32 [Documentation] Verify navigation to server power operations page.
33 [Tags] Verify_Navigation_To_Server_Power_Operations_Page
manashsarma484fefc2020-08-23 12:38:49 -050034
Rahul Maheshwari317c7102020-08-30 21:10:22 -050035 Page Should Contain Element ${xpath_server_power_heading}
manashsarma484fefc2020-08-23 12:38:49 -050036
37
manashsarma73d24f12020-08-25 07:42:53 -050038Verify Immediate Shutdown
39 [Documentation] Verify shutdown after clicking immediate shutdown button.
40 [Tags] Verify_Immediate_Shutdown
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060041 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
42 ... AND Navigate to Server Power Operation Page
manashsarma73d24f12020-08-25 07:42:53 -050043
manashsarma73d24f12020-08-25 07:42:53 -050044 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}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060048 Wait Until Keyword Succeeds 3 min 15 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma73d24f12020-08-25 07:42:53 -050049
50
51Verify Orderly Shutdown
52 [Documentation] Verify shutdown after clicking orderly shutdown button.
53 [Tags] Verify_Orderly_Shutdown
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060054 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
55 ... AND Navigate to Server Power Operation Page
manashsarma73d24f12020-08-25 07:42:53 -050056
manashsarma73d24f12020-08-25 07:42:53 -050057 Click Element At Coordinates ${xpath_shutdown_orderly_radio} 0 0
58 Click Element ${xpath_shutdown_button}
59 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
60 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060061 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma73d24f12020-08-25 07:42:53 -050062
63
manashsarma66f9a622020-08-23 06:39:53 -050064Verify Existence Of All Sections In Server Power Operations Page
65 [Documentation] Verify existence of all sections in Server Power Operations page.
66 [Tags] Verify_Existence_Of_All_Sections_In_Server_Power_Operations_Page
67
Ashwini Chandrappaad2443d2021-07-07 08:20:54 -050068 # Added a delay for the page to load boot settings section.
rramyasr-in84c1ad72022-06-29 09:55:34 -050069 Wait Until Page Contains Server power operations timeout=5
manashsarma66f9a622020-08-23 06:39:53 -050070 Page Should Contain Current status
manashsarma66f9a622020-08-23 06:39:53 -050071 Page Should Contain Operations
rramyasr-in84c1ad72022-06-29 09:55:34 -050072 Page Should Contain Settings
manashsarma66f9a622020-08-23 06:39:53 -050073
74
manashsarma61649752020-08-19 07:01:19 -050075Verify Existence Of All Input Boxes In Host Os Boot Settings
76 [Documentation] Verify existence of all input boxes in host os boot settings.
George Keishingd6a77972022-01-31 12:50:29 -060077 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Host_Os_Boot_Settings
manashsarma61649752020-08-19 07:01:19 -050078
Ashwini Chandrappaad2443d2021-07-07 08:20:54 -050079 # Added a delay for the page to load boot settings section.
80 Wait Until Page Contains Boot settings timeout=5
manashsarma61649752020-08-19 07:01:19 -050081 Page Should Contain Element ${xpath_enable_onetime_boot_checkbox}
82 Page Should Contain Element ${xpath_boot_option_select}
83
84
Rahul Maheshwari317c7102020-08-30 21:10:22 -050085Verify System State At Power Off
86 [Documentation] Verify state of the system in power off state.
87 [Tags] Verify_System_State_At_Power_Off
88
89 Redfish Power Off stack_mode=skip
manashsarma73d24f12020-08-25 07:42:53 -050090 Page Should Contain Element ${xpath_current_power_state}
91 Element Should Contain ${xpath_current_power_state} Off
Rahul Maheshwari317c7102020-08-30 21:10:22 -050092
93
94Verify System State At Power On
95 [Documentation] Verify state of the system in power on state.
96 [Tags] Verify_System_State_At_Power_On
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060097 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
98 ... AND Navigate to Server Power Operation Page
Rahul Maheshwari317c7102020-08-30 21:10:22 -050099
rramyasr-in96ba2202022-01-13 06:29:40 -0600100 Wait Until Keyword Succeeds 15 sec 5 sec Element Should Contain ${xpath_current_power_state} On
George Keishingd6a77972022-01-31 12:50:29 -0600101
rramyasr-in1ae2a892023-01-06 03:59:47 -0600102
manashsarma7cbe1c02020-08-20 05:36:30 -0500103Verify PowerOn Button Should Present At Power Off
104 [Documentation] Verify existence of poweron button at power off.
105 [Tags] Verify_PowerOn_Button_Should_Present_At_Power_Off
106
107 Redfish Power Off stack_mode=skip
108 # TODO: Implement power off using GUI later.
109 Page Should Contain Element ${xpath_poweron_button}
110
111
112Verify Shutdown And Reboot Buttons Presence At Power On
113 [Documentation] Verify existence of shutdown and reboot buttons at power on.
114 [Tags] Verify_Shutdown_And_Reboot_Buttons_Presence_At_Power_On
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600115 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
116 ... AND Navigate to Server Power Operation Page
manashsarma7cbe1c02020-08-20 05:36:30 -0500117
manashsarma7cbe1c02020-08-20 05:36:30 -0500118 # TODO: Implement power on using GUI later.
119 Page Should Contain Element ${xpath_shutdown_button}
120 Page Should Contain Element ${xpath_reboot_button}
121
122
manashsarma348585c2020-08-27 06:52:39 -0500123Verify Host Immediate Reboot
124 [Documentation] Verify host reboot after triggering immediate reboot.
125 [Tags] Verify_Host_Immediate_Reboot
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600126 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
127 ... AND Navigate to Server Power Operation Page
manashsarma348585c2020-08-27 06:52:39 -0500128
manashsarma348585c2020-08-27 06:52:39 -0500129 Click Element At Coordinates ${xpath_reboot_immediate_radio} 0 0
130 Click Element ${xpath_reboot_button}
131 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
132 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600133 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500134 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600135 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500136
137
138Verify Host Orderly Reboot
139 [Documentation] Verify host reboot after triggering orderly reboot.
140 [Tags] Verify_Host_Orderly_Reboot
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600141 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
142 ... AND Navigate to Server Power Operation Page
manashsarma348585c2020-08-27 06:52:39 -0500143
manashsarma348585c2020-08-27 06:52:39 -0500144 Click Element At Coordinates ${xpath_reboot_orderly_radio} 0 0
145 Click Element ${xpath_reboot_button}
146 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
147 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600148 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500149 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600150 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500151
152
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500153*** Keywords ***
154
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600155Navigate to Server Power Operation Page
156 [Documentation] Go to server power operation page.
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500157
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500158 Click Element ${xpath_operations_menu}
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500159 Click Element ${xpath_server_power_operations_sub_menu}
160 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-power-operations