GUI: Added Redfish login/logout step.

Changes:
    - In gui/gui_test/resource_management_menu/test_power_sub_menu.robot
    - Added Redfish login and logout step at the suite level.
    - Added wait until step to avoid success message popup for below test cases.

Tested:
    - Ran the above test case from the sandbox successfully

Change-Id: Iace52928831809b3fda6b25a37e22cc8fcf4858f
Signed-off-by: Nandish-Matti <nandish.matti@ibm.com>
diff --git a/gui/data/gui_variables.py b/gui/data/gui_variables.py
index f112ae7..dd92460 100644
--- a/gui/data/gui_variables.py
+++ b/gui/data/gui_variables.py
@@ -102,6 +102,7 @@
     )
     xpath_power_sub_menu = "//*[@data-test-id='nav-item-power']"
     xpath_power_heading = "//h1[contains(text(), 'Power')]"
+    xpath_success_message = "//*[contains(text(),'Success')]"
 
     # Profile settings
     xpath_default_UTC = "//*[@data-test-id='profileSettings-radio-defaultUTC']"
diff --git a/gui/gui_test/resource_management_menu/test_power_sub_menu.robot b/gui/gui_test/resource_management_menu/test_power_sub_menu.robot
index cdaedc2..c0a2829 100644
--- a/gui/gui_test/resource_management_menu/test_power_sub_menu.robot
+++ b/gui/gui_test/resource_management_menu/test_power_sub_menu.robot
@@ -5,7 +5,7 @@
 Resource        ../../lib/gui_resource.robot
 
 Suite Setup     Suite Setup Execution
-Suite Teardown  Close Browser
+Suite Teardown  Suite Teardown Execution
 
 
 *** Variables ***
@@ -20,6 +20,7 @@
 ${xpath_update_power_save_mode}       //button[contains(text(),'Update power saver mode')]
 ${xpath_page_loading_progress_bar}    //*[@aria-label='Page loading progress bar']
 
+
 *** Test Cases ***
 
 Verify Navigation To Power Page
@@ -39,6 +40,7 @@
     Page Should Contain  Power and performance mode
     Page Should Contain  Idle power saver
 
+
 Verify Existence Of All Buttons In Power Page
     [Documentation]  Verify existence of all buttons in power page.
     [Tags]  Verify_Existence_Of_All_Buttons_In_Power_Page
@@ -74,6 +76,8 @@
     Input Text  ${xpath_cap_input_button}  ${power_cap_value}
     Click Element  ${xpath_submit_button}
     Wait Until Keyword Succeeds  1 min  15 sec  Is Power Cap Value Set  ${power_cap_value}
+    Wait Until Element Is Visible   ${xpath_success_message}  timeout=60
+    Wait Until Element Is Not Visible   ${xpath_success_message}  timeout=60
 
 
 Verify Server Power Cap Setting With Power Cap Disabled
@@ -99,7 +103,8 @@
     Input Text  ${xpath_cap_input_button}  ${power_cap_value}
     Click Element  ${xpath_submit_button}
     Wait Until Keyword Succeeds  1 min  15 sec  Is Power Cap Value Set  ${power_cap_value}
-
+    Wait Until Element Is Visible   ${xpath_success_message}  timeout=60
+    Wait Until Element Is Not Visible   ${xpath_success_message}  timeout=60
 
 *** Keywords ***
 
@@ -156,3 +161,11 @@
     Click Element  ${xpath_power_sub_menu}
     Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  power
     Wait Until Element Is Not Visible   ${xpath_page_loading_progress_bar}  timeout=30
+    Redfish.Login
+
+Suite Teardown Execution
+    [Documentation]  Do suite teardown tasks.
+
+    Logout GUI
+    Close Browser
+    Redfish.Logout