Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@tool @tool_mfa
2
Feature: Set up and manage user factors
3
  In order to set up or manage my user factor
4
  As a user
5
  I need to configure the user factor settings in my preferences
6
 
7
  Background:
8
    Given I log in as "admin"
9
    And the following config values are set as admin:
10
      | enabled | 1 | tool_mfa |
11
 
12
  Scenario: I see the correct buttons for factor setup and management displayed
13
    Given the following config values are set as admin:
14
      | enabled | 1 | factor_email    |
15
    And the following config values are set as admin:
16
      | enabled | 1 | factor_webauthn |
17
    And the following config values are set as admin:
18
      | enabled | 1 | factor_totp     |
19
    And the following "tool_mfa > User factors" exist:
20
      | username | factor   | label                |
21
      | admin    | email    | test@test.com        |
22
      | admin    | webauthn | MacBook              |
23
    And I follow "Preferences" in the user menu
24
    When I click on "Multi-factor authentication preferences" "link"
25
    # This is the only factor not yet set up.
26
    Then I should not see "Active" in the "#factor-card-totp" "css_element"
27
    # The following factors are already set up.
28
    And I should see "Active" in the "#factor-card-email" "css_element"
29
    And I should see "Active" in the "#factor-card-webauthn" "css_element"
30
    And I click on "Set up authenticator app" "button"
31
    And I should see "Set up authenticator app"
32
    And I click on "Cancel" "button"
33
    And I click on "Manage security key" "button"
34
    And I should see "Manage security key"
1441 ariadna 35
    And I should see "Add security key"
1 efrain 36
 
37
  @javascript
38
  Scenario: I can revoke a factor only when there is more than one active factor
39
    Given the following config values are set as admin:
40
      | enabled | 1 | factor_webauthn |
1441 ariadna 41
    And I navigate to "Plugins > SMS > Manage SMS gateways" in site administration
42
    And I follow "Create new SMS gateway"
43
    And I set the following fields to these values:
44
      | SMS gateway provider | AWS           |
45
      | Gateway name         | Dummy gateway |
46
      | Access key           | key123        |
47
      | Secret access key    | secret456     |
48
    And I press "Save changes"
1 efrain 49
    And the following config values are set as admin:
50
      | enabled | 1 | factor_sms     |
1441 ariadna 51
      | smsgateway | Dummy gateway (AWS) | factor_sms     |
52
    And the following config values are set as admin:
53
      | enabled | 0 | factor_email |
1 efrain 54
    And the following "tool_mfa > User factors" exist:
55
    | username | factor   | label                |
56
    | admin    | sms      | +409111222           |
57
    | admin    | webauthn | MacBook              |
58
    And I follow "Preferences" in the user menu
59
    And I click on "Multi-factor authentication preferences" "link"
60
    And I click on "Manage SMS" "button"
61
    And I click on "Remove" "button" in the "+409111222" "table_row"
62
    When I click on "Yes, remove" "button" in the "Remove '+409111222' SMS?" "dialogue"
1441 ariadna 63
    Then I should see "'SMS - +409111222' successfully removed"
1 efrain 64
    # Now there is only one active factor left.
65
    And I click on "Manage security key" "button"
66
    And I should see "Replace" in the "MacBook" "table_row"
67
    And I should not see "Remove" in the "MacBook" "table_row"
68
 
69
  @javascript
70
  Scenario: I can replace a factor
71
    Given the following config values are set as admin:
72
      | enabled | 1 | factor_webauthn |
73
    And the following "tool_mfa > User factors" exist:
74
    | username | factor   | label                |
75
    | admin    | webauthn | MacBook              |
76
    And I follow "Preferences" in the user menu
77
    And I click on "Multi-factor authentication preferences" "link"
78
    And I click on "Manage security key" "button"
79
    And I click on "Replace" "button" in the "MacBook" "table_row"
80
    When I click on "Yes, replace" "button" in the "Replace 'MacBook' security key?" "dialogue"
81
    Then I should see "Replace security key"
1441 ariadna 82
 
83
  Scenario: I can add a new factor instance on the manage factor page
84
    Given the following config values are set as admin:
85
      | enabled | 1 | factor_webauthn |
86
    And the following "tool_mfa > User factors" exist:
87
      | username | factor   | label    |
88
      | admin    | webauthn | MacBook  |
89
    And I follow "Preferences" in the user menu
90
    And I click on "Multi-factor authentication preferences" "link"
91
    And I click on "Manage security key" "button"
92
    When I click on "Add security key" "button"
93
    Then I should see "Set up security key"