Proyectos de Subversion Moodle

Rev

| 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"
35
 
36
  @javascript
37
  Scenario: I can revoke a factor only when there is more than one active factor
38
    Given the following config values are set as admin:
39
      | enabled | 1 | factor_webauthn |
40
    And the following config values are set as admin:
41
      | enabled | 1 | factor_sms     |
42
    And the following "tool_mfa > User factors" exist:
43
    | username | factor   | label                |
44
    | admin    | sms      | +409111222           |
45
    | admin    | webauthn | MacBook              |
46
    And I follow "Preferences" in the user menu
47
    And I click on "Multi-factor authentication preferences" "link"
48
    And I click on "Manage SMS" "button"
49
    And I click on "Remove" "button" in the "+409111222" "table_row"
50
    When I click on "Yes, remove" "button" in the "Remove '+409111222' SMS?" "dialogue"
51
    Then I should see "'SMS mobile phone - +409111222' successfully removed"
52
    # Now there is only one active factor left.
53
    And I click on "Manage security key" "button"
54
    And I should see "Replace" in the "MacBook" "table_row"
55
    And I should not see "Remove" in the "MacBook" "table_row"
56
 
57
  @javascript
58
  Scenario: I can replace a factor
59
    Given the following config values are set as admin:
60
      | enabled | 1 | factor_webauthn |
61
    And the following "tool_mfa > User factors" exist:
62
    | username | factor   | label                |
63
    | admin    | webauthn | MacBook              |
64
    And I follow "Preferences" in the user menu
65
    And I click on "Multi-factor authentication preferences" "link"
66
    And I click on "Manage security key" "button"
67
    And I click on "Replace" "button" in the "MacBook" "table_row"
68
    When I click on "Yes, replace" "button" in the "Replace 'MacBook' security key?" "dialogue"
69
    Then I should see "Replace security key"