Add GUI test case automation for adding user with operator privilege
Added testcase:
- Verify Operator Privilege User
Change-Id: Id5c6d4d7a55ef5df5515d07b67aff43434781b66
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/gui/gui_test/access_control/test_obmc_gui_local_users.robot b/gui/gui_test/access_control/test_obmc_gui_local_users.robot
index bf6b094..d416f00 100644
--- a/gui/gui_test/access_control/test_obmc_gui_local_users.robot
+++ b/gui/gui_test/access_control/test_obmc_gui_local_users.robot
@@ -29,6 +29,7 @@
${xpath_auto_unlock} //*[@data-test-id='localUserManagement-radio-automaticUnlock']
${xpath_manual_unlock} //*[@data-test-id='localUserManagement-radio-manualUnlock']
${xpath_max_failed_login} //*[@data-test-id='localUserManagement-input-lockoutThreshold']
+${test_user_password} TestPwd1
*** Test Cases ***
@@ -104,9 +105,9 @@
Input Text ${xpath_username_input_button} TestUser
Select From List by Value ${xpath_privilege_list_button} Administrator
- Input Text ${xpath_password_input_button} TestPwd1
+ Input Text ${xpath_password_input_button} ${test_user_password}
- Input Text ${xpath_password_confirm_button} TestPwd1
+ Input Text ${xpath_password_confirm_button} ${test_user_password}
# Submit.
Click Element ${xpath_submit_button}
@@ -122,6 +123,38 @@
Should Be Equal Administrator ${user_priv_redfish}
+Verify Operator Privilege User
+ [Documentation] Create a new user with operator priviledge and verify that user is created.
+ [Tags] Verify_Operator_Privilege_User
+ [Teardown] Redfish.Delete /redfish/v1/AccountService/Accounts/TestOperator
+
+ Click Element ${xpath_add_user}
+ Wait Until Page Contains Element ${xpath_add_user_heading}
+
+ # input username.
+ Input Text ${xpath_input_username} TestOperator
+ Select From List by Value ${xpath_list_privilege} Operator
+
+ # input user password.
+ Input Text ${xpath_input_password} ${test_user_password}
+
+ # confirm user password.
+ Input Text ${xpath_input_password_confirmation} ${test_user_password}
+
+ # submit.
+ Click Element ${xpath_submit_button}
+
+ # refresh page and check new user is available.
+ Wait Until Page Contains Element ${xpath_add_user}
+ Click Element ${xpath_refresh_button}
+ Wait Until Page Contains TestOperator timeout=15
+
+ # privilege of newly added user.
+ ${role_config}= Redfish_Utils.Get Attribute
+ ... /redfish/v1/AccountService/Accounts/TestOperator RoleId
+ Should Be Equal Operator ${role_config}
+
+
*** Keywords ***
Test Setup Execution