Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "User management" sub-menu of "Security and access". |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 6 | |
| 7 | Suite Setup Launch Browser And Login GUI |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 8 | Suite Teardown Suite Teardown Execution |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 9 | Test Setup Test Setup Execution |
| 10 | |
George Keishing | 0302e9a | 2023-10-12 21:48:35 +0530 | [diff] [blame] | 11 | Force Tags User_Management_Sub_Menu |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 12 | |
| 13 | *** Variables *** |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 14 | |
| 15 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 16 | ${xpath_user_management_heading} //h1[text()="User management"] |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 17 | ${xpath_select_user} //input[contains(@class,"custom-control-input")] |
| 18 | ${xpath_account_policy} //button[contains(text(),'Account policy settings')] |
| 19 | ${xpath_add_user} //button[contains(text(),'Add user')] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 20 | ${xpath_edit_user} //*[@data-test-id='userManagement-tableRowAction-edit-0'] |
| 21 | ${xpath_delete_user} //*[@data-test-id='userManagement-tableRowAction-delete-1'] |
| 22 | ${xpath_account_status_enabled_button} //*[@data-test-id='userManagement-radioButton-statusEnabled'] |
| 23 | ${xpath_account_status_disabled_button} //*[@data-test-id='userManagement-radioButton-statusDisabled'] |
| 24 | ${xpath_username_input_button} //*[@data-test-id='userManagement-input-username'] |
| 25 | ${xpath_privilege_list_button} //*[@data-test-id='userManagement-select-privilege'] |
| 26 | ${xpath_password_input_button} //*[@data-test-id='userManagement-input-password'] |
| 27 | ${xpath_password_confirm_button} //*[@data-test-id='userManagement-input-passwordConfirmation'] |
| 28 | ${xpath_cancel_button} //*[@data-test-id='userManagement-button-cancel'] |
| 29 | ${xpath_submit_button} //*[@data-test-id='userManagement-button-submit'] |
Nandish-Matti | 6e82f98 | 2023-10-19 01:03:08 -0500 | [diff] [blame] | 30 | ${xpath_delete_button} //button[text()='Delete user'] |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 31 | ${xpath_add_user_heading} //h5[contains(text(),'Add user')] |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 32 | ${xpath_policy_settings_header} //*[text()="Account policy settings"] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 33 | ${xpath_auto_unlock} //*[@data-test-id='userManagement-radio-automaticUnlock'] |
| 34 | ${xpath_manual_unlock} //*[@data-test-id='userManagement-radio-manualUnlock'] |
| 35 | ${xpath_max_failed_login} //*[@data-test-id='userManagement-input-lockoutThreshold'] |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 36 | ${test_user_password} TestPwd1 |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 37 | ${xpath_user_creation_error_message} //*[contains(text(),'Error creating user')] |
| 38 | ${xpath_close_error_message} //*/*[contains(text(),'Error')]/following-sibling::button |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 39 | @{username} admin_user readonly_user disabled_user |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 40 | @{list_user_privilege} Administrator ReadOnly |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 41 | |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 42 | |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 43 | *** Test Cases *** |
| 44 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 45 | Verify Navigation To User Management Page |
| 46 | [Documentation] Verify navigation to user management page. |
| 47 | [Tags] Verify_Navigation_To_User_Management_Page |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 48 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 49 | Page Should Contain Element ${xpath_user_management_heading} |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 50 | |
| 51 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 52 | Verify Existence Of All Sections In User Management Page |
| 53 | [Documentation] Verify existence of all sections in user management page. |
| 54 | [Tags] Verify_Existence_Of_All_Sections_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 55 | |
| 56 | Page should contain View privilege role descriptions |
| 57 | |
| 58 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 59 | Verify Existence Of All Input Boxes In User Management Page |
| 60 | [Documentation] Verify existence of all sections in user managemnet page. |
| 61 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 62 | |
| 63 | Page Should Contain Checkbox ${xpath_select_user} |
| 64 | |
| 65 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 66 | Verify Existence Of All Buttons In User Management Page |
| 67 | [Documentation] Verify existence of all buttons in user management page. |
| 68 | [Tags] Verify_Existence_Of_All_Buttons_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 69 | |
| 70 | Page should contain Button ${xpath_account_policy} |
| 71 | Page should contain Button ${xpath_add_user} |
manashsarma | 90d91fa | 2021-04-08 07:07:16 -0500 | [diff] [blame] | 72 | Page Should Contain Element ${xpath_edit_user} |
| 73 | Page Should Contain Element ${xpath_delete_user} |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 74 | |
| 75 | |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 76 | Verify Existence Of All Button And Fields In Add User |
| 77 | [Documentation] Verify existence of all buttons and fields in add user page. |
| 78 | [Tags] Verify_Existence_Of_All_Button_And_Fields_In_Add_User |
manashsarma | 9d67d26 | 2020-10-15 11:20:48 -0500 | [diff] [blame] | 79 | [Teardown] Click Element ${xpath_cancel_button} |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 80 | |
| 81 | Click Element ${xpath_add_user} |
| 82 | Wait Until Page Contains Element ${xpath_add_user_heading} |
| 83 | Page Should Contain Element ${xpath_account_status_enabled_button} |
| 84 | Page Should Contain Element ${xpath_account_status_disabled_button} |
| 85 | Page Should Contain Element ${xpath_username_input_button} |
| 86 | Page Should Contain Element ${xpath_privilege_list_button} |
| 87 | Page Should Contain Element ${xpath_password_input_button} |
| 88 | Page Should Contain Element ${xpath_password_confirm_button} |
| 89 | Page Should Contain Element ${xpath_cancel_button} |
| 90 | Page Should Contain Element ${xpath_submit_button} |
| 91 | |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 92 | |
| 93 | Verify Existence Of All Buttons And Fields In Account Policy Settings |
| 94 | [Documentation] Verify existence of all buttons and fields in account policy settings page. |
| 95 | [Tags] Verify_Existence_Of_All_Buttons_And_Fields_In_Account_Policy_Settings |
manashsarma | 5c4a7d1 | 2020-10-21 05:21:37 -0500 | [diff] [blame] | 96 | [Teardown] Click Element ${xpath_cancel_button} |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 97 | |
| 98 | Click Element ${xpath_account_policy} |
manashsarma | 5c4a7d1 | 2020-10-21 05:21:37 -0500 | [diff] [blame] | 99 | Wait Until Page Contains Element ${xpath_policy_settings_header} |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 100 | Page Should Contain Element ${xpath_auto_unlock} |
| 101 | Page Should Contain Element ${xpath_manual_unlock} |
| 102 | Page Should Contain Element ${xpath_max_failed_login} |
| 103 | Page Should Contain Element ${xpath_submit_button} |
| 104 | Page Should Contain Element ${xpath_cancel_button} |
| 105 | |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 106 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 107 | Verify User Access Privilege |
George Keishing | 4d4ef99 | 2021-01-28 09:56:53 -0600 | [diff] [blame] | 108 | [Documentation] Create a new user with a privilege and verify that user is created. |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 109 | [Tags] Verify_User_Access_Privilege |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 110 | [Teardown] Delete Users Via Redfish @{username} |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 111 | [Template] Create User And Verify |
| 112 | |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 113 | # username privilege_level enabled |
| 114 | ${username}[0] Administrator ${True} |
| 115 | ${username}[1] ReadOnly ${True} |
| 116 | ${username}[2] Administrator ${False} |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 117 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 118 | |
Wilson Suen | 70523a9 | 2023-12-28 17:49:02 -0800 | [diff] [blame^] | 119 | Verify Operator User Privilege |
rramyasr-in | c4a5c34 | 2023-01-02 01:38:50 -0600 | [diff] [blame] | 120 | [Documentation] Create users with different access privilege |
| 121 | ... and verify that the user is getting created. |
Wilson Suen | 70523a9 | 2023-12-28 17:49:02 -0800 | [diff] [blame^] | 122 | [Tags] Verify_Operator_User_Privilege |
rramyasr-in | c4a5c34 | 2023-01-02 01:38:50 -0600 | [diff] [blame] | 123 | [Template] Create User And Verify |
| 124 | |
| 125 | # username privilege_level enabled |
| 126 | operator_user Operator ${True} |
rramyasr-in | c4a5c34 | 2023-01-02 01:38:50 -0600 | [diff] [blame] | 127 | |
| 128 | |
manashsarma | 165f527 | 2021-08-04 07:37:01 -0500 | [diff] [blame] | 129 | Verify User Account And Properties Saved Through Reboots |
| 130 | [Documentation] Verify that user account and properties saved through reboots. |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 131 | [Teardown] Delete Users Via Redfish my_admin_user |
manashsarma | 165f527 | 2021-08-04 07:37:01 -0500 | [diff] [blame] | 132 | [Tags] Verify_User_Account_And_Properties_Saved_Through_Reboots |
| 133 | |
| 134 | # Create an User account. |
| 135 | Create User And Verify my_admin_user Administrator ${True} |
| 136 | |
| 137 | # Reboot BMC. |
| 138 | Redfish OBMC Reboot (off) stack_mode=normal |
| 139 | |
| 140 | Click Element ${xpath_refresh_button} |
| 141 | Wait Until Page Contains my_admin_user timeout=15 |
| 142 | |
| 143 | |
Nandish-Matti | 6e82f98 | 2023-10-19 01:03:08 -0500 | [diff] [blame] | 144 | Delete User Account Via GUI |
| 145 | [Documentation] Delete user account via GUI. |
| 146 | [Tags] Delete_User_Account_Via_GUI |
| 147 | |
| 148 | # Create new user account via GUI. |
| 149 | Create User And Verify ${username}[0] Administrator ${True} |
| 150 | |
| 151 | # Delete the user created via GUI. |
| 152 | Delete Users Via GUI ${username}[0] |
| 153 | |
| 154 | |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 155 | Verify Error While Creating Users With Same Name |
| 156 | [Documentation] Verify proper error message while creating two user accounts with same username. |
| 157 | [Tags] Verify_Error_While_Creating_Users_With_Same_Name |
| 158 | [Teardown] Delete Users Via Redfish ${username} |
| 159 | |
| 160 | # Get random username and user privilege level. |
| 161 | ${username}= Generate Random String 8 [LETTERS] |
| 162 | ${privilege_level}= Evaluate random.choice(${list_user_privilege}) random |
| 163 | |
| 164 | # Create new user account. |
| 165 | Create User And Verify ${username} ${privilege_level} ${True} |
| 166 | |
| 167 | # Expect failure while creating second user account with same username. |
| 168 | Create User And Verify ${username} ${privilege_level} ${True} Failure |
| 169 | |
| 170 | |
Nandish-Matti | d0c0b81 | 2023-11-08 02:55:08 -0600 | [diff] [blame] | 171 | Test Modifying User Privilege Of Existing User Via GUI |
| 172 | [Documentation] Modify user privilege of existing user via GUI and verify the changes using Redfish. |
| 173 | [Tags] Test_Modifying_User_Privilege_Of_Existing_User_Via_GUI |
| 174 | [Teardown] Delete Users Via Redfish ${username} |
| 175 | |
| 176 | # Get random username and user privilege level. |
| 177 | ${username}= Generate Random String 8 [LETTERS] |
Nandish-Matti | 0148f20 | 2023-11-14 00:00:58 -0600 | [diff] [blame] | 178 | ${privilege_level}= Evaluate random.choice(${list_user_privilege}) random |
Nandish-Matti | d0c0b81 | 2023-11-08 02:55:08 -0600 | [diff] [blame] | 179 | |
| 180 | # Create new user account. |
| 181 | Create User And Verify ${username} ${privilege_level} ${True} |
| 182 | |
| 183 | # Get user privilege role details distinct from the current ones. |
Nandish-Matti | 098b72f | 2023-11-20 22:51:38 -0600 | [diff] [blame] | 184 | FOR ${privilege} IN @{list_user_privilege} |
Nandish-Matti | d0c0b81 | 2023-11-08 02:55:08 -0600 | [diff] [blame] | 185 | IF '${privilege}' != '${privilege_level}' |
| 186 | ${modify_privilege}= Set Variable ${privilege} |
| 187 | END |
| 188 | END |
| 189 | |
| 190 | # Modify user privilege via GUI. |
| 191 | Wait Until Keyword Succeeds 30 sec 5 sec Click Element |
| 192 | ... //td[text()='${username}']/following-sibling::*/*/*[@title='Edit user'] |
| 193 | Select From List by Value ${xpath_privilege_list_button} ${modify_privilege} |
| 194 | |
| 195 | # Submit changes. |
| 196 | Click Element ${xpath_submit_button} |
| 197 | |
| 198 | # Confirm the successful update. |
| 199 | Wait Until Element Is Visible ${xpath_success_message} timeout=30 |
| 200 | Wait Until Element Is Not Visible ${xpath_success_message} timeout=30 |
| 201 | |
| 202 | # Verify user privilege via Redfish. |
| 203 | Redfish.Login |
| 204 | ${resp}= Redfish.Get /redfish/v1/AccountService/Accounts/${username} |
| 205 | Should Be Equal ${resp.dict["RoleId"]} ${modify_privilege} |
| 206 | Redfish.Logout |
| 207 | |
| 208 | |
Nandish-Matti | 304dea2 | 2023-11-09 23:55:42 -0600 | [diff] [blame] | 209 | Test Modifying User Account Status Of Existing User Via GUI |
| 210 | [Documentation] Test modifying user account status of existing user via GUI and verify changes using Redfish. |
| 211 | [Tags] Test_Modifying_User_Account_Status_Of_Existing_User_Via_GUI |
| 212 | [Teardown] Delete Users Via Redfish ${username} |
| 213 | |
| 214 | # Get random username, user privilege level and account status. |
| 215 | ${username}= Generate Random String 8 [LETTERS] |
Nandish-Matti | 098b72f | 2023-11-20 22:51:38 -0600 | [diff] [blame] | 216 | ${privilege_level}= Evaluate random.choice(${list_user_privilege}) random |
Nandish-Matti | 304dea2 | 2023-11-09 23:55:42 -0600 | [diff] [blame] | 217 | ${initial_account_status}= Evaluate random.choice([True, False]) random |
| 218 | |
| 219 | # Create new user account. |
| 220 | Create User And Verify ${username} ${privilege_level} ${initial_account_status} |
| 221 | |
| 222 | # Modify user account status via GUI. |
| 223 | Wait Until Keyword Succeeds 30 sec 5 sec Click Element |
| 224 | ... //td[text()='${username}']/following-sibling::*/*/*[@title='Edit user'] |
| 225 | Wait Until Element Is Visible ${xpath_submit_button} timeout=30 |
| 226 | |
| 227 | # Switch the user account status to its opposite state. |
| 228 | IF ${initial_account_status} == ${True} |
| 229 | Click Element At Coordinates ${xpath_account_status_disabled_button} 0 0 |
| 230 | ELSE |
| 231 | Click Element At Coordinates ${xpath_account_status_enabled_button} 0 0 |
| 232 | END |
| 233 | |
| 234 | # Submit changes. |
| 235 | Click Element ${xpath_submit_button} |
| 236 | |
| 237 | # Confirm the successful update. |
| 238 | Wait Until Element Is Visible ${xpath_success_message} timeout=30 |
| 239 | Wait Until Element Is Not Visible ${xpath_success_message} timeout=60 |
| 240 | |
| 241 | # Verify account status via Redfish. |
| 242 | IF ${initial_account_status} == ${True} |
| 243 | ${status}= Run Keyword And Return Status Redfish.Login ${username} ${test_user_password} |
| 244 | Should Be Equal ${status} ${False} |
| 245 | ELSE |
| 246 | ${status}= Run Keyword And Return Status Redfish.Login ${username} ${test_user_password} |
| 247 | Should Be Equal ${status} ${True} |
| 248 | END |
| 249 | |
| 250 | |
Nandish-Matti | f5060a0 | 2023-11-24 00:28:09 -0600 | [diff] [blame] | 251 | Test Modifying User Password Of Existing User Via GUI |
| 252 | [Documentation] Modify user password of existing user via GUI and verify changes using Redfish. |
| 253 | [Tags] Test_Modifying_User_Password_Of_Existing_User_Via_GUI |
| 254 | [Teardown] Delete Users Via Redfish ${username} |
| 255 | |
| 256 | # Get random username, user privilege level and account status. |
| 257 | ${username}= Generate Random String 8 [LETTERS] |
| 258 | ${privilege_level}= Evaluate random.choice(${list_user_privilege}) random |
| 259 | ${initial_account_status}= Evaluate random.choice([True, False]) random |
| 260 | |
| 261 | # Initialize the new password for the account. |
| 262 | ${new_password}= Set Variable Testpassword1 |
| 263 | |
| 264 | # Create new user account. |
| 265 | Create User And Verify ${username} ${privilege_level} ${initial_account_status} |
| 266 | |
| 267 | # Wait for newly created user to appear on the page. |
| 268 | Wait Until Element Is Visible //td[text()='${username}'] |
| 269 | |
| 270 | # Modify user password via GUI. |
| 271 | Click Element //td[text()='${username}']/following-sibling::*/*/*[@title='Edit user'] |
| 272 | Input Text ${xpath_password_input_button} ${new_password} |
| 273 | Input Text ${xpath_password_confirm_button} ${new_password} |
| 274 | |
| 275 | # Submit changes. |
| 276 | Click Element ${xpath_submit_button} |
| 277 | |
| 278 | # Confirm the successful update. |
| 279 | Wait Until Element Is Visible ${xpath_success_message} timeout=30 |
| 280 | Wait Until Element Is Not Visible ${xpath_success_message} timeout=60 |
| 281 | |
| 282 | # Verify changes via Redfish. |
| 283 | ${status}= Run Keyword And Return Status Redfish.Login ${username} ${new_password} |
| 284 | Should Be Equal ${status} ${True} |
| 285 | |
| 286 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 287 | *** Keywords *** |
| 288 | |
| 289 | Create User And Verify |
| 290 | [Documentation] Create a user with given user name and privilege and verify that the |
| 291 | ... user is created successfully via GUI and Redfish. |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 292 | [Arguments] ${user_name} ${user_privilege} ${enabled} ${expected_status}=Success |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 293 | |
| 294 | # Description of argument(s): |
| 295 | # user_name The name of the user to be created (e.g. "test", "robert", etc.). |
| 296 | # user_privilege Privilege of the user. |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 297 | # enabled If the user is enabled (e.g True if enabled, False if disabled). |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 298 | # expected_status Expected status of user creation (e.g. Success, Failure). |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 299 | |
| 300 | Click Element ${xpath_add_user} |
| 301 | Wait Until Page Contains Element ${xpath_add_user_heading} |
| 302 | |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 303 | # Select disabled radio button if user needs to be disabled |
| 304 | Run Keyword If ${enabled} == ${False} |
manashsarma | cb646cc | 2020-11-17 03:59:04 -0600 | [diff] [blame] | 305 | ... Click Element At Coordinates ${xpath_account_status_disabled_button} 0 0 |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 306 | |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 307 | # Input username, password and privilege. |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 308 | Input Text ${xpath_username_input_button} ${user_name} |
| 309 | Select From List by Value ${xpath_privilege_list_button} ${user_privilege} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 310 | |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 311 | Input Text ${xpath_password_input_button} ${test_user_password} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 312 | |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 313 | Input Text ${xpath_password_confirm_button} ${test_user_password} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 314 | |
| 315 | # Submit. |
| 316 | Click Element ${xpath_submit_button} |
| 317 | |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 318 | # Proceed with future steps based on the expected execution status. |
| 319 | IF '${expected_status}' == 'Success' |
| 320 | Wait Until Element Is Visible ${xpath_success_message} timeout=30 |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 321 | |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 322 | # Refresh page and check new user is available. |
| 323 | Wait Until Page Contains Element ${xpath_add_user} |
| 324 | Click Element ${xpath_refresh_button} |
| 325 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |
| 326 | Wait Until Page Contains ${user_name} timeout=15 |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 327 | |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 328 | # Cross check the privilege of newly added user via Redfish. |
| 329 | Redfish.Login |
| 330 | ${user_priv_redfish}= Redfish_Utils.Get Attribute |
| 331 | ... /redfish/v1/AccountService/Accounts/${user_name} RoleId |
| 332 | Should Be Equal ${user_privilege} ${user_priv_redfish} |
| 333 | Redfish.Logout |
| 334 | |
| 335 | # Check enable/disable status for user. |
| 336 | ${status}= Run Keyword And Return Status Redfish.Login ${user_name} ${test_user_password} |
| 337 | Run Keyword If ${enabled} == ${False} |
| 338 | ... Should Be Equal ${status} ${False} |
| 339 | ... ELSE Should Be Equal ${status} ${True} |
| 340 | Redfish.Logout |
| 341 | |
| 342 | ELSE IF '${expected_status}' == 'Failure' |
| 343 | Wait Until Element Is Visible ${xpath_user_creation_error_message} timeout=60 |
George Keishing | c55a899 | 2023-11-13 12:03:43 +0530 | [diff] [blame] | 344 | |
Nandish-Matti | 2d6c904 | 2023-11-03 01:04:15 -0500 | [diff] [blame] | 345 | # Close error message popup. |
| 346 | Click Element ${xpath_close_error_message} |
| 347 | Wait Until Element Is Not Visible ${xpath_user_creation_error_message} timeout=60 |
| 348 | END |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 349 | |
| 350 | |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 351 | Test Setup Execution |
| 352 | [Documentation] Do test case setup tasks. |
| 353 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 354 | # Navigate to https://xx.xx.xx.xx/#/access-control/user-management user management page. |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 355 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 356 | Click Element ${xpath_secuity_and_accesss_menu} |
| 357 | Click Element ${xpath_user_management_sub_menu} |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 358 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain user-management |
| 359 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 360 | |
| 361 | |
| 362 | Delete Users Via Redfish |
| 363 | [Documentation] Delete given users using Redfish. |
| 364 | [Arguments] @{user_list} |
| 365 | # Description of argument(s): |
| 366 | # user_list List of user name to be deleted. |
| 367 | |
| 368 | FOR ${user} IN @{user_list} |
| 369 | Redfish.Login |
| 370 | Redfish.Delete /redfish/v1/AccountService/Accounts/${user} |
| 371 | Redfish.Logout |
| 372 | END |
| 373 | |
| 374 | |
Nandish-Matti | 6e82f98 | 2023-10-19 01:03:08 -0500 | [diff] [blame] | 375 | Delete Users Via GUI |
| 376 | [Documentation] Delete given users via GUI. |
| 377 | [Arguments] @{user_list} |
| 378 | # Description of argument(s): |
| 379 | # user_list List of user name to be deleted. |
| 380 | |
| 381 | FOR ${user} IN @{user_list} |
| 382 | Wait Until Keyword Succeeds 30 sec 5 sec Click Element |
| 383 | ... //td[text()='${user}']/following-sibling::*/*/*[@title='Delete user'] |
| 384 | Wait Until Keyword Succeeds 30 sec 5 sec Click Element ${xpath_delete_button} |
| 385 | Wait Until Element Is Visible ${xpath_success_message} timeout=30 |
| 386 | Wait Until Element Is Not Visible ${xpath_success_message} timeout=60 |
| 387 | END |
| 388 | |
| 389 | |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 390 | Suite Teardown Execution |
| 391 | [Documentation] Do suite teardown tasks. |
| 392 | |
George Keishing | 7f321ac | 2023-10-13 19:38:44 +0530 | [diff] [blame] | 393 | Run Keyword And Ignore Error Logout GUI |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 394 | Close Browser |
| 395 | Redfish.Logout |