Added test suite for GUI LDAP testing

Change-Id: I368461904412fa57d46bd29267492df58db4446a
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/gui/data/resource_variables.py b/gui/data/resource_variables.py
index e35e9b5..ab46cec 100644
--- a/gui/data/resource_variables.py
+++ b/gui/data/resource_variables.py
@@ -59,6 +59,7 @@
     # xpath for main menu.
     xpath_select_server_control = "//button[contains(@class,'btn-control')]"
     xpath_select_server_configuration = "//button[contains(@class,'btn-config')]"
+    xpath_select_access_control = "//button[contains(@class,'btn-access-control')]"
 
     # xpath for sub main menu.
     xpath_select_server_power_operations = "//a[@href='#/server-control/power-operations']"
diff --git a/gui/test/access_control/test_obmc_gui_ldap.robot b/gui/test/access_control/test_obmc_gui_ldap.robot
new file mode 100644
index 0000000..4239824
--- /dev/null
+++ b/gui/test/access_control/test_obmc_gui_ldap.robot
@@ -0,0 +1,66 @@
+*** Settings ***
+
+Documentation  Test OpenBMC GUI "LDAP" sub-menu of "Access control".
+
+Resource        ../../lib/resource.robot
+
+Suite Setup     Launch Browser And Login OpenBMC GUI
+Suite Teardown  Close Browser
+Test Setup      Test Setup Execution
+
+
+*** Variables ***
+
+${xpath_enable_ldap_checkbox}           //*[@id='ldap-auth-label']
+${xpath_secure_ldap_checkbox}           //*[@id='use-ssl']
+${xpath_openl_ldap_radio_button}        //input[@id='open-ldap']
+${xpath_active_directory_radio_button}  //input[@id='active-directory']
+${xpath_save_button}                    //button[contains(text(),'Save')]
+${xpath_reset_button}                   //button[contains(text(),'Reset')]
+${xpath_add_role_group_button}          //button[@type='button']//*[contains(text(),'Add role group')]
+${xpath_remove_role_groups_button}      //button[@type='button']//*[contains(text(),'Remove role groups')]
+
+*** Test Cases ***
+
+Verify Existence Of All Sections In LDAP Page
+    [Documentation]  Verify existence of all sections in LDAP page.
+    [Tags]  Verify_Existence_Of_All_Sections_In_LDAP_Page
+
+    Page Should Contain  Settings
+    Page Should Contain  Role groups
+
+
+Verify Existence Of All Buttons In LDAP Page
+    [Documentation]  Verify existence of all buttons in LDAP page.
+    [Tags]  Verify_Existence_Of_All_Buttons_In_LDAP_Page
+
+    # Buttons under settings section
+    Page Should Contain Element  ${xpath_openl_ldap_radio_button}
+    Page Should Contain Element  ${xpath_active_directory_radio_button}
+    Page Should Contain Element  ${xpath_save_button}
+    Page Should Contain Element  ${xpath_reset_button}
+
+    # Buttons under role groups section
+    Page Should Contain Element  ${xpath_add_role_group_button}
+    Page Should Contain Element  ${xpath_remove_role_groups_button}
+
+
+Verify Existence Of All Checkboxes In LDAP Page
+    [Documentation]  Verify existence of all checkboxes in LDAP page.
+    [Tags]  Verify_Existence_Of_All_Checkboxes_In_LDAP_Page
+
+    # Checkboxes under settings section
+    Page Should Contain Element  ${xpath_enable_ldap_checkbox}
+    Page Should Contain Element  ${xpath_secure_ldap_checkbox}
+
+
+*** Keywords ***
+
+Test Setup Execution
+    [Documentation]  Do test case setup tasks.
+
+    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
+    Click Element  ${xpath_select_access_control}
+    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
+    Click Element  ${xpath_select_ldap}
+    Wait Until Page Contains  Configure LDAP settings and manage role groups