1 |
efrain |
1 |
@tool @tool_mfa @factor_sms
|
|
|
2 |
Feature: Login user with sms authentication factor
|
|
|
3 |
In order to login using SMS factor authentication
|
|
|
4 |
As an user
|
|
|
5 |
I need to be able to login
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given I log in as "admin"
|
1441 |
ariadna |
9 |
And the following "core_sms > sms_gateways" exist:
|
|
|
10 |
| name | classname | enabled | config |
|
|
|
11 |
| Dummy gateway | smsgateway_aws\gateway | 1 | {"countrycode":"+61", "gateway":"aws_sns", "api_region":"ap-southeast-2", "api_key":"abc", "api_secret":"123"} |
|
1 |
efrain |
12 |
And the following config values are set as admin:
|
|
|
13 |
| enabled | 1 | tool_mfa |
|
|
|
14 |
| lockout | 3 | tool_mfa |
|
|
|
15 |
And the following config values are set as admin:
|
1441 |
ariadna |
16 |
| enabled | 1 | factor_sms |
|
|
|
17 |
| weight | 100 | factor_sms |
|
|
|
18 |
| duration | 1800 | factor_sms |
|
|
|
19 |
And the following config values are set as admin:
|
|
|
20 |
| enabled | 0 | factor_email |
|
|
|
21 |
And I navigate to "Plugins > Admin tools > Multi-factor authentication" in site administration
|
|
|
22 |
And I follow "Edit settings for the SMS factor"
|
|
|
23 |
And I set the field "SMS gateway" to "Dummy gateway (AWS)"
|
|
|
24 |
And I press "Save changes"
|
|
|
25 |
And I should see "Changes saved"
|
1 |
efrain |
26 |
# Set up user SMS factor in user preferences.
|
|
|
27 |
When I follow "Preferences" in the user menu
|
|
|
28 |
And I click on "Multi-factor authentication preferences" "link"
|
|
|
29 |
And I click on "Set up" "button"
|
|
|
30 |
And I set the field "Mobile number" to "+34649709233"
|
|
|
31 |
And I press "Send code"
|
|
|
32 |
And I set the field "Enter code" with valid code
|
|
|
33 |
Then I press "Save"
|
|
|
34 |
|
|
|
35 |
Scenario: Login user successfully with sms verification
|
|
|
36 |
Given I log out
|
|
|
37 |
And I log in as "admin"
|
|
|
38 |
And I should see "2-step verification"
|
|
|
39 |
And I should see "Enter code"
|
|
|
40 |
When I set the field "Enter code" with valid code
|
|
|
41 |
And I click on "Continue" "button"
|
|
|
42 |
Then I am logged in as "admin"
|
|
|
43 |
|
|
|
44 |
Scenario: Wrong code number end of possible attempts
|
|
|
45 |
Given I log out
|
|
|
46 |
And I log in as "admin"
|
|
|
47 |
And I should see "2-step verification"
|
|
|
48 |
And I should see "Enter code"
|
|
|
49 |
When I set the field "Enter code" to "555556"
|
|
|
50 |
And I click on "Continue" "button"
|
|
|
51 |
And I should see "Wrong code."
|
|
|
52 |
And I should see "You have 2 attempts left."
|
|
|
53 |
And I set the field "Enter code" to "555553"
|
|
|
54 |
And I click on "Continue" "button"
|
|
|
55 |
And I should see "Wrong code."
|
|
|
56 |
And I should see "1 attempts left."
|
|
|
57 |
And I set the field "Enter code" to "555553"
|
|
|
58 |
And I click on "Continue" "button"
|
|
|
59 |
Then I should see "Unable to authenticate"
|