blob: ff2afe52f6b03e5e162e7b4f75b6f9cfbe307181 [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')]
Rahul Maheshwari317c7102020-08-30 21:10:22 -050027
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
40
41 Redfish Power On stack_mode=skip
42 Click Element At Coordinates ${xpath_shutdown_immediate_radio} 0 0
43 Click Element ${xpath_shutdown_button}
44 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
45 Click Element ${xpath_confirm_button}
46 Wait Until Keyword Succeeds 3 min 0 sec Element Should Contain ${xpath_current_power_state} Off
47
48
49Verify Orderly Shutdown
50 [Documentation] Verify shutdown after clicking orderly shutdown button.
51 [Tags] Verify_Orderly_Shutdown
52
53 Redfish Power On stack_mode=skip
54 Click Element At Coordinates ${xpath_shutdown_orderly_radio} 0 0
55 Click Element ${xpath_shutdown_button}
56 Wait Until Page Contains Element ${xpath_confirm_button} timeout=10
57 Click Element ${xpath_confirm_button}
58 Wait Until Keyword Succeeds 10 min 0 sec Element Should Contain ${xpath_current_power_state} Off
59
60
manashsarma66f9a622020-08-23 06:39:53 -050061Verify Existence Of All Sections In Server Power Operations Page
62 [Documentation] Verify existence of all sections in Server Power Operations page.
63 [Tags] Verify_Existence_Of_All_Sections_In_Server_Power_Operations_Page
64
65 Page Should Contain Current status
66 Page Should Contain Host OS boot settings
67 Page Should Contain Operations
68
69
manashsarma61649752020-08-19 07:01:19 -050070Verify Existence Of All Input Boxes In Host Os Boot Settings
71 [Documentation] Verify existence of all input boxes in host os boot settings.
72 [Tags] Verify_Existence_Of_Input_Boxes_In_Host_Os_Boot_Settings
73
74 Page Should Contain Element ${xpath_enable_onetime_boot_checkbox}
75 Page Should Contain Element ${xpath_boot_option_select}
76
77
78Verify Existence Of All Sections In Host Os Boot Settings
79 [Documentation] Verify existence of all sections in host os boot settings.
80 [Tags] Verify_Existence_Of_All_Sections_In_Host_Os_Boot_Settings
81
82 Page Should Contain Boot settings override
83 Page Should Contain TPM required policy
84
85
Rahul Maheshwari317c7102020-08-30 21:10:22 -050086Verify System State At Power Off
87 [Documentation] Verify state of the system in power off state.
88 [Tags] Verify_System_State_At_Power_Off
89
90 Redfish Power Off stack_mode=skip
manashsarma73d24f12020-08-25 07:42:53 -050091 Page Should Contain Element ${xpath_current_power_state}
92 Element Should Contain ${xpath_current_power_state} Off
Rahul Maheshwari317c7102020-08-30 21:10:22 -050093
94
95Verify System State At Power On
96 [Documentation] Verify state of the system in power on state.
97 [Tags] Verify_System_State_At_Power_On
98
99 Redfish Power On stack_mode=skip
manashsarma73d24f12020-08-25 07:42:53 -0500100 Page Should Contain Element ${xpath_current_power_state}
101 Element Should Contain ${xpath_current_power_state} On
Rahul Maheshwari317c7102020-08-30 21:10:22 -0500102
103
manashsarma7cbe1c02020-08-20 05:36:30 -0500104Verify PowerOn Button Should Present At Power Off
105 [Documentation] Verify existence of poweron button at power off.
106 [Tags] Verify_PowerOn_Button_Should_Present_At_Power_Off
107
108 Redfish Power Off stack_mode=skip
109 # TODO: Implement power off using GUI later.
110 Page Should Contain Element ${xpath_poweron_button}
111
112
113Verify Shutdown And Reboot Buttons Presence At Power On
114 [Documentation] Verify existence of shutdown and reboot buttons at power on.
115 [Tags] Verify_Shutdown_And_Reboot_Buttons_Presence_At_Power_On
116
117 Redfish Power On stack_mode=skip
118 # 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
manashsarma66f9a622020-08-23 06:39:53 -0500123Verify Existence Of Buttons In Host Os Boot Settings
124 [Documentation] Verify existence of buttons in Host OS boot settings.
125 [Tags] Verify_Existence_Of_Buttons_In_Host_Os_Boot_Settings
126
127 Page Should Contain Element ${xpath_tpm_policy_button}
128 Page Should Contain Element ${xpath_save_button}
129
130
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -0500131*** Keywords ***
132
133Test Setup Execution
134 [Documentation] Do test case setup tasks.
135
136 Click Element ${xpath_control_menu}
137 Click Element ${xpath_server_power_operations_sub_menu}
138 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-power-operations