blob: 8bc9ee2556a93d1c0a0a29f24f39c6863e4f8211 [file] [log] [blame]
Sushma M Mef474f42020-07-29 16:25:39 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "LDAP" sub-menu of "Access control".
4
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
Sushma M Mef474f42020-07-29 16:25:39 -05006
7Suite Setup Launch Browser And Login GUI
8Suite Teardown Close Browser
9Test Setup Test Setup Execution
10
11
12*** Variables ***
13
Sushma M M26302992020-08-31 01:15:26 -050014${xpath_ldap_heading} //h1[text()="LDAP"]
Rahul Maheshwari062dceb2021-01-19 04:16:30 -060015${xpath_enable_ldap_checkbox} //*[@data-test-id='ldap-checkbox-ldapAuthenticationEnabled']
16${xpath_secure_ldap_checkbox} //*[@data-test-id='ldap-checkbox-secureLdapEnabled']
Sushma M Mef474f42020-07-29 16:25:39 -050017${xpath_service_radio_button} //*[@data-test-id="ldap-radio-activeDirectoryEnabled"]
18${xpath_add_role_group_button} //button[contains(text(),'Add role group')]
Anves Kumar rayankula47892a22021-03-26 03:57:02 -050019${xpath_ldap_url} //*[@data-test-id='ldap-input-serverUri']
20${xpath_ldap_bind_dn} //*[@data-test-id='ldap-input-bindDn']
21${xpath_ldap_password} //*[@id='bind-password']
22${xpath_ldap_base_dn} //*[@data-test-id='ldap-input-baseDn']
23${xpath_ldap_save_settings} //*[@data-test-id='ldap-button-saveSettings']
24${xpath_select_refresh_button} //*[text()[contains(.,"Refresh")]]
Rahul Maheshwari062dceb2021-01-19 04:16:30 -060025
Sushma M Mef474f42020-07-29 16:25:39 -050026*** Test Cases ***
27
Sushma M M26302992020-08-31 01:15:26 -050028Verify Navigation To LDAP Page
29 [Documentation] Verify navigation to LDAP page.
30 [Tags] Verify_Navigation_To_LDAP_Page
31
32 Page Should Contain Element ${xpath_ldap_heading}
33
34
Sushma M Mef474f42020-07-29 16:25:39 -050035Verify Existence Of All Sections In LDAP Page
36 [Documentation] Verify existence of all sections in LDAP page.
37 [Tags] Verify_Existence_Of_All_Sections_In_LDAP_Page
38
39 Page Should Contain Settings
40 Page Should Contain Role groups
41
42
43Verify Existence Of All Buttons In LDAP Page
44 [Documentation] Verify existence of all buttons in LDAP page.
45 [Tags] Verify_Existence_Of_All_Buttons_In_LDAP_Page
46
47 # Buttons under settings section.
48 Page Should Contain Element ${xpath_service_radio_button}
49 Page Should Contain Element ${xpath_save_settings_button}
50
51 # Buttons under role groups section.
52 Page Should Contain Element ${xpath_add_role_group_button}
53
54
55Verify Existence Of All Checkboxes In LDAP Page
56 [Documentation] Verify existence of all checkboxes in LDAP page.
57 [Tags] Verify_Existence_Of_All_Checkboxes_In_LDAP_Page
58
59 # Checkboxes under settings section.
60 Page Should Contain Element ${xpath_enable_ldap_checkbox}
61 Page Should Contain Element ${xpath_secure_ldap_checkbox}
62
63
Anves Kumar rayankula47892a22021-03-26 03:57:02 -050064Verify Create LDAP Configuration
65 [Documentation] Verify created LDAP configuration.
66 [Tags] Verify_Created_LDAP_Configuration
67
68 Create LDAP Configuration
69 Get LDAP Configuration ${LDAP_TYPE}
70 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
71 Redfish.Logout
72 Redfish.Login
73
Sushma M Mef474f42020-07-29 16:25:39 -050074*** Keywords ***
75
76Test Setup Execution
77 [Documentation] Do test case setup tasks.
78
79 # Navigate to https://xx.xx.xx.xx/#/access-control/ldap LDAP page.
80
81 Click Element ${xpath_access_control_menu}
82 Click Element ${xpath_ldap_sub_menu}
83 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain ldap
Anves Kumar rayankula47892a22021-03-26 03:57:02 -050084
85
86Create LDAP Configuration
87 [Documentation] Create LDAP configuration.
88 [Arguments] ${ldap_server_uri}=${LDAP_SERVER_URI} ${ldap_servicetype}=${LDAP_TYPE}
89 ... ${ldap_bind_dn}=${LDAP_BIND_DN} ${ldap_bind_dn_password}=${LDAP_BIND_DN_PASSWORD}
90 ... ${ldap_base_dn}=${LDAP_BASE_DN}
91
92 # Description of argument(s):
93 # ldap_server_uri LDAP server uri (e.g. ldap://XX.XX.XX.XX).
94 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
95 # ldap_bind_dn The LDAP bind distinguished name.
96 # ldap_bind_dn_password The LDAP bind distinguished name password.
97 # ldap_base_dn The LDAP base distinguished name.
98
99 Select Checkbox ${xpath_enable_ldap_checkbox}
100 Checkbox Should Be Selected ${xpath_enable_ldap_checkbox}
101 ${radio_buttons}= Get WebElements ${xpath_service_radio_button}
102
103 Run Keyword If '${ldap_service_type}' == 'OpenLDAP'
104 ... Click Element At Coordinates ${radio_buttons}[${0}] 0 0
105 ... ELSE Click Element At Coordinates ${radio_buttons}[${1}] 0 0
106
107 Wait Until Page Contains Element ${xpath_ldap_url}
108 Input Text ${xpath_ldap_url} ${ldap_server_uri}
109 Input Text ${xpath_ldap_bind_dn} ${ldap_bind_dn}
110 Input Text ${xpath_ldap_password} ${ldap_bind_dn_password}
111 Input Text ${xpath_ldap_base_dn} ${ldap_base_dn}
112 Click Element ${xpath_ldap_save_settings}
113
114 Run Keyword If '${ldap_service_type}'=='OpenLDAP'
115 ... Wait Until Page Contains Successfully saved Open LDAP settings
116 ... ELSE
117 ... Wait Until Page Contains Successfully saved Active Directory settings
118
119 Click Element ${xpath_refresh_button}
120 Wait Until Page Contains Element ${xpath_ldap_heading}
121
122
123Get LDAP Configuration
124 [Documentation] Retrieve LDAP Configuration.
125 [Arguments] ${ldap_type}
126
127 # Description of argument(s):
128 # ldap_type The LDAP type ("ActiveDirectory" or "OpenLDAP").
129
130 ${radio_buttons}= Get WebElements ${xpath_service_radio_button}
131
132 ${status}= Run Keyword And Return Status
133 ... Run Keyword If '${ldap_type}'=='OpenLDAP'
134 ... Checkbox Should Be Selected ${radio_buttons}[${0}]
135 ... ELSE
136 ... Checkbox Should Be Selected ${radio_buttons}[${1}]
137 Should Be Equal ${status} ${True}