Added testcases for Power restore policy
Change-Id: I5e7b6ff6d7e694b320589d2f9bb861ed878b814a
Signed-off-by: Ashwini Chandrappa <Ashwini.Chandrappa777@ibm.com>
diff --git a/gui/data/gui_variables.py b/gui/data/gui_variables.py
index 0d3ac39..4e3087e 100644
--- a/gui/data/gui_variables.py
+++ b/gui/data/gui_variables.py
@@ -44,6 +44,7 @@
xpath_server_power_operations_sub_menu = "//*[@data-test-id='nav-item-server-power-operations']"
xpath_sol_sub_menu = "//*[@data-test-id='nav-item-serial-over-lan']"
xpath_kvm_sub_menu = "//*[@data-test-id='nav-item-kvm']"
+ xpath_power_restore_policy_sub_menu = "//*[@data-test-id='nav-item-power-restore-policy']"
# Configuration menu
xpath_server_configuration = "//*[@data-test-id='nav-button-configuration']"
diff --git a/gui/gui_test/control_menu/test_power_restore_policy_sub_menu.robot b/gui/gui_test/control_menu/test_power_restore_policy_sub_menu.robot
new file mode 100644
index 0000000..e076dbf
--- /dev/null
+++ b/gui/gui_test/control_menu/test_power_restore_policy_sub_menu.robot
@@ -0,0 +1,54 @@
+*** Settings ***
+
+Documentation Test OpenBMC GUI "Power restore policy" sub-menu of "Server control" menu.
+
+Resource ../../lib/gui_resource.robot
+
+Suite Setup Launch Browser And Login GUI
+Suite Teardown Close Browser
+Test Setup Test Setup Execution
+
+
+*** Variables ***
+
+${xpath_power_restore_policy_heading} //h1[text()="Power restore policy"]
+${xpath_AlwaysOn_radio} //input[@value='AlwaysOn']
+${xpath_AlwaysOff_radio} //input[@value='AlwaysOff']
+${xpath_LastState_radio} //input[@value='LastState']
+${xpath_save_settings_button} //button[contains(text(),'Save settings')]
+
+
+*** Test Cases ***
+
+Verify Navigation To Power Restore Policy Page
+ [Documentation] Verify navigation to Power Restore Policy page.
+ [Tags] Verify_Navigation_To_Power_Restore_Policy_Page
+
+ Page Should Contain Element ${xpath_power_restore_policy_heading}
+
+
+Verify Existence Of All Sections In Power Restore Policy Page
+ [Documentation] Verify existence of all sections in Power Restore Policy page.
+ [Tags] Verify_Existence_Of_All_Sections_In_Power_Restore_Policy_Page
+
+ Page Should Contain Power restore policies
+
+
+Verify Existence Of All Buttons In Power Restore Policy Page
+ [Documentation] Verify existence of All Buttons.
+ [Tags] Verify_Existence_Of_All_Buttons
+
+ Page Should Contain Element ${xpath_AlwaysOn_radio}
+ Page Should Contain Element ${xpath_AlwaysOff_radio}
+ Page Should Contain Element ${xpath_LastState_radio}
+ Page Should Contain Element ${xpath_save_settings_button}
+
+
+*** Keywords ***
+
+Test Setup Execution
+ [Documentation] Do test case setup tasks.
+
+ Click Element ${xpath_control_menu}
+ Click Element ${xpath_power_restore_policy_sub_menu}
+ Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain power-restore-policy