Add test cases of power operations with confirmation as "No"

Resoloves  openbmc/openbmc-test-automation#1200

Change-Id: I4536ad62378a45dbe514696001baeeff0cfca12b
Signed-off-by: Sivas SRR <sivas.srr@in.ibm.com>
diff --git a/gui/obmc_asmi/data/resource_variables.py b/gui/obmc_asmi/data/resource_variables.py
new file mode 100644
index 0000000..918e320
--- /dev/null
+++ b/gui/obmc_asmi/data/resource_variables.py
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+
+r"""
+Contains xpaths and related string constants applicable to all openBMC GUI
+menus.
+"""
+
+
+class resource_variables():
+
+    xpath_textbox_hostname = "//*[@id='login__form']/input[1]"
+    xpath_textbox_username = "//*[@id='username']"
+    xpath_textbox_password = "//*[@id='password']"
+    xpath_button_login = "//*[@id='login__submit']"
+    xpath_button_logout = "//*[@id='header']/a"
+    xpath_display_server_power_status = \
+        "//*[@id='header__wrapper']/div/div[3]/a[3]/span"
+    xpath_select_button_orderly_power_shutdown = \
+        "//*[@id='power__soft-shutdown']"
+    xpath_select_button_orderly_power_shutdown_yes = \
+        "//*[@id='power-operations']/div[3]/div[5]/confirm/div/div[2]/" \
+        "button[1]"
+    xpath_select_button_power_on = "//*[@id='power__power-on']"
+
+    xpath_openbmc_url = "http://localhost:8080/#/login"
+    xpath_openbmc_ip = "//*[@id='login__form']/input[1]"
+    openbmc_username = "root"
+    openbmc_password = "0penBmc"
+
+    obmc_off_state = "Off"
+    obmc_quiesced_state = "Quiesced"
+    obmc_running_state = "Running"
+
+    # Power operation elements needed for power on.
+    header_wrapper = "3"
+    header_wrapper_elt = "3"
+
+    # Power operation elements needed for power operations confirmation.
+    power_operations = "3"
+    warm_boot = "3"
+    cold_boot = "4"
+    shut_down = "5"
+    power_off = "6"
+    confirm_msg = "2"
+    yes = "1"
+    no = "2"
+
diff --git a/gui/obmc_gui/test/gui_header/test_obmc_gui_power_operations.robot b/gui/obmc_gui/test/gui_header/test_obmc_gui_power_operations.robot
index 5d7d3ab..edb8b99 100644
--- a/gui/obmc_gui/test/gui_header/test_obmc_gui_power_operations.robot
+++ b/gui/obmc_gui/test/gui_header/test_obmc_gui_power_operations.robot
@@ -10,41 +10,83 @@
 *** Test Cases ***
 
 Power On The Host
-    [Documentation]  Power on the Host.
+    [Documentation]  Power on the host.
     [Tags]  Power_On_the_Host
 
     GUI Power On
 
-Immediate Power Off The Host
-    [Documentation]  Immediate power off the Host.
-    [Tags]  Immediate_Power_Off_The_Host
+Click Immediate Power Off The Host And Press No
+    [Documentation]  Click Immediate power off the host button and press no
+    ...  button.
+    [Tags]  Click_Immediate_Power_Off_The_Host_And_Press_No
+
+    Controller Server Power Click Button  power__hard-shutdown
+    Controller Power Operations Confirmation Click Button  ${power_operations}
+    ...  ${power_off}  ${confirm_msg}  ${no}
+    Page Should Contain  Running
+
+Click Immediate Power Off The Host And Press Yes
+    [Documentation]  Click Immediate power off the host button and press
+    ...  yes button.
+    [Tags]  Click_Immediate_Power_Off_The_Host_And_Press_Yes
 
     Controller Server Power Click Button  power__hard-shutdown
     Controller Power Operations Confirmation Click Button  ${power_operations}
     ...  ${power_off}  ${confirm_msg}  ${yes}
+    Page Should Contain  Off
 
-Cold Boot The Host
-    [Documentation]  Cold boot the Host.
-    [Tags]  Cold_Boot_the_Host
+Click Cold Boot The Host And Press No
+    [Documentation]  Click cold boot the host button and press no button.
+    [Tags]  Click_Cold_Boot_The_Host_And_Press_No
 
     GUI Power On
     Controller Server Power Click Button  power__cold-boot
     Controller Power Operations Confirmation Click Button  ${power_operations}
-    ...  ${cold_boot}  ${confirm_msg}  ${yes}
+    ...  ${cold_boot}  ${confirm_msg}  ${no}
     Page Should Contain  Running
 
-Warm Boot The Host
-    [Documentation]  Warm boot the Host.
-    [Tags]  Warm_Boot_The_Host
+Click Cold Boot The Host And Press Yes
+    [Documentation]  Click Cold boot the host button and press yes button.
+    [Tags]  Click_Cold_Boot_the_Host_And_Press_Yes
+
+    Controller Server Power Click Button  power__cold-boot
+    Controller Power Operations Confirmation Click Button  ${power_operations}
+    ...  ${cold_boot}  ${confirm_msg}  ${yes}
+    Page Should Contain  Standby
+    Page Should Contain  Running
+
+Click Warm Boot The Host And Press No
+    [Documentation]  Click warm boot the host button and press no button.
+    [Tags]  Click_Warm_Boot_The_Host_And_Press_No
+
+    Controller Server Power Click Button  power__warm-boot
+    Controller Power Operations Confirmation Click Button  ${power_operations}
+    ...  ${warm_boot}  ${confirm_msg}  ${no}
+    Page Should Contain  Running
+
+Click Warm Boot The Host And Press Yes
+    [Documentation]  Click warm boot the host button and press yes button.
+    [Tags]  Click_Warm_Boot_The_Host_And_Press_Yes
 
     Controller Server Power Click Button  power__warm-boot
     Controller Power Operations Confirmation Click Button  ${power_operations}
     ...  ${warm_boot}  ${confirm_msg}  ${yes}
     Page Should Contain  Running
 
-Orderly Shutdown The Host
-    [Documentation]  Orderly shutdown the Host.
-    [Tags]  Orderly_Shutdown_The_Host
+Click Orderly Shutdown The Host And Press No
+    [Documentation]  Press orderly shutdown the host button and press no
+    ...  button.
+    [Tags]  Click_Orderly_Shutdown_The_Host_And_Press_No
+
+    Controller Server Power Click Button  power__soft-shutdown
+    Controller Power Operations Confirmation Click Button  ${power_operations}
+    ...  ${shut_down}  ${confirm_msg}  ${no}
+    Page Should Contain  Running
+
+Click Orderly Shutdown The Host And Press Yes
+    [Documentation]  Press orderly shutdown the host button and press yes
+    ...  button.
+    [Tags]  Click_Orderly_Shutdown_The_Host_And_Press_Yes
 
     Controller Server Power Click Button  power__soft-shutdown
     Controller Power Operations Confirmation Click Button  ${power_operations}
@@ -52,7 +94,7 @@
     Page Should Contain  Off
 
 OpenBMC GUI Logoff
-    [Documentation]  Log out from OpenBMC GUI.
+    [Documentation]  Log out from openBMC GUI.
     [Tags]  OpenBMC_GUI_Logoff
 
     Log  ${xpath_openbmc_url}