Added fix for SNMP alerts sub menu

Changes:
    - Replaced SNMP Alerts with SNMP alerts
    - Modified Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify keyword
Tested:
    Ran Test
gui/gui_test/settings_menu/test_snmp_alerts_sub_menu.robot

Change-Id: Icb7e850048d061a6be04c8ce6c0a9158019b99a2
Signed-off-by: Megha GN <Megha.GN@ibm.com>
diff --git a/gui/gui_test/settings_menu/test_snmp_alerts_sub_menu.robot b/gui/gui_test/settings_menu/test_snmp_alerts_sub_menu.robot
index e453bb9..0406147 100644
--- a/gui/gui_test/settings_menu/test_snmp_alerts_sub_menu.robot
+++ b/gui/gui_test/settings_menu/test_snmp_alerts_sub_menu.robot
@@ -24,6 +24,10 @@
 ${xpath_delete_button}                            //*[@data-test-id='snmpAlerts-button-deleteRow-undefined']
 ${xpath_delete_destination}                       //button[contains(text(),'Delete destination')]
 
+${snmp_page_heading}                              SNMP alerts
+${invalid_port_error}                             Value must be between 0 – 65535
+${invalid_destination_error}                      Error in adding SNMP alert destination
+
 
 *** Test Cases ***
 
@@ -53,7 +57,7 @@
     [Tags]  Verify_Existence_Of_All_Fields_In_Add_Destination
     [Teardown]  Run Keywords  Click Button  ${xpath_cancel_button}  AND
     ...  Wait Until Keyword Succeeds  10 sec  5 sec
-    ...  Refresh GUI And Verify Element Value  ${xpath_snmp_alerts_heading}  SNMP Alerts
+    ...  Refresh GUI And Verify Element Value  ${xpath_snmp_alerts_heading}  ${snmp_page_heading}
 
     Click Element  ${xpath_add_destination}
     Wait Until Page Contains Element  ${xpath_snmp_alert_destination_heading}
@@ -107,11 +111,11 @@
     [Template]  Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify
 
     # snmp_manager_ip   snmp_manager_port        Expected status
-    ${SNMP_MGR1_IP}     ${out_of_range_port}     Value must be between 0 – 65535
-    ${SNMP_MGR1_IP}     ${alpha_port}            Value must be between 0 – 65535
-    ${SNMP_MGR1_IP}     ${negative_port}         Value must be between 0 – 65535
-    ${out_of_range_ip}  ${NON_DEFAULT_PORT1}     Invalid format
-    ${alpha_ip}         ${NON_DEFAULT_PORT1}     Invalid format
+    ${SNMP_MGR1_IP}     ${out_of_range_port}     ${invalid_port_error}
+    ${SNMP_MGR1_IP}     ${alpha_port}            ${invalid_port_error}
+    ${SNMP_MGR1_IP}     ${negative_port}         ${invalid_port_error}
+    ${out_of_range_ip}  ${NON_DEFAULT_PORT1}     ${invalid_destination_error}
+    ${alpha_ip}         ${NON_DEFAULT_PORT1}     ${invalid_destination_error}
 
 
 Configure Multiple SNMP Managers On BMC Via GUI And Verify
@@ -162,7 +166,7 @@
     Reboot BMC via GUI
 
     Suite Setup Execution
-    Wait Until Page Contains  SNMP Alerts  timeout=1min
+    Wait Until Page Contains  ${snmp_page_heading}  timeout=1min
 
     Verify SNMP Manager Configured On BMC  ${SNMP_MGR1_IP}  ${SNMP_DEFAULT_PORT}
     Verify SNMP Manager Configured On BMC  ${SNMP_MGR2_IP}  ${SNMP_DEFAULT_PORT}
@@ -211,14 +215,15 @@
     Click Element  ${xpath_delete_destination}
     Wait Until Page Contains  Successfully deleted SNMP alert destination  timeout=45s
     Wait Until Keyword Succeeds  30 sec  10 sec  Refresh GUI And Verify Element Value
-    ...  ${xpath_snmp_alerts_heading}  SNMP Alerts
+    ...  ${xpath_snmp_alerts_heading}  ${snmp_page_heading}
 
 
 Configure SNMP Manager On BMC With Invalid Setting Via GUI And Verify
 
     [Documentation]  Configure SNMP manager on BMC with invalid setting via GUI and verify.
     [Arguments]  ${snmp_manager_ip}  ${snmp_manager_port}  ${expected_error}
-    [Teardown]  Click Element  ${xpath_cancel_button}
+    [Teardown]  Run Keyword If  '${expected_error}' == '${invalid_port_error}'
+    ...  Click Element  ${xpath_cancel_button}
 
     # Description of argument(s):
     # snmp_manager_ip     SNMP manager IP address.