blob: 272678bade62178b4f6cc800814d992973106b3d [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
5Resource ../../lib/resource.robot
manashsarma73d24f12020-08-25 07:42:53 -05006Resource ../../../lib/state_manager.robot
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -05007
8Suite Setup Launch Browser And Login GUI
9Suite Teardown Close Browser
10Test Setup Test Setup Execution
11
12
13*** Variables ***
14
Rahul Maheshwari317c7102020-08-30 21:10:22 -050015${xpath_server_power_heading} //h1[text()="Server power operations"]
manashsarma61649752020-08-19 07:01:19 -050016${xpath_enable_onetime_boot_checkbox} //*[contains(@class,'custom-checkbox')]
17${xpath_boot_option_select} //*[@id='boot-option']
manashsarma66f9a622020-08-23 06:39:53 -050018${xpath_shutdown_button} //*[@data-test-id='serverPowerOperations-button-shutDown']
19${xpath_reboot_button} //*[@data-test-id='serverPowerOperations-button-reboot']
20${xpath_poweron_button} //*[@data-test-id='serverPowerOperations-button-powerOn']
21${xpath_tpm_policy_button} //input[@id='tpm-required-policy']
22${xpath_save_button} //button[contains(text(),'Save')]
manashsarma73d24f12020-08-25 07:42:53 -050023${xpath_shutdown_orderly_radio} //*[@data-test-id='serverPowerOperations-radio-shutdownOrderly']
24${xpath_shutdown_immediate_radio} //*[@data-test-id='serverPowerOperations-radio-shutdownImmediate']
25${xpath_confirm_button} //button[contains(text(),'Confirm')]
26${xpath_current_power_state} //*[contains(@class,'row mb-4')]
manashsarma348585c2020-08-27 06:52:39 -050027${xpath_reboot_orderly_radio} //*[@data-test-id='serverPowerOperations-radio-rebootOrderly']
28${xpath_reboot_immediate_radio} //*[@data-test-id='serverPowerOperations-radio-rebootImmediate']
Rahul Maheshwari317c7102020-08-30 21:10:22 -050029
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
42
43 Redfish Power On stack_mode=skip
44 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}
48 Wait Until Keyword Succeeds 3 min 0 sec Element Should Contain ${xpath_current_power_state} Off
49
50
51Verify Orderly Shutdown
52 [Documentation] Verify shutdown after clicking orderly shutdown button.
53 [Tags] Verify_Orderly_Shutdown
54
55 Redfish Power On stack_mode=skip
56 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}
60 Wait Until Keyword Succeeds 10 min 0 sec Element Should Contain ${xpath_current_power_state} Off
61
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
67 Page Should Contain Current status
68 Page Should Contain Host OS boot settings
69 Page Should Contain Operations
70
71
manashsarma61649752020-08-19 07:01:19 -050072Verify Existence Of All Input Boxes In Host Os Boot Settings
73 [Documentation] Verify existence of all input boxes in host os boot settings.
74 [Tags] Verify_Existence_Of_Input_Boxes_In_Host_Os_Boot_Settings
75
76 Page Should Contain Element ${xpath_enable_onetime_boot_checkbox}
77 Page Should Contain Element ${xpath_boot_option_select}
78
79
80Verify Existence Of All Sections In Host Os Boot Settings
81 [Documentation] Verify existence of all sections in host os boot settings.
82 [Tags] Verify_Existence_Of_All_Sections_In_Host_Os_Boot_Settings
83
84 Page Should Contain Boot settings override
85 Page Should Contain TPM required policy
86
87
Rahul Maheshwari317c7102020-08-30 21:10:22 -050088Verify System State At Power Off
89 [Documentation] Verify state of the system in power off state.
90 [Tags] Verify_System_State_At_Power_Off
91
92 Redfish Power Off stack_mode=skip
manashsarma73d24f12020-08-25 07:42:53 -050093 Page Should Contain Element ${xpath_current_power_state}
94 Element Should Contain ${xpath_current_power_state} Off
Rahul Maheshwari317c7102020-08-30 21:10:22 -050095
96
97Verify System State At Power On
98 [Documentation] Verify state of the system in power on state.
99 [Tags] Verify_System_State_At_Power_On
100
101 Redfish Power On stack_mode=skip
manashsarma73d24f12020-08-25 07:42:53 -0500102 Page Should Contain Element ${xpath_current_power_state}
103 Element Should Contain ${xpath_current_power_state} On
Rahul Maheshwari317c7102020-08-30 21:10:22 -0500104
105
manashsarma7cbe1c02020-08-20 05:36:30 -0500106Verify PowerOn Button Should Present At Power Off
107 [Documentation] Verify existence of poweron button at power off.
108 [Tags] Verify_PowerOn_Button_Should_Present_At_Power_Off
109
110 Redfish Power Off stack_mode=skip
111 # TODO: Implement power off using GUI later.
112 Page Should Contain Element ${xpath_poweron_button}
113
114
115Verify Shutdown And Reboot Buttons Presence At Power On
116 [Documentation] Verify existence of shutdown and reboot buttons at power on.
117 [Tags] Verify_Shutdown_And_Reboot_Buttons_Presence_At_Power_On
118
119 Redfish Power On stack_mode=skip
120 # TODO: Implement power on using GUI later.
121 Page Should Contain Element ${xpath_shutdown_button}
122 Page Should Contain Element ${xpath_reboot_button}
123
124
manashsarma66f9a622020-08-23 06:39:53 -0500125Verify Existence Of Buttons In Host Os Boot Settings
126 [Documentation] Verify existence of buttons in Host OS boot settings.
127 [Tags] Verify_Existence_Of_Buttons_In_Host_Os_Boot_Settings
128
129 Page Should Contain Element ${xpath_tpm_policy_button}
130 Page Should Contain Element ${xpath_save_button}
131
132
manashsarma348585c2020-08-27 06:52:39 -0500133Verify Host Immediate Reboot
134 [Documentation] Verify host reboot after triggering immediate reboot.
135 [Tags] Verify_Host_Immediate_Reboot
136
137 Redfish Power On stack_mode=skip
138 Click Element At Coordinates ${xpath_reboot_immediate_radio} 0 0
139 Click Element ${xpath_reboot_button}
140 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
141 Click Element ${xpath_confirm_button}
142 Wait Until Keyword Succeeds 3 min 0 sec Element Should Contain ${xpath_current_power_state} Off
143 Click Element ${xpath_refresh_button}
144 Wait Until Keyword Succeeds 3 min 0 sec Element Should Contain ${xpath_current_power_state} On
145
146
147Verify Host Orderly Reboot
148 [Documentation] Verify host reboot after triggering orderly reboot.
149 [Tags] Verify_Host_Orderly_Reboot
150
151 Redfish Power On stack_mode=skip
152 Click Element At Coordinates ${xpath_reboot_orderly_radio} 0 0
153 Click Element ${xpath_reboot_button}
154 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
155 Click Element ${xpath_confirm_button}
156 Wait Until Keyword Succeeds 10 min 0 sec Element Should Contain ${xpath_current_power_state} Off
157 Click Element ${xpath_refresh_button}
158 Wait Until Keyword Succeeds 10 min 0 sec Element Should Contain ${xpath_current_power_state} On
159
160
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500161*** Keywords ***
162
163Test Setup Execution
164 [Documentation] Do test case setup tasks.
165
166 Click Element ${xpath_control_menu}
167 Click Element ${xpath_server_power_operations_sub_menu}
168 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-power-operations