blob: c0497804f84915902b30bae387efdb1bfe1ec84a [file] [log] [blame]
Sushma M M87a5b2d2020-07-31 00:58:48 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "Local user management" sub-menu of "Access control".
4
5Resource ../../lib/resource.robot
6
7Suite Setup Launch Browser And Login GUI
8Suite Teardown Close Browser
9Test Setup Test Setup Execution
10
11
12*** Variables ***
Sushma M M26302992020-08-31 01:15:26 -050013${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')]
17${xpath_edit_user} //button[@aria-label="Edit user"]
18${xpath_delete_user} //button[@aria-label="Delete user"]
manashsarmac67f2262020-09-24 08:16:08 -050019${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')]
manashsarma66f03842020-09-23 08:52:38 -050028${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']
manashsarmacc35bad2020-09-30 04:19:01 -050032${test_user_password} TestPwd1
Sushma M M87a5b2d2020-07-31 00:58:48 -050033
34*** Test Cases ***
35
Sushma M M26302992020-08-31 01:15:26 -050036Verify 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 M87a5b2d2020-07-31 00:58:48 -050043Verify 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
50Verify 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
57Verify 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
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
87
88 Click Element ${xpath_account_policy}
89 Wait Until Page Contains ${xpath_policy_settings_header}
90 Page Should Contain Element ${xpath_auto_unlock}
91 Page Should Contain Element ${xpath_manual_unlock}
92 Page Should Contain Element ${xpath_max_failed_login}
93 Page Should Contain Element ${xpath_submit_button}
94 Page Should Contain Element ${xpath_cancel_button}
95
manashsarma95777412020-09-28 09:52:41 -050096
97Verify Newly Create User
98 [Documentation] Create a new user and verifying that user is created.
99 [Tags] Verify_Newly_Create_User
100 [Teardown] Redfish.Delete /redfish/v1/AccountService/Accounts/TestUser
101
102 Click Element ${xpath_add_user}
103 Wait Until Page Contains Element ${xpath_add_user_heading}
104
105 # Input username, password and privilege.
106 Input Text ${xpath_username_input_button} TestUser
107 Select From List by Value ${xpath_privilege_list_button} Administrator
108
manashsarmacc35bad2020-09-30 04:19:01 -0500109 Input Text ${xpath_password_input_button} ${test_user_password}
manashsarma95777412020-09-28 09:52:41 -0500110
manashsarmacc35bad2020-09-30 04:19:01 -0500111 Input Text ${xpath_password_confirm_button} ${test_user_password}
manashsarma95777412020-09-28 09:52:41 -0500112
113 # Submit.
114 Click Element ${xpath_submit_button}
115
116 # Refresh page and check new user is available.
117 Wait Until Page Contains Element ${xpath_add_user}
118 Click Element ${xpath_refresh_button}
119 Wait Until Page Contains TestUser timeout=15
120
121 # Cross check the privilege of newly added user via Redfish.
122 ${user_priv_redfish}= Redfish_Utils.Get Attribute
123 ... /redfish/v1/AccountService/Accounts/TestUser RoleId
124 Should Be Equal Administrator ${user_priv_redfish}
125
126
manashsarmacc35bad2020-09-30 04:19:01 -0500127Verify Operator Privilege User
128 [Documentation] Create a new user with operator priviledge and verify that user is created.
129 [Tags] Verify_Operator_Privilege_User
130 [Teardown] Redfish.Delete /redfish/v1/AccountService/Accounts/TestOperator
131
132 Click Element ${xpath_add_user}
133 Wait Until Page Contains Element ${xpath_add_user_heading}
134
135 # input username.
136 Input Text ${xpath_input_username} TestOperator
137 Select From List by Value ${xpath_list_privilege} Operator
138
139 # input user password.
140 Input Text ${xpath_input_password} ${test_user_password}
141
142 # confirm user password.
143 Input Text ${xpath_input_password_confirmation} ${test_user_password}
144
145 # submit.
146 Click Element ${xpath_submit_button}
147
148 # refresh page and check new user is available.
149 Wait Until Page Contains Element ${xpath_add_user}
150 Click Element ${xpath_refresh_button}
151 Wait Until Page Contains TestOperator timeout=15
152
153 # privilege of newly added user.
154 ${role_config}= Redfish_Utils.Get Attribute
155 ... /redfish/v1/AccountService/Accounts/TestOperator RoleId
156 Should Be Equal Operator ${role_config}
157
158
Sushma M M87a5b2d2020-07-31 00:58:48 -0500159*** Keywords ***
160
161Test 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}
168 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain local-user-management