| 1 |
Feature: Login page |
| 2 |
Test login using all available methods, failure handling and resetting password |
| 3 |
|
| 4 |
@test |
| 5 |
Scenario Outline: Successful admin login with valid username and password |
| 6 |
When I log in as "<username>" with password "<password>" |
| 7 |
Then I should be logged in as "Administrator" |
| 8 |
|
| 9 |
Examples: |
| 10 |
| username | password | |
| 11 |
| admin | Secret123 | |
| 12 |
| root | Secret123 | |
| 13 |
|
| 14 |
@seed |
| 15 |
Scenario: Create user "jdoe" |
| 16 |
Given User "jdoe" "John" "Doe" exists and is using password "Secret123" |
| 17 |
|
| 18 |
@test |
| 19 |
Scenario: Successful non-privileged user login with valid username and password with password reset and re-login |
| 20 |
When I log in as "jdoe" with password "Secret123" |
| 21 |
Then I should be on "reset-password/jdoe" page |
| 22 |
And I should see "reset-password-error" alert |
| 23 |
And I should see "jdoe" in the "reset-password-textbox-username" textbox |
| 24 |
|
| 25 |
When I type in the "reset-password-textbox-current-password" textbox text "Secret123" |
| 26 |
Then I should see "Secret123" in the "reset-password-textbox-current-password" textbox |
| 27 |
When I type in the "reset-password-textbox-new-password" textbox text "NewSecret123" |
| 28 |
Then I should see "NewSecret123" in the "reset-password-textbox-new-password" textbox |
| 29 |
When I type in the "reset-password-textbox-verify-password" textbox text "NewSecret123" |
| 30 |
Then I should see "NewSecret123" in the "reset-password-textbox-verify-password" textbox |
| 31 |
|
| 32 |
When I click on the "reset-password-button-reset" button |
| 33 |
Then I should be on "login" page |
| 34 |
|
| 35 |
When I log in as "jdoe" with password "NewSecret123" |
| 36 |
Then I should be on "active-users" page |
| 37 |
|
| 38 |
@cleanup |
| 39 |
Scenario: Delete user "jdoe" |
| 40 |
Given I delete user "jdoe" |
| 41 |
|
| 42 |
@test |
| 43 |
Scenario: Unsuccessful login with invalid username or password |
| 44 |
When I log in as "admin" with password "IncorrectPassword" |
| 45 |
Then I should see "authentication-modal-error" modal |
| 46 |
|
| 47 |
When I click on the "modal-button-ok" button |
| 48 |
Then I should not see "authentication-modal-error" modal |
| 49 |
|
| 50 |
When I log in as "admin" with password "Secret123" |
| 51 |
Then I should be logged in as "Administrator" |
| 52 |
|
| 53 |
@seed |
| 54 |
Scenario: Create user "otpuser" |
| 55 |
Given User "otpuser" "OTP" "User" exists and is using password "Secret123" |
| 56 |
And User "otpuser" has OTP enabled |
| 57 |
|
| 58 |
@test |
| 59 |
Scenario: Successful login with valid OTP with password reset and re-login |
| 60 |
When I log in as "otpuser" with password "Secret123" and generated OTP |
| 61 |
Then I should be on "reset-password/otpuser" page |
| 62 |
|
| 63 |
When I type in the "reset-password-textbox-current-password" textbox text "Secret123" |
| 64 |
Then I should see "Secret123" in the "reset-password-textbox-current-password" textbox |
| 65 |
When I type in the "reset-password-textbox-new-password" textbox text "NewSecret123" |
| 66 |
Then I should see "NewSecret123" in the "reset-password-textbox-new-password" textbox |
| 67 |
When I type in the "reset-password-textbox-verify-password" textbox text "NewSecret123" |
| 68 |
Then I should see "NewSecret123" in the "reset-password-textbox-verify-password" textbox |
| 69 |
When I type in the "reset-password-textbox-otp" textbox text otp token |
| 70 |
Then I should see otp token in the "reset-password-textbox-otp" textbox |
| 71 |
|
| 72 |
When I click on the "reset-password-button-reset" button |
| 73 |
Then I should be on "login" page |
| 74 |
|
| 75 |
When I log in as "otpuser" with password "NewSecret123" and generated OTP |
| 76 |
Then I should be logged in as "OTP User" |
| 77 |
|
| 78 |
@cleanup |
| 79 |
Scenario: Delete user "otpuser" |
| 80 |
Given I delete user "otpuser" |
| 81 |
|
| 82 |
@seed |
| 83 |
Scenario: Create user "otpuser" |
| 84 |
Given User "otpuser" "OTP" "User" exists and is using password "Secret123" |
| 85 |
And User "otpuser" has OTP enabled |
| 86 |
|
| 87 |
@test |
| 88 |
Scenario: Unsuccessful login with invalid or expired OTP |
| 89 |
When I log in as "otpuser" with password "Secret123" and generated OTP |
| 90 |
Then I should be on "reset-password/otpuser" page |
| 91 |
|
| 92 |
When I type in the "reset-password-textbox-current-password" textbox text "Secret123" |
| 93 |
Then I should see "Secret123" in the "reset-password-textbox-current-password" textbox |
| 94 |
When I type in the "reset-password-textbox-new-password" textbox text "NewSecret123" |
| 95 |
Then I should see "NewSecret123" in the "reset-password-textbox-new-password" textbox |
| 96 |
When I type in the "reset-password-textbox-verify-password" textbox text "NewSecret123" |
| 97 |
Then I should see "NewSecret123" in the "reset-password-textbox-verify-password" textbox |
| 98 |
When I type in the "reset-password-textbox-otp" textbox text otp token |
| 99 |
Then I should see otp token in the "reset-password-textbox-otp" textbox |
| 100 |
|
| 101 |
When I click on the "reset-password-button-reset" button |
| 102 |
Then I should be on "login" page |
| 103 |
|
| 104 |
When I log in as "otpuser" with password "NewSecret123" |
| 105 |
Then I should see "authentication-modal-error" modal |
| 106 |
|
| 107 |
@cleanup |
| 108 |
Scenario: Delete user "otpuser" |
| 109 |
Given I delete user "otpuser" |
| 110 |
|
| 111 |
@seed |
| 112 |
Scenario: Create user "jdoe" |
| 113 |
Given User "jdoe" "John" "Doe" exists and is using password "Secret123" |
| 114 |
|
| 115 |
@test |
| 116 |
Scenario: Blocked login after multiple failed attempts with username and password |
| 117 |
# Default number of failed attempts is 6 |
| 118 |
When I log in as "jdoe" with password "IncorrectPassword" |
| 119 |
Then I should see "authentication-modal-error" modal |
| 120 |
|
| 121 |
When I click on the "modal-button-ok" button |
| 122 |
Then I should not see "authentication-modal-error" modal |
| 123 |
|
| 124 |
When I log in as "jdoe" with password "IncorrectPassword" |
| 125 |
Then I should see "authentication-modal-error" modal |
| 126 |
|
| 127 |
When I click on the "modal-button-ok" button |
| 128 |
Then I should not see "authentication-modal-error" modal |
| 129 |
|
| 130 |
When I log in as "jdoe" with password "IncorrectPassword" |
| 131 |
Then I should see "authentication-modal-error" modal |
| 132 |
|
| 133 |
When I click on the "modal-button-ok" button |
| 134 |
Then I should not see "authentication-modal-error" modal |
| 135 |
|
| 136 |
When I log in as "jdoe" with password "IncorrectPassword" |
| 137 |
Then I should see "authentication-modal-error" modal |
| 138 |
|
| 139 |
When I click on the "modal-button-ok" button |
| 140 |
Then I should not see "authentication-modal-error" modal |
| 141 |
|
| 142 |
When I log in as "jdoe" with password "IncorrectPassword" |
| 143 |
Then I should see "authentication-modal-error" modal |
| 144 |
|
| 145 |
When I click on the "modal-button-ok" button |
| 146 |
Then I should not see "authentication-modal-error" modal |
| 147 |
|
| 148 |
When I log in as "jdoe" with password "IncorrectPassword" |
| 149 |
Then I should see "authentication-modal-error" modal |
| 150 |
|
| 151 |
When I click on the "modal-button-ok" button |
| 152 |
Then I should not see "authentication-modal-error" modal |
| 153 |
# End login attempts |
| 154 |
|
| 155 |
When I log in as "jdoe" with password "Secret123" |
| 156 |
Then I should see "authentication-modal-error" modal |
| 157 |
|
| 158 |
@cleanup |
| 159 |
Scenario: Delete user "jdoe" |
| 160 |
Given I delete user "jdoe" |
| 161 |
|
| 162 |
@seed |
| 163 |
Scenario: Create user "otpuser" |
| 164 |
Given User "otpuser" "OTP" "User" exists and is using password "Secret123" |
| 165 |
And User "otpuser" has OTP enabled |
| 166 |
|
| 167 |
@test |
| 168 |
Scenario: Blocked login after multiple failed OTP attempts |
| 169 |
When I log in as "otpuser" with password "Secret123" and generated OTP |
| 170 |
Then I should be on "reset-password/otpuser" page |
| 171 |
|
| 172 |
When I type in the "reset-password-textbox-current-password" textbox text "Secret123" |
| 173 |
Then I should see "Secret123" in the "reset-password-textbox-current-password" textbox |
| 174 |
When I type in the "reset-password-textbox-new-password" textbox text "NewSecret123" |
| 175 |
Then I should see "NewSecret123" in the "reset-password-textbox-new-password" textbox |
| 176 |
When I type in the "reset-password-textbox-verify-password" textbox text "NewSecret123" |
| 177 |
Then I should see "NewSecret123" in the "reset-password-textbox-verify-password" textbox |
| 178 |
When I type in the "reset-password-textbox-otp" textbox text otp token |
| 179 |
Then I should see otp token in the "reset-password-textbox-otp" textbox |
| 180 |
|
| 181 |
When I click on the "reset-password-button-reset" button |
| 182 |
Then I should be on "login" page |
| 183 |
|
| 184 |
# Default number of failed attempts is 6 |
| 185 |
When I log in as "otpuser" with password "NewSecret123123456" |
| 186 |
Then I should see "authentication-modal-error" modal |
| 187 |
|
| 188 |
When I click on the "modal-button-ok" button |
| 189 |
Then I should not see "authentication-modal-error" modal |
| 190 |
|
| 191 |
When I log in as "otpuser" with password "NewSecret123123456" |
| 192 |
Then I should see "authentication-modal-error" modal |
| 193 |
|
| 194 |
When I click on the "modal-button-ok" button |
| 195 |
Then I should not see "authentication-modal-error" modal |
| 196 |
|
| 197 |
When I log in as "otpuser" with password "NewSecret123123456" |
| 198 |
Then I should see "authentication-modal-error" modal |
| 199 |
|
| 200 |
When I click on the "modal-button-ok" button |
| 201 |
Then I should not see "authentication-modal-error" modal |
| 202 |
|
| 203 |
When I log in as "otpuser" with password "NewSecret123123456" |
| 204 |
Then I should see "authentication-modal-error" modal |
| 205 |
|
| 206 |
When I click on the "modal-button-ok" button |
| 207 |
Then I should not see "authentication-modal-error" modal |
| 208 |
|
| 209 |
When I log in as "otpuser" with password "NewSecret123123456" |
| 210 |
Then I should see "authentication-modal-error" modal |
| 211 |
|
| 212 |
When I click on the "modal-button-ok" button |
| 213 |
Then I should not see "authentication-modal-error" modal |
| 214 |
|
| 215 |
When I log in as "otpuser" with password "NewSecret123123456" |
| 216 |
Then I should see "authentication-modal-error" modal |
| 217 |
|
| 218 |
When I click on the "modal-button-ok" button |
| 219 |
Then I should not see "authentication-modal-error" modal |
| 220 |
# End login attempts |
| 221 |
|
| 222 |
When I log in as "otpuser" with password "NewSecret123" and generated OTP |
| 223 |
Then I should see "authentication-modal-error" modal |
| 224 |
|
| 225 |
@cleanup |
| 226 |
Scenario: Delete user "otpuser" |
| 227 |
Given I delete user "otpuser" |