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 |
| 8 | Suite Teardown Close Browser |
| 9 | Test Setup Test Setup Execution |
| 10 | |
| 11 | |
| 12 | *** Variables *** |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 13 | |
| 14 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 15 | ${xpath_user_management_heading} //h1[text()="User management"] |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 16 | ${xpath_select_user} //input[contains(@class,"custom-control-input")] |
| 17 | ${xpath_account_policy} //button[contains(text(),'Account policy settings')] |
| 18 | ${xpath_add_user} //button[contains(text(),'Add user')] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 19 | ${xpath_edit_user} //*[@data-test-id='userManagement-tableRowAction-edit-0'] |
| 20 | ${xpath_delete_user} //*[@data-test-id='userManagement-tableRowAction-delete-1'] |
| 21 | ${xpath_account_status_enabled_button} //*[@data-test-id='userManagement-radioButton-statusEnabled'] |
| 22 | ${xpath_account_status_disabled_button} //*[@data-test-id='userManagement-radioButton-statusDisabled'] |
| 23 | ${xpath_username_input_button} //*[@data-test-id='userManagement-input-username'] |
| 24 | ${xpath_privilege_list_button} //*[@data-test-id='userManagement-select-privilege'] |
| 25 | ${xpath_password_input_button} //*[@data-test-id='userManagement-input-password'] |
| 26 | ${xpath_password_confirm_button} //*[@data-test-id='userManagement-input-passwordConfirmation'] |
| 27 | ${xpath_cancel_button} //*[@data-test-id='userManagement-button-cancel'] |
| 28 | ${xpath_submit_button} //*[@data-test-id='userManagement-button-submit'] |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 29 | ${xpath_add_user_heading} //h5[contains(text(),'Add user')] |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 30 | ${xpath_policy_settings_header} //*[text()="Account policy settings"] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 31 | ${xpath_auto_unlock} //*[@data-test-id='userManagement-radio-automaticUnlock'] |
| 32 | ${xpath_manual_unlock} //*[@data-test-id='userManagement-radio-manualUnlock'] |
| 33 | ${xpath_max_failed_login} //*[@data-test-id='userManagement-input-lockoutThreshold'] |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 34 | ${test_user_password} TestPwd1 |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 35 | |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 36 | |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 37 | *** Test Cases *** |
| 38 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 39 | Verify Navigation To User Management Page |
| 40 | [Documentation] Verify navigation to user management page. |
| 41 | [Tags] Verify_Navigation_To_User_Management_Page |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 42 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 43 | Page Should Contain Element ${xpath_user_management_heading} |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 44 | |
| 45 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 46 | Verify Existence Of All Sections In User Management Page |
| 47 | [Documentation] Verify existence of all sections in user management page. |
| 48 | [Tags] Verify_Existence_Of_All_Sections_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 49 | |
| 50 | Page should contain View privilege role descriptions |
| 51 | |
| 52 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 53 | Verify Existence Of All Input Boxes In User Management Page |
| 54 | [Documentation] Verify existence of all sections in user managemnet page. |
| 55 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 56 | |
| 57 | Page Should Contain Checkbox ${xpath_select_user} |
| 58 | |
| 59 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 60 | Verify Existence Of All Buttons In User Management Page |
| 61 | [Documentation] Verify existence of all buttons in user management page. |
| 62 | [Tags] Verify_Existence_Of_All_Buttons_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 63 | |
| 64 | Page should contain Button ${xpath_account_policy} |
| 65 | Page should contain Button ${xpath_add_user} |
manashsarma | 90d91fa | 2021-04-08 07:07:16 -0500 | [diff] [blame] | 66 | Page Should Contain Element ${xpath_edit_user} |
| 67 | Page Should Contain Element ${xpath_delete_user} |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 68 | |
| 69 | |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 70 | Verify Existence Of All Button And Fields In Add User |
| 71 | [Documentation] Verify existence of all buttons and fields in add user page. |
| 72 | [Tags] Verify_Existence_Of_All_Button_And_Fields_In_Add_User |
manashsarma | 9d67d26 | 2020-10-15 11:20:48 -0500 | [diff] [blame] | 73 | [Teardown] Click Element ${xpath_cancel_button} |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 74 | |
| 75 | Click Element ${xpath_add_user} |
| 76 | Wait Until Page Contains Element ${xpath_add_user_heading} |
| 77 | Page Should Contain Element ${xpath_account_status_enabled_button} |
| 78 | Page Should Contain Element ${xpath_account_status_disabled_button} |
| 79 | Page Should Contain Element ${xpath_username_input_button} |
| 80 | Page Should Contain Element ${xpath_privilege_list_button} |
| 81 | Page Should Contain Element ${xpath_password_input_button} |
| 82 | Page Should Contain Element ${xpath_password_confirm_button} |
| 83 | Page Should Contain Element ${xpath_cancel_button} |
| 84 | Page Should Contain Element ${xpath_submit_button} |
| 85 | |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 86 | |
| 87 | Verify Existence Of All Buttons And Fields In Account Policy Settings |
| 88 | [Documentation] Verify existence of all buttons and fields in account policy settings page. |
| 89 | [Tags] Verify_Existence_Of_All_Buttons_And_Fields_In_Account_Policy_Settings |
manashsarma | 5c4a7d1 | 2020-10-21 05:21:37 -0500 | [diff] [blame] | 90 | [Teardown] Click Element ${xpath_cancel_button} |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 91 | |
| 92 | Click Element ${xpath_account_policy} |
manashsarma | 5c4a7d1 | 2020-10-21 05:21:37 -0500 | [diff] [blame] | 93 | Wait Until Page Contains Element ${xpath_policy_settings_header} |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 94 | Page Should Contain Element ${xpath_auto_unlock} |
| 95 | Page Should Contain Element ${xpath_manual_unlock} |
| 96 | Page Should Contain Element ${xpath_max_failed_login} |
| 97 | Page Should Contain Element ${xpath_submit_button} |
| 98 | Page Should Contain Element ${xpath_cancel_button} |
| 99 | |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 100 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 101 | Verify User Access Privilege |
George Keishing | 4d4ef99 | 2021-01-28 09:56:53 -0600 | [diff] [blame] | 102 | [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] | 103 | [Tags] Verify_User_Access_Privilege |
| 104 | [Template] Create User And Verify |
| 105 | |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 106 | # username privilege_level enabled |
| 107 | admin_user Administrator ${True} |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 108 | readonly_user ReadOnly ${True} |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 109 | disabled_user Administrator ${False} |
| 110 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 111 | |
rramyasr-in | c4a5c34 | 2023-01-02 01:38:50 -0600 | [diff] [blame] | 112 | Verify Operator And No Access User Privilege |
| 113 | [Documentation] Create users with different access privilege |
| 114 | ... and verify that the user is getting created. |
| 115 | [Tags] Verify_Operator_And_No_Access_User_Privilege |
| 116 | [Template] Create User And Verify |
| 117 | |
| 118 | # username privilege_level enabled |
| 119 | operator_user Operator ${True} |
| 120 | noaccess_user NoAccess ${True} |
| 121 | |
| 122 | |
manashsarma | 165f527 | 2021-08-04 07:37:01 -0500 | [diff] [blame] | 123 | Verify User Account And Properties Saved Through Reboots |
| 124 | [Documentation] Verify that user account and properties saved through reboots. |
| 125 | [Tags] Verify_User_Account_And_Properties_Saved_Through_Reboots |
| 126 | |
| 127 | # Create an User account. |
| 128 | Create User And Verify my_admin_user Administrator ${True} |
| 129 | |
| 130 | # Reboot BMC. |
| 131 | Redfish OBMC Reboot (off) stack_mode=normal |
| 132 | |
| 133 | Click Element ${xpath_refresh_button} |
| 134 | Wait Until Page Contains my_admin_user timeout=15 |
| 135 | |
| 136 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 137 | *** Keywords *** |
| 138 | |
| 139 | Create User And Verify |
| 140 | [Documentation] Create a user with given user name and privilege and verify that the |
| 141 | ... user is created successfully via GUI and Redfish. |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 142 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND |
| 143 | ... Redfish.Delete /redfish/v1/AccountService/Accounts/${user_name} |
| 144 | [Arguments] ${user_name} ${user_privilege} ${enabled} |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 145 | |
| 146 | # Description of argument(s): |
| 147 | # user_name The name of the user to be created (e.g. "test", "robert", etc.). |
| 148 | # user_privilege Privilege of the user. |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 149 | # enabled If the user is enabled (e.g True if enabled, False if disabled). |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 150 | |
| 151 | Click Element ${xpath_add_user} |
| 152 | Wait Until Page Contains Element ${xpath_add_user_heading} |
| 153 | |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 154 | # Select disabled radio button if user needs to be disabled |
| 155 | Run Keyword If ${enabled} == ${False} |
manashsarma | cb646cc | 2020-11-17 03:59:04 -0600 | [diff] [blame] | 156 | ... Click Element At Coordinates ${xpath_account_status_disabled_button} 0 0 |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 157 | |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 158 | # Input username, password and privilege. |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 159 | Input Text ${xpath_username_input_button} ${user_name} |
| 160 | Select From List by Value ${xpath_privilege_list_button} ${user_privilege} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 161 | |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 162 | Input Text ${xpath_password_input_button} ${test_user_password} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 163 | |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 164 | Input Text ${xpath_password_confirm_button} ${test_user_password} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 165 | |
| 166 | # Submit. |
| 167 | Click Element ${xpath_submit_button} |
| 168 | |
| 169 | # Refresh page and check new user is available. |
| 170 | Wait Until Page Contains Element ${xpath_add_user} |
| 171 | Click Element ${xpath_refresh_button} |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 172 | Wait Until Page Contains ${user_name} timeout=15 |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 173 | |
| 174 | # Cross check the privilege of newly added user via Redfish. |
| 175 | ${user_priv_redfish}= Redfish_Utils.Get Attribute |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 176 | ... /redfish/v1/AccountService/Accounts/${user_name} RoleId |
| 177 | Should Be Equal ${user_privilege} ${user_priv_redfish} |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 178 | |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 179 | # Check enable/disable status for user. |
| 180 | Redfish.Logout |
| 181 | ${status}= Run Keyword And Return Status Redfish.Login ${user_name} ${test_user_password} |
| 182 | Run Keyword If ${enabled} == ${False} |
| 183 | ... Should Be Equal ${status} ${False} |
| 184 | ... ELSE Should Be Equal ${status} ${True} |
| 185 | |
| 186 | |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 187 | Test Setup Execution |
| 188 | [Documentation] Do test case setup tasks. |
| 189 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 190 | # 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] | 191 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 192 | Click Element ${xpath_secuity_and_accesss_menu} |
| 193 | Click Element ${xpath_user_management_sub_menu} |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 194 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain user-management |
| 195 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |