blob: c89f6531f781ae33fd2f17c32bba83543a43d649 [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
69 Page Should Contain Current status
Rahul Maheshwarie1222fb2021-06-23 04:26:25 -050070 Page Should Contain Boot settings
manashsarma66f9a622020-08-23 06:39:53 -050071 Page Should Contain Operations
72
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.
76 [Tags] Verify_Existence_Of_Input_Boxes_In_Host_Os_Boot_Settings
77
78 Page Should Contain Element ${xpath_enable_onetime_boot_checkbox}
79 Page Should Contain Element ${xpath_boot_option_select}
80
81
82Verify Existence Of All Sections In Host Os Boot Settings
83 [Documentation] Verify existence of all sections in host os boot settings.
84 [Tags] Verify_Existence_Of_All_Sections_In_Host_Os_Boot_Settings
85
86 Page Should Contain Boot settings override
87 Page Should Contain TPM required policy
88
89
Rahul Maheshwari317c7102020-08-30 21:10:22 -050090Verify System State At Power Off
91 [Documentation] Verify state of the system in power off state.
92 [Tags] Verify_System_State_At_Power_Off
93
94 Redfish Power Off stack_mode=skip
manashsarma73d24f12020-08-25 07:42:53 -050095 Page Should Contain Element ${xpath_current_power_state}
96 Element Should Contain ${xpath_current_power_state} Off
Rahul Maheshwari317c7102020-08-30 21:10:22 -050097
98
99Verify System State At Power On
100 [Documentation] Verify state of the system in power on state.
101 [Tags] Verify_System_State_At_Power_On
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600102 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
103 ... AND Navigate to Server Power Operation Page
Rahul Maheshwari317c7102020-08-30 21:10:22 -0500104
manashsarma73d24f12020-08-25 07:42:53 -0500105 Page Should Contain Element ${xpath_current_power_state}
106 Element Should Contain ${xpath_current_power_state} On
Rahul Maheshwari317c7102020-08-30 21:10:22 -0500107
108
manashsarma7cbe1c02020-08-20 05:36:30 -0500109Verify PowerOn Button Should Present At Power Off
110 [Documentation] Verify existence of poweron button at power off.
111 [Tags] Verify_PowerOn_Button_Should_Present_At_Power_Off
112
113 Redfish Power Off stack_mode=skip
114 # TODO: Implement power off using GUI later.
115 Page Should Contain Element ${xpath_poweron_button}
116
117
118Verify Shutdown And Reboot Buttons Presence At Power On
119 [Documentation] Verify existence of shutdown and reboot buttons at power on.
120 [Tags] Verify_Shutdown_And_Reboot_Buttons_Presence_At_Power_On
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600121 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
122 ... AND Navigate to Server Power Operation Page
manashsarma7cbe1c02020-08-20 05:36:30 -0500123
manashsarma7cbe1c02020-08-20 05:36:30 -0500124 # TODO: Implement power on using GUI later.
125 Page Should Contain Element ${xpath_shutdown_button}
126 Page Should Contain Element ${xpath_reboot_button}
127
128
manashsarma66f9a622020-08-23 06:39:53 -0500129Verify Existence Of Buttons In Host Os Boot Settings
130 [Documentation] Verify existence of buttons in Host OS boot settings.
131 [Tags] Verify_Existence_Of_Buttons_In_Host_Os_Boot_Settings
132
133 Page Should Contain Element ${xpath_tpm_policy_button}
134 Page Should Contain Element ${xpath_save_button}
135
136
manashsarma348585c2020-08-27 06:52:39 -0500137Verify Host Immediate Reboot
138 [Documentation] Verify host reboot after triggering immediate reboot.
139 [Tags] Verify_Host_Immediate_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 At Coordinates ${xpath_reboot_immediate_radio} 0 0
144 Click Element ${xpath_reboot_button}
145 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
146 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600147 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500148 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600149 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500150
151
152Verify Host Orderly Reboot
153 [Documentation] Verify host reboot after triggering orderly reboot.
154 [Tags] Verify_Host_Orderly_Reboot
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600155 [Setup] Run Keywords Redfish Power On stack_mode=skip AND Launch Browser And Login GUI
156 ... AND Navigate to Server Power Operation Page
manashsarma348585c2020-08-27 06:52:39 -0500157
manashsarma348585c2020-08-27 06:52:39 -0500158 Click Element At Coordinates ${xpath_reboot_orderly_radio} 0 0
159 Click Element ${xpath_reboot_button}
160 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
161 Click Element ${xpath_confirm_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600162 Wait Until Keyword Succeeds 3 min 2 sec Element Should Contain ${xpath_current_power_state} Off
manashsarma348585c2020-08-27 06:52:39 -0500163 Click Element ${xpath_refresh_button}
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600164 Wait Until Keyword Succeeds 10 min 15 sec Element Should Contain ${xpath_current_power_state} On
manashsarma348585c2020-08-27 06:52:39 -0500165
166
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500167*** Keywords ***
168
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600169Navigate to Server Power Operation Page
170 [Documentation] Go to server power operation page.
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500171
172 Click Element ${xpath_control_menu}
173 Click Element ${xpath_server_power_operations_sub_menu}
174 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-power-operations
Rahul Maheshwari0f75f1f2021-02-04 02:21:39 -0600175