1b89977a4SRahul Maheshwari*** Settings ***
257a4155fSRahul Maheshwari
357a4155fSRahul MaheshwariDocumentation   Test OpenBMC GUI "Server power operation" sub-menu of
457a4155fSRahul Maheshwari...             "Server control".
5b89977a4SRahul Maheshwari
6b89977a4SRahul MaheshwariResource        ../../lib/resource.robot
7b89977a4SRahul Maheshwari
89a4161c3SRahul MaheshwariTest Teardown   Close Browser
957a4155fSRahul Maheshwari
10883ff7cfSAnusha Dathatri
11b89977a4SRahul Maheshwari*** Variables ***
12b89977a4SRahul Maheshwari
1357a4155fSRahul Maheshwari${xpath_power_indicator_bar}     //*[@id='power-indicator-bar']
1457a4155fSRahul Maheshwari${xpath_shutdown_button}         //button[contains(text(), "Shut down")]
1557a4155fSRahul Maheshwari${xpath_reboot_button}           //button[contains(text(), "Reboot")]
16d6b00e7bSRahul Maheshwari${xpath_power_on_button}         //button[contains(text(), "Power on")]
17*bb20cb09SAnusha Dathatri${xpath_tpm_toggle_switch}       //label[@for="toggle__switch-round"]
18*bb20cb09SAnusha Dathatri${xpath_select_boot_override}    //select[@id="boot-selected"]
19*bb20cb09SAnusha Dathatri${xpath_select_one_time_boot}    //label[@id="one-time-label"]
20f3c2d7f5SArpana Durgaprasad
2157a4155fSRahul Maheshwari*** Test Cases ***
22f3c2d7f5SArpana Durgaprasad
2357a4155fSRahul MaheshwariVerify System State At Power Off
2457a4155fSRahul Maheshwari    [Documentation]  Verify system state at power off.
2557a4155fSRahul Maheshwari    [Tags]  Verify_System_State_At_Power_Off
269a4161c3SRahul Maheshwari    [Setup]  Setup For Test Execution  ${OBMC_PowerOff_state}
2757a4155fSRahul Maheshwari
2857a4155fSRahul Maheshwari    Element Should Contain  ${xpath_power_indicator_bar}  Off
29f3c2d7f5SArpana Durgaprasad
30f3c2d7f5SArpana Durgaprasad
3157a4155fSRahul MaheshwariVerify BMC IP In Server Power Operation Page
3257a4155fSRahul Maheshwari    [Documentation]  Verify BMC IP in server power operation page.
3357a4155fSRahul Maheshwari    [Tags]  Verify_BMC_IP_In_Server_Power_Operation_Page
349a4161c3SRahul Maheshwari    [Setup]  Setup For Test Execution  ${OBMC_PowerOff_state}
350f5aee7dSArpana Durgaprasad
3657a4155fSRahul Maheshwari    Element Should Contain  ${xpath_power_indicator_bar}  ${OPENBMC_HOST}
37b89977a4SRahul Maheshwari
38b89977a4SRahul Maheshwari
3957a4155fSRahul MaheshwariVerify Shutdown Button At Power Off
4057a4155fSRahul Maheshwari    [Documentation]  Verify that shutdown button is not present at power Off.
4157a4155fSRahul Maheshwari    [Tags]  Verify_Shutdown_Button_At_Power_Off
429a4161c3SRahul Maheshwari    [Setup]  Setup For Test Execution  ${OBMC_PowerOff_state}
43b89977a4SRahul Maheshwari
4457a4155fSRahul Maheshwari    Element Should Not Be Visible  ${xpath_shutdown_button}
45b89977a4SRahul Maheshwari
46b89977a4SRahul Maheshwari
4757a4155fSRahul MaheshwariVerify Reboot Button At Power Off
4857a4155fSRahul Maheshwari    [Documentation]  Verify that reboot button is not present at power Off.
4957a4155fSRahul Maheshwari    [Tags]  Verify_Reboot_Button_At_Power_Off
509a4161c3SRahul Maheshwari    [Setup]  Setup For Test Execution  ${OBMC_PowerOff_state}
51b89977a4SRahul Maheshwari
5257a4155fSRahul Maheshwari    Element Should Not Be Visible  ${xpath_reboot_button}
53b89977a4SRahul Maheshwari
54b89977a4SRahul Maheshwari
559a4161c3SRahul MaheshwariVerify Power On Button At Power Off
569a4161c3SRahul Maheshwari    [Documentation]  Verify presence of "Power On" button at power off.
579a4161c3SRahul Maheshwari    [Tags]  Verify_Power_On_Button_At_Power_Off
589a4161c3SRahul Maheshwari    [Setup]  Setup For Test Execution  ${OBMC_PowerOff_state}
599a4161c3SRahul Maheshwari
609a4161c3SRahul Maheshwari    Element Should Be Visible  ${xpath_power_on_button}
619a4161c3SRahul Maheshwari
629a4161c3SRahul Maheshwari
639a4161c3SRahul MaheshwariVerify System State At Power On
649a4161c3SRahul Maheshwari    [Documentation]  Verify system state at power on.
659a4161c3SRahul Maheshwari    [Tags]  Verify_System_State_At_Power_On
669a4161c3SRahul Maheshwari    [Setup]  Setup For Test Execution  ${obmc_PowerRunning_state}
679a4161c3SRahul Maheshwari
689a4161c3SRahul Maheshwari    Element Should Contain  ${xpath_power_indicator_bar}  Running
699a4161c3SRahul Maheshwari
709a4161c3SRahul Maheshwari
719a4161c3SRahul MaheshwariVerify Shutdown Button At Power On
729a4161c3SRahul Maheshwari    [Documentation]  Verify that shutdown button is present at power on.
739a4161c3SRahul Maheshwari    [Tags]  Verify_Shutdown_Button_At_Power_On
749a4161c3SRahul Maheshwari    [Setup]  Setup For Test Execution  ${obmc_PowerRunning_state}
759a4161c3SRahul Maheshwari
769a4161c3SRahul Maheshwari    Element Should Be Visible  ${xpath_shutdown_button}
779a4161c3SRahul Maheshwari
789a4161c3SRahul Maheshwari
799a4161c3SRahul MaheshwariVerify Reboot Button At Power On
809a4161c3SRahul Maheshwari    [Documentation]  Verify that reboot button is present at power on.
819a4161c3SRahul Maheshwari    [Tags]  Verify_Reboot_Button_At_Power_On
829a4161c3SRahul Maheshwari    [Setup]  Setup For Test Execution  ${obmc_PowerRunning_state}
839a4161c3SRahul Maheshwari
849a4161c3SRahul Maheshwari    Element Should Be Visible  ${xpath_reboot_button}
859a4161c3SRahul Maheshwari
869a4161c3SRahul Maheshwari
87*bb20cb09SAnusha DathatriVerify Existence Of All Sections In Host Os Boot Settings
88*bb20cb09SAnusha Dathatri    [Documentation]  Verify existence of all sections in host os boot settings.
89*bb20cb09SAnusha Dathatri    [Tags]  Verify_Existence_Of_All_Sections_In_Host_Os_Boot_Settings
90*bb20cb09SAnusha Dathatri    [Setup]  Run Keywords  Launch Browser And Login OpenBMC GUI  AND
91*bb20cb09SAnusha Dathatri    ...  Navigate To Server Power Operations
92*bb20cb09SAnusha Dathatri
93*bb20cb09SAnusha Dathatri    Page Should Contain  Boot setting override
94*bb20cb09SAnusha Dathatri    Page Should Contain  TPM required policy
95*bb20cb09SAnusha Dathatri
96*bb20cb09SAnusha Dathatri
97*bb20cb09SAnusha DathatriVerify Existence Of All Buttons In Host Os Boot Settings
98*bb20cb09SAnusha Dathatri    [Documentation]  Verify existence of all buttons in host os boot settings.
99*bb20cb09SAnusha Dathatri    [Tags]  Verify_Existence_Of_All_Buttons_In_Host_Os_Boot_Settings
100*bb20cb09SAnusha Dathatri    [Setup]  Run Keywords  Launch Browser And Login OpenBMC GUI  AND
101*bb20cb09SAnusha Dathatri    ...  Navigate To Server Power Operations
102*bb20cb09SAnusha Dathatri
103*bb20cb09SAnusha Dathatri    Page Should Contain Element  ${xpath_tpm_toggle_switch}
104*bb20cb09SAnusha Dathatri    Page Should Contain Element  ${xpath_save_button}
105*bb20cb09SAnusha Dathatri    Page Should Contain Element  ${xpath_cancel_button}
106*bb20cb09SAnusha Dathatri
107*bb20cb09SAnusha Dathatri
108*bb20cb09SAnusha DathatriVerify Existence Of All Input Boxes In Host Os Boot Settings
109*bb20cb09SAnusha Dathatri    [Documentation]  Verify existence of all input boxes in host os boot settings.
110*bb20cb09SAnusha Dathatri    [Tags]  Verify_Existence_Of_All_Input_Boxes_In_Host_Os_Boot_Settings
111*bb20cb09SAnusha Dathatri    [Setup]  Run Keywords  Launch Browser And Login OpenBMC GUI  AND
112*bb20cb09SAnusha Dathatri    ...  Navigate To Server Power Operations
113*bb20cb09SAnusha Dathatri
114*bb20cb09SAnusha Dathatri    Page Should Contain Element  ${xpath_select_boot_override}
115*bb20cb09SAnusha Dathatri    Page Should Contain Element  ${xpath_select_one_time_boot}
116*bb20cb09SAnusha Dathatri
117*bb20cb09SAnusha Dathatri
118b89977a4SRahul Maheshwari*** Keywords ***
119b89977a4SRahul Maheshwari
1209a4161c3SRahul MaheshwariSetup For Test Execution
1219a4161c3SRahul Maheshwari    [Documentation]  Do setup tasks for test case.
1229a4161c3SRahul Maheshwari    [Arguments]  ${obmc_required_state}
12357a4155fSRahul Maheshwari
1249a4161c3SRahul Maheshwari    # Description of argument(s):
1259a4161c3SRahul Maheshwari    # obmc_required_state  The OpenBMC state which is required for the test.
1269a4161c3SRahul Maheshwari
1279a4161c3SRahul Maheshwari    Test Setup Execution  ${obmc_required_state}
128*bb20cb09SAnusha Dathatri    Navigate To Server Power Operations
129*bb20cb09SAnusha Dathatri
130*bb20cb09SAnusha DathatriNavigate To Server Power Operations
131*bb20cb09SAnusha Dathatri    [Documentation]  Navigate to server power operations.
132*bb20cb09SAnusha Dathatri
13357a4155fSRahul Maheshwari    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
13457a4155fSRahul Maheshwari    Click Element  ${xpath_select_server_control}
13557a4155fSRahul Maheshwari    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
136f93a5c41SAnusha Dathatri    Click Element  ${xpath_select_server_power_operations}
13757a4155fSRahul Maheshwari    Wait Until Page Contains  Server power operations
138