Verify refresh button under GUI header.
Resolves openbmc/openbmc-test-automation#1257
Change-Id: I7378cfe8c4e383e9b79bdbc04d476cc873521690
Signed-off-by: Sivas SRR <sivas.srr@in.ibm.com>
diff --git a/gui/obmc_gui/lib/resource.robot b/gui/obmc_gui/lib/resource.robot
index e4ebc3c..9d3dad9 100644
--- a/gui/obmc_gui/lib/resource.robot
+++ b/gui/obmc_gui/lib/resource.robot
@@ -312,3 +312,17 @@
# text_message Content of the display message info.
Element Text Should Be ${xpath_text_message} ${text_message}
+
+
+Expected Initial Test State
+ [Documentation] Power on the host if "Running" expected, Power off the
+ ... host if "Off" expected as per the requirement of initial test state.
+ [Arguments] ${expectedState}
+ # Description of argument(s):
+ # expectedState Test initial host state.
+
+ Run Keyword If '${expectedState}' == 'Running'
+ ... Initiate Host Boot
+
+ Run Keyword If '${expectedState}' == 'Off'
+ ... Initiate Host PowerOff
diff --git a/gui/obmc_gui/test/gui_header/test_obmc_gui_ip_check.robot b/gui/obmc_gui/test/gui_header/test_obmc_gui_ip_refresh_check.robot
similarity index 63%
rename from gui/obmc_gui/test/gui_header/test_obmc_gui_ip_check.robot
rename to gui/obmc_gui/test/gui_header/test_obmc_gui_ip_refresh_check.robot
index 05ca46a..2c56cf2 100644
--- a/gui/obmc_gui/test/gui_header/test_obmc_gui_ip_check.robot
+++ b/gui/obmc_gui/test/gui_header/test_obmc_gui_ip_refresh_check.robot
@@ -3,12 +3,14 @@
Documentation Test Open BMC GUI BMC host information under GUI Header.
Resource ../../lib/resource.robot
+Resource ../../../../lib/boot_utils.robot
Suite Setup Suite Setup Execution
Suite Teardown Close Browser
*** Variables ***
${xpath_select_server_control} //*[@id="header__wrapper"]/div/div[2]/p[2]
+${xpath_select_refresh_button} //*[@id="header__wrapper"]/div/div[3]/button
*** Test Cases ***
@@ -21,6 +23,18 @@
${gui_displayed_ip}= Get Text ${xpath_select_server_control}
Should Contain ${gui_displayed_ip} ${OPENBMC_HOST}
+Verify Refresh Button
+ [Documentation] Verify Refresh Button in GUI header.
+ [Tags] Verify_Refresh_Button
+
+ # Verify power is on after refresh button.
+
+ Expected Initial Test State Off
+ Click Element ${xpath_select_refresh_button}
+ GUI Power On
+ Click Element ${xpath_select_refresh_button}
+ Wait Until Page Contains Running
+
*** Keywords ***
Suite Setup Execution
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 14079ec..d6b4296 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
@@ -129,19 +129,6 @@
*** Keywords ***
-Expected Initial Test State
- [Documentation] Power on the host if "Running" expected, Power off the
- ... host if "Off" expected as per the requirement of initial test state.
- [Arguments] ${expectedState}
- # Description of argument(s):
- # expectedState Test initial host state.
-
- Run Keyword If '${expectedState}' == 'Running'
- ... Initiate Host Boot
-
- Run Keyword If '${expectedState}' == 'Off'
- ... Initiate Host PowerOff
-
Login OpenBMC GUI with failure enable
Open Browser With URL ${xpath_openbmc_url}