Added test suite for GUI SNMP testing
Change-Id: I9b94e028567762881cb54f1dffeb1dee1b5d62b6
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/gui/data/resource_variables.py b/gui/data/resource_variables.py
index a8cc1fb..9a79a18 100644
--- a/gui/data/resource_variables.py
+++ b/gui/data/resource_variables.py
@@ -18,6 +18,8 @@
xpath_openbmc_ip = "//*[@id='login__form']/input[1]"
xpath_power_indicator = "//*[@id='power-indicator-bar']"
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_select_button_warm_reboot = \
"//*[@id='power__warm-boot']"
@@ -67,9 +69,11 @@
# xpath for main menu.
xpath_select_server_control = "//button[contains(@class,'btn-control')]"
+ xpath_select_server_configuration = "//button[contains(@class,'btn-config')]"
# xpath for sub main menu.
xpath_select_server_power_operations = "//a[@href='#/server-control/power-operations']"
+ xpath_select_snmp_settings = "//a[@href='#/configuration/snmp']"
# Power operation elements needed for power on.
header_wrapper = "3"
diff --git a/gui/test/server_config/test_obmc_gui_snmp_settings.robot b/gui/test/server_config/test_obmc_gui_snmp_settings.robot
new file mode 100644
index 0000000..80e918f
--- /dev/null
+++ b/gui/test/server_config/test_obmc_gui_snmp_settings.robot
@@ -0,0 +1,44 @@
+*** Settings ***
+
+Documentation Test OpenBMC GUI "SNMP settings" sub-menu of "Server configuration".
+
+Resource ../../lib/resource.robot
+
+Suite Setup Launch Browser And Login OpenBMC GUI
+Suite Teardown Close Browser
+Test Setup Test Setup Execution
+
+
+*** Variables ***
+
+${xpath_add_manager_button} //button[text()[contains(.,"Add manager")]]
+
+
+*** Test Cases ***
+
+Verify Existence Of All Sections In SNMP Page
+ [Documentation] Verify existence of all sections in SNMP page.
+ [Tags] Verify_Existence_Of_All_Sections_In_SNMP_Page
+
+ Page Should Contain Managers
+
+
+Verify Existence Of All Buttons In SNMP Page
+ [Documentation] Verify existence of all buttons in SNMP page.
+ [Tags] Verify_Existence_Of_All_Buttons_In_SNMP_Page
+
+ Page Should Contain Element ${xpath_add_manager_button}
+ Page Should Contain Element ${xpath_save_setting_button}
+ Page Should Contain Element ${xpath_cancel_button}
+
+
+*** Keywords ***
+
+Test Setup Execution
+ [Documentation] Do test case setup tasks.
+
+ Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
+ Click Element ${xpath_select_server_configuration}
+ Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
+ Click Element ${xpath_select_snmp_settings}
+ Wait Until Page Contains SNMP settings