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