Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test OpenBMC GUI "Manage user account" sub-menu of |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 4 | ... "Users". |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 5 | |
| 6 | Resource ../../lib/resource.robot |
| 7 | |
| 8 | Suite Setup Launch Browser And Login OpenBMC GUI |
Rahul Maheshwari | 43333ff | 2018-11-26 23:18:36 -0600 | [diff] [blame] | 9 | Suite Teardown Close Browser |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 10 | Test Setup Test Setup Execution |
| 11 | |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 12 | |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 13 | *** Variables *** |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 14 | |
| 15 | ${xpath_input_username} //input[@name='UserName'] |
| 16 | ${xpath_input_password} //input[@name='Password'] |
| 17 | ${xpath_input_retype_password} //input[@name='VerifyPassword'] |
Anusha Dathatri | 2fe9ad5 | 2019-05-14 21:20:22 -0500 | [diff] [blame] | 18 | ${xpath_input_user_role} //select[@id='role'] |
| 19 | ${xpath_input_enabled_checkbox} //label[@for="user-manage__enabled"] |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 20 | ${xpath_input_lockout_time} //input[@id='lockoutTime'] |
| 21 | ${xpath_input_failed_login_attempts} //input[@id='lockoutThreshold'] |
| 22 | ${xpath_select_manage_users} //a[contains(text(), "Manage user account")] |
| 23 | ${xpath_select_users} //button[contains(@class, "users")] |
| 24 | ${xpath_save_setting_button} //button[text() ="Save settings"] |
Anusha Dathatri | 2fe9ad5 | 2019-05-14 21:20:22 -0500 | [diff] [blame] | 25 | ${xpath_create_user_button} //button[text() ="Create user"] |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 26 | ${xpath_edit_button} //button[text() ="Edit"] |
| 27 | ${xpath_delete_button} //button[text() ="Delete"] |
Anusha Dathatri | 2fe9ad5 | 2019-05-14 21:20:22 -0500 | [diff] [blame] | 28 | ${label} //label[@class="control-check"] |
| 29 | ${xpath_edit_save_button} //*[@id="user-accounts"]/form/section/div[7]/button[2] |
| 30 | &{user_password} testUser1=testUserPwd1 root=0penBmc |
| 31 | &{action_msg_relation} add=User has been created successfully |
| 32 | ... modify=User has been updated successfully |
| 33 | ... add_dup=Username exists |
| 34 | &{user_invalid_password} root=rootPwd1 |
| 35 | |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 36 | |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 37 | |
| 38 | *** Test Cases *** |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 39 | |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 40 | Verify Existence Of All Section In User Page |
| 41 | [Documentation] Verify existence of all sections in user page.. |
| 42 | [Tags] Verify_Existence_Of_All_Section_In_User_Page |
| 43 | |
| 44 | Page should contain User account properties |
| 45 | Page should contain User account information |
| 46 | Page should contain User account settings |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 47 | |
| 48 | |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 49 | Verify Existence Of All Input Boxes In User Page |
| 50 | [Documentation] Verify existence of all input boxes in user page. |
| 51 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_User_Page |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 52 | |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 53 | # Input boxes under user account settings |
| 54 | Page Should Contain Element ${xpath_input_username} |
| 55 | Page Should Contain Element ${xpath_input_password} |
| 56 | Page Should Contain Element ${xpath_input_retype_password} |
| 57 | Page Should Contain Element ${xpath_input_user_role} |
| 58 | Page Should Contain Element ${xpath_input_enabled_checkbox} |
| 59 | |
| 60 | # Input boxes under user account properties |
| 61 | Page Should Contain Element ${xpath_input_lockout_time} |
| 62 | Page Should Contain Element ${xpath_input_failed_login_attempts} |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 63 | |
| 64 | |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 65 | Verify Existence Of All Button In User Page |
George Keishing | 1add553 | 2019-05-31 06:56:06 -0500 | [diff] [blame] | 66 | [Documentation] Verify existence of all button in user page. |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 67 | [Tags] Verify_Existence_Of_All_Button_In_User_Page |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 68 | |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 69 | # Buttons under user account properties |
| 70 | Page Should Contain Element ${xpath_save_setting_button} |
| 71 | |
| 72 | # Buttons under user account settings |
| 73 | Page Should Contain Element ${xpath_create_user_button} |
| 74 | |
| 75 | # Buttons under user account properties |
| 76 | Page Should Contain Element ${xpath_edit_button} |
| 77 | Page Should Contain Element ${xpath_delete_button} |
| 78 | |
Anusha Dathatri | 2fe9ad5 | 2019-05-14 21:20:22 -0500 | [diff] [blame] | 79 | Verify Error When Duplicate User Is Created |
| 80 | [Documentation] Verify error when duplicate user is created. |
| 81 | [Tags] Verify_Error_When_Duplicate_User_Is_Created |
| 82 | [Setup] Delete Given Users |
| 83 | |
| 84 | Add Or Modify User root &{user_password}[root] action=add_dup |
| 85 | |
| 86 | Delete User And Verify |
| 87 | [Documentation] Delete user and verify. |
| 88 | [Tags] Delete_User_And_Verify |
| 89 | [Setup] Delete Given Users |
| 90 | |
| 91 | Add Or Modify User testUser1 &{user_password}[testUser1] |
| 92 | Delete Given Users delete_user=testUser1 |
| 93 | Page Should Not Contain testUser1 |
| 94 | |
| 95 | Verify Invalid Password Error |
| 96 | [Documentation] Verify the error message when user logs in with invalid password. |
| 97 | [Tags] Verify_Invalid_Password_Error |
| 98 | [Setup] Delete Given Users |
| 99 | [Teardown] Login OpenBMC GUI |
| 100 | |
| 101 | LogOut OpenBMC GUI |
| 102 | Login And Verify Message root &{user_invalid_password}[root] Invalid username or password |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 103 | |
| 104 | *** Keywords *** |
| 105 | |
| 106 | Test Setup Execution |
| 107 | [Documentation] Do test case setup tasks. |
| 108 | |
Anusha Dathatri | 2fe9ad5 | 2019-05-14 21:20:22 -0500 | [diff] [blame] | 109 | Click Button ${xpath_select_users} |
| 110 | Sleep 2s |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 111 | Wait Until Page Contains Element ${xpath_select_manage_users} |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 112 | Click Element ${xpath_select_manage_users} |
Rahul Maheshwari | 39785c7 | 2019-04-02 20:03:54 -0500 | [diff] [blame] | 113 | Wait Until Page Contains User account information |
Sivas SRR | 9aadc26 | 2018-05-10 12:16:03 -0500 | [diff] [blame] | 114 | |
Anusha Dathatri | 2fe9ad5 | 2019-05-14 21:20:22 -0500 | [diff] [blame] | 115 | Add Or Modify User |
| 116 | [Documentation] Creates or edits user. |
| 117 | [Arguments] ${username} ${password} ${role}=Administrator ${enabled}=${True} |
| 118 | ... ${action}=add |
| 119 | # Description of argument(s): |
| 120 | # username Name of the user to be created. |
| 121 | # role Role of the new user. |
| 122 | # enabled If True, User is enabled (Default), False, User is disabled. |
| 123 | # action add - Creates a new user. |
| 124 | # modify - Edits an existing user. |
| 125 | # add_dup - Tries to add a duplicate user and verifies the error message. |
| 126 | |
| 127 | Run Keyword If '${action}' == 'add' or '${action}' == 'add_dup' |
| 128 | ... Input Text ${xpath_input_username} ${username} |
| 129 | Input Password ${xpath_input_password} ${password} |
| 130 | Input Password ${xpath_input_retype_password} ${password} |
| 131 | Log ${role} |
| 132 | Select From List By Value ${xpath_input_user_role} ${role} |
| 133 | Run Keyword If '${enabled}' == 'True' Click Element ${xpath_input_enabled_checkbox} |
| 134 | Run Keyword If '${action}' == 'modify' |
| 135 | ... Click Button ${xpath_edit_save_button} |
| 136 | ... ELSE Click Button ${xpath_create_user_button} |
| 137 | Capture Page Screenshot |
| 138 | Page Should Contain &{action_msg_relation}[${action}] |
| 139 | |
| 140 | Delete Given Users |
| 141 | [Documentation] Deletes users based on the input. |
| 142 | [Arguments] ${delete_user}=nonRoot |
| 143 | # Description of argument(s): |
| 144 | # delete_user values - nonRoot/username |
| 145 | # If nonRoot - Deletes all non-root users, |
| 146 | # username - Deletes the given user. |
| 147 | |
| 148 | Wait Until Page Contains root |
| 149 | Run Keyword If '${delete_user}' != 'nonRoot' Page Should Contain ${delete_user} |
| 150 | # Row id that gets deleted in every iteration. |
| 151 | ${deleting_row_id}= Set Variable 1 |
| 152 | :FOR ${row} IN RANGE 1 16 |
| 153 | \ ${xpath_user}= Set Variable //*[@id="user-accounts"]/div[4]/div[2]/div[${deleting_row_id}]/div[1] |
| 154 | \ ${status}= Run Keyword And Return Status Page Should Contain Element ${xpath_user} |
| 155 | \ Exit For Loop If '${status}' == 'False' |
| 156 | \ ${user}= Get Text ${xpath_user} |
| 157 | \ ${deleting_row_id} Run Keyword If '${user}' == 'root' or '${deleting_row_id}' == '2' Set Variable 2 |
| 158 | \ ... ELSE Set Variable 1 |
| 159 | \ Continue For Loop If '${user}' == 'root' |
| 160 | \ ${xpath_delete_user} Run Keyword If '${user}' == '${delete_user}' or '${delete_user}' == 'nonRoot' |
| 161 | \ ... Set Variable //*[@id="user-accounts"]/div[4]/div[2]/div[${deleting_row_id}]/div[5]/button[2] |
| 162 | \ Run Keyword If '${user}' == '${delete_user}' or '${delete_user}' == 'nonRoot' |
| 163 | \ ... Run Keywords Click Button ${xpath_delete_user} |
| 164 | \ ... AND Page Should Contain User has been deleted successfully |
| 165 | \ ... AND Reload Page |
| 166 | \ ... AND Exit For Loop If '${user}' == '${delete_user}' |
| 167 | |
| 168 | Login And Verify Message |
| 169 | [Documentation] Verifies the error message displayed on screen while logging in. |
| 170 | [Arguments] ${username} ${password} ${msg} |
| 171 | |
| 172 | Input Text ${xpath_textbox_username} ${username} |
| 173 | Input Password ${xpath_textbox_password} ${password} |
| 174 | Click Element ${xpath_button_login} |
| 175 | Page Should Contain ${msg} |