blob: 83fce6bf81735ebb9d16fe248e866f4ac8d85bd9 [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_immediate_radio} //*[@data-test-id='serverPowerOperations-radio-rebootImmediate']
Rahul Maheshwari317c7102020-08-30 21:10:22 -050026
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060027
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050028*** Test Cases ***
29
Rahul Maheshwari317c7102020-08-30 21:10:22 -050030Verify Navigation To Server Power Operations Page
31 [Documentation] Verify navigation to server power operations page.
32 [Tags] Verify_Navigation_To_Server_Power_Operations_Page
manashsarma484fefc2020-08-23 12:38:49 -050033
Rahul Maheshwari317c7102020-08-30 21:10:22 -050034 Page Should Contain Element ${xpath_server_power_heading}
manashsarma484fefc2020-08-23 12:38:49 -050035
36
manashsarma73d24f12020-08-25 07:42:53 -050037Verify Immediate Shutdown
38 [Documentation] Verify shutdown after clicking immediate shutdown button.
39 [Tags] Verify_Immediate_Shutdown
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060040 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
41 ... AND Navigate to Server Power Operation Page
manashsarma73d24f12020-08-25 07:42:53 -050042
manashsarma73d24f12020-08-25 07:42:53 -050043 Click Element At Coordinates ${xpath_shutdown_immediate_radio} 0 0
44 Click Element ${xpath_shutdown_button}
45 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
46 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060047 Wait Until Keyword Succeeds 3 min 15 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma73d24f12020-08-25 07:42:53 -050048
49
50Verify Orderly Shutdown
51 [Documentation] Verify shutdown after clicking orderly shutdown button.
52 [Tags] Verify_Orderly_Shutdown
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060053 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
54 ... AND Navigate to Server Power Operation Page
manashsarma73d24f12020-08-25 07:42:53 -050055
manashsarma73d24f12020-08-25 07:42:53 -050056 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}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060060 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma73d24f12020-08-25 07:42:53 -050061
62
manashsarma66f9a622020-08-23 06:39:53 -050063Verify 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
Ashwini Chandrappaad2443d2021-07-07 08:20:54 -050067 # Added a delay for the page to load boot settings section.
rramyasr-in84c1ad72022-06-29 09:55:34 -050068 Wait Until Page Contains Server power operations timeout=5
manashsarma66f9a622020-08-23 06:39:53 -050069 Page Should Contain Current status
manashsarma66f9a622020-08-23 06:39:53 -050070 Page Should Contain Operations
rramyasr-in84c1ad72022-06-29 09:55:34 -050071 Page Should Contain Settings
manashsarma66f9a622020-08-23 06:39:53 -050072
73
manashsarma61649752020-08-19 07:01:19 -050074Verify Existence Of All Input Boxes In Host Os Boot Settings
75 [Documentation] Verify existence of all input boxes in host os boot settings.
George Keishingd6a77972022-01-31 12:50:29 -060076 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Host_Os_Boot_Settings
manashsarma61649752020-08-19 07:01:19 -050077
Ashwini Chandrappaad2443d2021-07-07 08:20:54 -050078 # Added a delay for the page to load boot settings section.
79 Wait Until Page Contains Boot settings timeout=5
manashsarma61649752020-08-19 07:01:19 -050080 Page Should Contain Element ${xpath_enable_onetime_boot_checkbox}
81 Page Should Contain Element ${xpath_boot_option_select}
82
83
Rahul Maheshwari317c7102020-08-30 21:10:22 -050084Verify System State At Power Off
85 [Documentation] Verify state of the system in power off state.
86 [Tags] Verify_System_State_At_Power_Off
87
88 Redfish Power Off stack_mode=skip
manashsarma73d24f12020-08-25 07:42:53 -050089 Page Should Contain Element ${xpath_current_power_state}
90 Element Should Contain ${xpath_current_power_state} Off
Rahul Maheshwari317c7102020-08-30 21:10:22 -050091
92
93Verify System State At Power On
94 [Documentation] Verify state of the system in power on state.
95 [Tags] Verify_System_State_At_Power_On
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -060096 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
97 ... AND Navigate to Server Power Operation Page
Rahul Maheshwari317c7102020-08-30 21:10:22 -050098
rramyasr-in96ba2202022-01-13 06:29:40 -060099 Wait Until Keyword Succeeds 15 sec 5 sec Element Should Contain ${xpath_current_power_state} On
George Keishingd6a77972022-01-31 12:50:29 -0600100
rramyasr-in1ae2a892023-01-06 03:59:47 -0600101
manashsarma7cbe1c02020-08-20 05:36:30 -0500102Verify PowerOn Button Should Present At Power Off
103 [Documentation] Verify existence of poweron button at power off.
104 [Tags] Verify_PowerOn_Button_Should_Present_At_Power_Off
105
106 Redfish Power Off stack_mode=skip
107 # TODO: Implement power off using GUI later.
108 Page Should Contain Element ${xpath_poweron_button}
109
110
111Verify Shutdown And Reboot Buttons Presence At Power On
112 [Documentation] Verify existence of shutdown and reboot buttons at power on.
113 [Tags] Verify_Shutdown_And_Reboot_Buttons_Presence_At_Power_On
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600114 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
115 ... AND Navigate to Server Power Operation Page
manashsarma7cbe1c02020-08-20 05:36:30 -0500116
manashsarma7cbe1c02020-08-20 05:36:30 -0500117 # TODO: Implement power on using GUI later.
118 Page Should Contain Element ${xpath_shutdown_button}
119 Page Should Contain Element ${xpath_reboot_button}
120
121
manashsarma348585c2020-08-27 06:52:39 -0500122Verify Host Immediate Reboot
123 [Documentation] Verify host reboot after triggering immediate reboot.
124 [Tags] Verify_Host_Immediate_Reboot
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
manashsarma348585c2020-08-27 06:52:39 -0500127
manashsarma348585c2020-08-27 06:52:39 -0500128 Click Element At Coordinates ${xpath_reboot_immediate_radio} 0 0
129 Click Element ${xpath_reboot_button}
130 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
131 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600132 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500133 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600134 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500135
136
137Verify Host Orderly Reboot
138 [Documentation] Verify host reboot after triggering orderly reboot.
139 [Tags] Verify_Host_Orderly_Reboot
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600140 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
141 ... AND Navigate to Server Power Operation Page
manashsarma348585c2020-08-27 06:52:39 -0500142
manashsarma348585c2020-08-27 06:52:39 -0500143 Click Element ${xpath_reboot_button}
Nandish-Matti759ea672023-04-13 07:33:01 -0500144 # Delay for confirm button to appear.
145 Sleep 5s
Nandish-Matti8565cff2023-03-16 00:51:28 -0500146 Wait Until Element Is Visible ${xpath_confirm_button} timeout=10
manashsarma348585c2020-08-27 06:52:39 -0500147 Click Element ${xpath_confirm_button}
Nandish-Matti4e21f372023-03-08 07:02:22 -0600148 Wait Until Keyword Succeeds 2 min 1 sec Is Server Status 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
rramyasr-in9e2c96f2023-01-24 07:59:34 -0600161 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
Nandish-Matti4e21f372023-03-08 07:02:22 -0600162
163Is Server Status Off
164 [Documentation] Perform GUI refresh and verify server status to Off.
165
166 Refresh GUI
167 Element Should Contain ${xpath_current_power_state} Off