blob: e631eb40f5085d3e4556f08722b4b2601a7aacec [file] [log] [blame]
Sushma M M87a5b2d2020-07-31 00:58:48 -05001*** Settings ***
2
Rahul Maheshwari142642d2021-08-24 00:00:15 -05003Documentation Test OpenBMC GUI "User management" sub-menu of "Security and access".
Sushma M M87a5b2d2020-07-31 00:58:48 -05004
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
Sushma M M87a5b2d2020-07-31 00:58:48 -05006
7Suite Setup Launch Browser And Login GUI
8Suite Teardown Close Browser
9Test Setup Test Setup Execution
10
11
12*** Variables ***
Rahul Maheshwari142642d2021-08-24 00:00:15 -050013${xpath_user_management_heading} //h1[text()="User management"]
Sushma M M26302992020-08-31 01:15:26 -050014${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 Maheshwari142642d2021-08-24 00:00:15 -050017${xpath_edit_user} //*[@data-test-id='userManagement-tableRowAction-edit-0']
18${xpath_delete_user} //*[@data-test-id='userManagement-tableRowAction-delete-1']
19${xpath_account_status_enabled_button} //*[@data-test-id='userManagement-radioButton-statusEnabled']
20${xpath_account_status_disabled_button} //*[@data-test-id='userManagement-radioButton-statusDisabled']
21${xpath_username_input_button} //*[@data-test-id='userManagement-input-username']
22${xpath_privilege_list_button} //*[@data-test-id='userManagement-select-privilege']
23${xpath_password_input_button} //*[@data-test-id='userManagement-input-password']
24${xpath_password_confirm_button} //*[@data-test-id='userManagement-input-passwordConfirmation']
25${xpath_cancel_button} //*[@data-test-id='userManagement-button-cancel']
26${xpath_submit_button} //*[@data-test-id='userManagement-button-submit']
manashsarmac67f2262020-09-24 08:16:08 -050027${xpath_add_user_heading} //h5[contains(text(),'Add user')]
manashsarma66f03842020-09-23 08:52:38 -050028${xpath_policy_settings_header} //*[text()="Account policy settings"]
Rahul Maheshwari142642d2021-08-24 00:00:15 -050029${xpath_auto_unlock} //*[@data-test-id='userManagement-radio-automaticUnlock']
30${xpath_manual_unlock} //*[@data-test-id='userManagement-radio-manualUnlock']
31${xpath_max_failed_login} //*[@data-test-id='userManagement-input-lockoutThreshold']
manashsarmacc35bad2020-09-30 04:19:01 -050032${test_user_password} TestPwd1
Sushma M M87a5b2d2020-07-31 00:58:48 -050033
34*** Test Cases ***
35
Rahul Maheshwari142642d2021-08-24 00:00:15 -050036Verify Navigation To User Management Page
37 [Documentation] Verify navigation to user management page.
38 [Tags] Verify_Navigation_To_User_Management_Page
Sushma M M26302992020-08-31 01:15:26 -050039
Rahul Maheshwari142642d2021-08-24 00:00:15 -050040 Page Should Contain Element ${xpath_user_management_heading}
Sushma M M26302992020-08-31 01:15:26 -050041
42
Rahul Maheshwari142642d2021-08-24 00:00:15 -050043Verify Existence Of All Sections In User Management Page
44 [Documentation] Verify existence of all sections in user management page.
45 [Tags] Verify_Existence_Of_All_Sections_In_User_Management_Page
Sushma M M87a5b2d2020-07-31 00:58:48 -050046
47 Page should contain View privilege role descriptions
48
49
Rahul Maheshwari142642d2021-08-24 00:00:15 -050050Verify Existence Of All Input Boxes In User Management Page
51 [Documentation] Verify existence of all sections in user managemnet page.
52 [Tags] Verify_Existence_Of_All_Input_Boxes_In_User_Management_Page
Sushma M M87a5b2d2020-07-31 00:58:48 -050053
54 Page Should Contain Checkbox ${xpath_select_user}
55
56
Rahul Maheshwari142642d2021-08-24 00:00:15 -050057Verify Existence Of All Buttons In User Management Page
58 [Documentation] Verify existence of all buttons in user management page.
59 [Tags] Verify_Existence_Of_All_Buttons_In_User_Management_Page
Sushma M M87a5b2d2020-07-31 00:58:48 -050060
61 Page should contain Button ${xpath_account_policy}
62 Page should contain Button ${xpath_add_user}
manashsarma90d91fa2021-04-08 07:07:16 -050063 Page Should Contain Element ${xpath_edit_user}
64 Page Should Contain Element ${xpath_delete_user}
Sushma M M87a5b2d2020-07-31 00:58:48 -050065
66
manashsarmac67f2262020-09-24 08:16:08 -050067Verify 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
manashsarma9d67d262020-10-15 11:20:48 -050070 [Teardown] Click Element ${xpath_cancel_button}
manashsarmac67f2262020-09-24 08:16:08 -050071
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
manashsarma66f03842020-09-23 08:52:38 -050083
84Verify 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
manashsarma5c4a7d12020-10-21 05:21:37 -050087 [Teardown] Click Element ${xpath_cancel_button}
manashsarma66f03842020-09-23 08:52:38 -050088
89 Click Element ${xpath_account_policy}
manashsarma5c4a7d12020-10-21 05:21:37 -050090 Wait Until Page Contains Element ${xpath_policy_settings_header}
manashsarma66f03842020-09-23 08:52:38 -050091 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
manashsarma95777412020-09-28 09:52:41 -050097
manashsarmada29e552020-10-04 12:34:01 -050098Verify User Access Privilege
George Keishing4d4ef992021-01-28 09:56:53 -060099 [Documentation] Create a new user with a privilege and verify that user is created.
manashsarmada29e552020-10-04 12:34:01 -0500100 [Tags] Verify_User_Access_Privilege
101 [Template] Create User And Verify
102
manashsarmaedd6da02020-10-04 00:11:18 -0500103 # username privilege_level enabled
104 admin_user Administrator ${True}
manashsarmaedd6da02020-10-04 00:11:18 -0500105 readonly_user ReadOnly ${True}
manashsarmaedd6da02020-10-04 00:11:18 -0500106 disabled_user Administrator ${False}
107
manashsarmada29e552020-10-04 12:34:01 -0500108
rramyasr-inc4a5c342023-01-02 01:38:50 -0600109Verify Operator And No Access User Privilege
110 [Documentation] Create users with different access privilege
111 ... and verify that the user is getting created.
112 [Tags] Verify_Operator_And_No_Access_User_Privilege
113 [Template] Create User And Verify
114
115 # username privilege_level enabled
116 operator_user Operator ${True}
117 noaccess_user NoAccess ${True}
118
119
manashsarma165f5272021-08-04 07:37:01 -0500120Verify User Account And Properties Saved Through Reboots
121 [Documentation] Verify that user account and properties saved through reboots.
122 [Tags] Verify_User_Account_And_Properties_Saved_Through_Reboots
123
124 # Create an User account.
125 Create User And Verify my_admin_user Administrator ${True}
126
127 # Reboot BMC.
128 Redfish OBMC Reboot (off) stack_mode=normal
129
130 Click Element ${xpath_refresh_button}
131 Wait Until Page Contains my_admin_user timeout=15
132
133
manashsarmada29e552020-10-04 12:34:01 -0500134*** Keywords ***
135
136Create User And Verify
137 [Documentation] Create a user with given user name and privilege and verify that the
138 ... user is created successfully via GUI and Redfish.
manashsarmaedd6da02020-10-04 00:11:18 -0500139 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND
140 ... Redfish.Delete /redfish/v1/AccountService/Accounts/${user_name}
141 [Arguments] ${user_name} ${user_privilege} ${enabled}
manashsarmada29e552020-10-04 12:34:01 -0500142
143 # Description of argument(s):
144 # user_name The name of the user to be created (e.g. "test", "robert", etc.).
145 # user_privilege Privilege of the user.
manashsarmaedd6da02020-10-04 00:11:18 -0500146 # enabled If the user is enabled (e.g True if enabled, False if disabled).
manashsarma95777412020-09-28 09:52:41 -0500147
148 Click Element ${xpath_add_user}
149 Wait Until Page Contains Element ${xpath_add_user_heading}
150
manashsarmaedd6da02020-10-04 00:11:18 -0500151 # Select disabled radio button if user needs to be disabled
152 Run Keyword If ${enabled} == ${False}
manashsarmacb646cc2020-11-17 03:59:04 -0600153 ... Click Element At Coordinates ${xpath_account_status_disabled_button} 0 0
manashsarmaedd6da02020-10-04 00:11:18 -0500154
manashsarma95777412020-09-28 09:52:41 -0500155 # Input username, password and privilege.
manashsarmada29e552020-10-04 12:34:01 -0500156 Input Text ${xpath_username_input_button} ${user_name}
157 Select From List by Value ${xpath_privilege_list_button} ${user_privilege}
manashsarma95777412020-09-28 09:52:41 -0500158
manashsarmacc35bad2020-09-30 04:19:01 -0500159 Input Text ${xpath_password_input_button} ${test_user_password}
manashsarma95777412020-09-28 09:52:41 -0500160
manashsarmacc35bad2020-09-30 04:19:01 -0500161 Input Text ${xpath_password_confirm_button} ${test_user_password}
manashsarma95777412020-09-28 09:52:41 -0500162
163 # Submit.
164 Click Element ${xpath_submit_button}
165
166 # Refresh page and check new user is available.
167 Wait Until Page Contains Element ${xpath_add_user}
168 Click Element ${xpath_refresh_button}
manashsarmada29e552020-10-04 12:34:01 -0500169 Wait Until Page Contains ${user_name} timeout=15
manashsarma95777412020-09-28 09:52:41 -0500170
171 # Cross check the privilege of newly added user via Redfish.
172 ${user_priv_redfish}= Redfish_Utils.Get Attribute
manashsarmada29e552020-10-04 12:34:01 -0500173 ... /redfish/v1/AccountService/Accounts/${user_name} RoleId
174 Should Be Equal ${user_privilege} ${user_priv_redfish}
Sushma M M87a5b2d2020-07-31 00:58:48 -0500175
manashsarmaedd6da02020-10-04 00:11:18 -0500176 # Check enable/disable status for user.
177 Redfish.Logout
178 ${status}= Run Keyword And Return Status Redfish.Login ${user_name} ${test_user_password}
179 Run Keyword If ${enabled} == ${False}
180 ... Should Be Equal ${status} ${False}
181 ... ELSE Should Be Equal ${status} ${True}
182
183
Sushma M M87a5b2d2020-07-31 00:58:48 -0500184Test Setup Execution
185 [Documentation] Do test case setup tasks.
186
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500187 # Navigate to https://xx.xx.xx.xx/#/access-control/user-management user management page.
Sushma M M87a5b2d2020-07-31 00:58:48 -0500188
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500189 Click Element ${xpath_secuity_and_accesss_menu}
190 Click Element ${xpath_user_management_sub_menu}
191 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain user-managemen