Added test cases to validate boot settings in server power operations

Signed-off-by: Anusha Dathatri <adathatr@in.ibm.com>
Change-Id: I0fd3dd742921682206de46ceaabf8362fdca51aa
diff --git a/gui/data/resource_variables.py b/gui/data/resource_variables.py
index ab46cec..efa4d4f 100644
--- a/gui/data/resource_variables.py
+++ b/gui/data/resource_variables.py
@@ -18,6 +18,7 @@
     xpath_select_button_power_on = "//*[@id='power__power-on']"
     xpath_cancel_button = "//button[contains(text(),'Cancel')]"
     xpath_save_setting_button = "//button[contains(text(),'Save settings')]"
+    xpath_save_button = "//button[contains(text(),'Save')]"
 
     xpath_select_button_warm_reboot = \
         "//*[@id='power__warm-boot']"
diff --git a/gui/test/server_control/test_obmc_gui_server_power_operations.robot b/gui/test/server_control/test_obmc_gui_server_power_operations.robot
index 0dc8578..dad0332 100644
--- a/gui/test/server_control/test_obmc_gui_server_power_operations.robot
+++ b/gui/test/server_control/test_obmc_gui_server_power_operations.robot
@@ -14,6 +14,9 @@
 ${xpath_shutdown_button}         //button[contains(text(), "Shut down")]
 ${xpath_reboot_button}           //button[contains(text(), "Reboot")]
 ${xpath_power_on_button}         //button[contains(text(), "Power on")]
+${xpath_tpm_toggle_switch}       //label[@for="toggle__switch-round"]
+${xpath_select_boot_override}    //select[@id="boot-selected"]
+${xpath_select_one_time_boot}    //label[@id="one-time-label"]
 
 *** Test Cases ***
 
@@ -81,6 +84,37 @@
     Element Should Be Visible  ${xpath_reboot_button}
 
 
+Verify Existence Of All Sections In Host Os Boot Settings
+    [Documentation]  Verify existence of all sections in host os boot settings.
+    [Tags]  Verify_Existence_Of_All_Sections_In_Host_Os_Boot_Settings
+    [Setup]  Run Keywords  Launch Browser And Login OpenBMC GUI  AND
+    ...  Navigate To Server Power Operations
+
+    Page Should Contain  Boot setting override
+    Page Should Contain  TPM required policy
+
+
+Verify Existence Of All Buttons In Host Os Boot Settings
+    [Documentation]  Verify existence of all buttons in host os boot settings.
+    [Tags]  Verify_Existence_Of_All_Buttons_In_Host_Os_Boot_Settings
+    [Setup]  Run Keywords  Launch Browser And Login OpenBMC GUI  AND
+    ...  Navigate To Server Power Operations
+
+    Page Should Contain Element  ${xpath_tpm_toggle_switch}
+    Page Should Contain Element  ${xpath_save_button}
+    Page Should Contain Element  ${xpath_cancel_button}
+
+
+Verify Existence Of All Input Boxes In Host Os Boot Settings
+    [Documentation]  Verify existence of all input boxes in host os boot settings.
+    [Tags]  Verify_Existence_Of_All_Input_Boxes_In_Host_Os_Boot_Settings
+    [Setup]  Run Keywords  Launch Browser And Login OpenBMC GUI  AND
+    ...  Navigate To Server Power Operations
+
+    Page Should Contain Element  ${xpath_select_boot_override}
+    Page Should Contain Element  ${xpath_select_one_time_boot}
+
+
 *** Keywords ***
 
 Setup For Test Execution
@@ -91,6 +125,11 @@
     # obmc_required_state  The OpenBMC state which is required for the test.
 
     Test Setup Execution  ${obmc_required_state}
+    Navigate To Server Power Operations
+
+Navigate To Server Power Operations
+    [Documentation]  Navigate to server power operations.
+
     Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
     Click Element  ${xpath_select_server_control}
     Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}