Added GUI automation test cases to test shutdown operation

Test cases added:
    - Verify Orderly Shutdown
    - Verify Immediate Shutdown

Change-Id: Id50dbb568e1d87b773905717d2acaca3b0a75c88
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/gui/data/resource_variables.py b/gui/data/resource_variables.py
index 1efeedc..55faa26 100644
--- a/gui/data/resource_variables.py
+++ b/gui/data/resource_variables.py
@@ -136,7 +136,7 @@
     xpath_server_power_header = "//*[@data-test-id='appHeader-container-power']"
     xpath_refresh_button = "//*[@data-test-id='appHeader-button-refresh']"
     xpath_network_page_header = "//h1[contains(text(), 'Network settings')]"
-    xpath_sol_header = "//h1[contains(text(), "Serial over LAN console")]"
+    xpath_sol_header = "//h1[contains(text(), 'Serial over LAN console')]"
 
     # xpath for health menu
     xpath_health_menu = "//button[@aria-controls='health-menu']"
diff --git a/gui/gui_test/control_menu/test_server_power_operations_sub_menu.robot b/gui/gui_test/control_menu/test_server_power_operations_sub_menu.robot
index e7fcc37..ff2afe5 100644
--- a/gui/gui_test/control_menu/test_server_power_operations_sub_menu.robot
+++ b/gui/gui_test/control_menu/test_server_power_operations_sub_menu.robot
@@ -3,6 +3,7 @@
 Documentation  Test OpenBMC GUI "Server power operations" sub-menu of "Server control".
 
 Resource        ../../lib/resource.robot
+Resource        ../../../lib/state_manager.robot
 
 Suite Setup     Launch Browser And Login GUI
 Suite Teardown  Close Browser
@@ -19,8 +20,10 @@
 ${xpath_poweron_button}                    //*[@data-test-id='serverPowerOperations-button-powerOn']
 ${xpath_tpm_policy_button}                 //input[@id='tpm-required-policy']
 ${xpath_save_button}                       //button[contains(text(),'Save')]
-${Current_status}                          //*[contains(@class,'row mb-4')]
-
+${xpath_shutdown_orderly_radio}            //*[@data-test-id='serverPowerOperations-radio-shutdownOrderly']
+${xpath_shutdown_immediate_radio}          //*[@data-test-id='serverPowerOperations-radio-shutdownImmediate']
+${xpath_confirm_button}                    //button[contains(text(),'Confirm')]
+${xpath_current_power_state}               //*[contains(@class,'row mb-4')]
 
 *** Test Cases ***
 
@@ -31,6 +34,30 @@
     Page Should Contain Element  ${xpath_server_power_heading}
 
 
+Verify Immediate Shutdown
+    [Documentation]  Verify shutdown after clicking immediate shutdown button.
+    [Tags]  Verify_Immediate_Shutdown
+
+    Redfish Power On  stack_mode=skip
+    Click Element At Coordinates  ${xpath_shutdown_immediate_radio}  0  0
+    Click Element  ${xpath_shutdown_button}
+    Wait Until Page Contains Element  ${xpath_confirm_button}  timeout=10
+    Click Element  ${xpath_confirm_button}
+    Wait Until Keyword Succeeds  3 min  0 sec  Element Should Contain  ${xpath_current_power_state}  Off
+
+
+Verify Orderly Shutdown
+    [Documentation]  Verify shutdown after clicking orderly shutdown button.
+    [Tags]  Verify_Orderly_Shutdown
+
+    Redfish Power On  stack_mode=skip
+    Click Element At Coordinates  ${xpath_shutdown_orderly_radio}  0  0
+    Click Element  ${xpath_shutdown_button}
+    Wait Until Page Contains Element  ${xpath_confirm_button}  timeout=10
+    Click Element  ${xpath_confirm_button}
+    Wait Until Keyword Succeeds  10 min  0 sec  Element Should Contain  ${xpath_current_power_state}  Off
+
+
 Verify Existence Of All Sections In Server Power Operations Page
     [Documentation]  Verify existence of all sections in Server Power Operations page.
     [Tags]  Verify_Existence_Of_All_Sections_In_Server_Power_Operations_Page
@@ -61,8 +88,8 @@
     [Tags]  Verify_System_State_At_Power_Off
 
     Redfish Power Off  stack_mode=skip
-    Page Should Contain Element  ${Current_status}
-    Element Should Contain   ${Current_status}  Off
+    Page Should Contain Element  ${xpath_current_power_state}
+    Element Should Contain   ${xpath_current_power_state}  Off
 
 
 Verify System State At Power On
@@ -70,8 +97,8 @@
     [Tags]  Verify_System_State_At_Power_On
 
     Redfish Power On  stack_mode=skip
-    Page Should Contain Element  ${Current_status}
-    Element Should Contain   ${Current_status}  On
+    Page Should Contain Element  ${xpath_current_power_state}
+    Element Should Contain   ${xpath_current_power_state}  On
 
 
 Verify PowerOn Button Should Present At Power Off