Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@auth @core_auth @javascript
2
Feature: Test if the login form provides the correct feedback
3
  In order to check if the login form provides correct feedback
4
  As a user
5
  I need to go on login page and see feedback on incorrect username or password.
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username |
10
      | teacher1 |
11
 
12
  Scenario: Check invalid login message
13
    Given I follow "Log in"
14
    And I set the field "Username" to "teacher1"
15
    And I set the field "Password" to "incorrect"
16
    When I press "Log in"
17
    Then I should see "Invalid login, please try again"
18
 
19
  Scenario: Test login language selector
20
    Given remote langimport tests are enabled
21
    And the following "language packs" exist:
22
      | language |
23
      | nl       |
24
      | es       |
25
    And the following config values are set as admin:
26
      | langmenu | 1 |
27
    And I follow "Log in"
28
    And I open the action menu in "region-main" "region"
29
    # The line below contains the unicode character U+200E before and after the brackets, please be very careful editing this line.
30
    When I choose "Nederlands ‎(nl)‎" in the open action menu
31
    Then I should see "Gebruikersnaam"
32
 
33
  @_file_upload
34
  Scenario: Set logo for loginpage
35
    Given I log in as "admin"
36
    And I navigate to "Appearance > Logos" in site administration
37
    And I upload "course/tests/fixtures/image.jpg" file to "Logo" filemanager
38
    And I press "Save changes"
39
    And I log out
40
    And I follow "Log in"
41
    Then "//img[@id='logoimage']" "xpath_element" should exist
42
 
43
  Scenario: Add a custom welcome message
44
    Given the following config values are set as admin:
45
      | auth_instructions | Lorem ipsum dolor sit amet |
46
    And I follow "Log in"
47
    Then I should see "Lorem ipsum dolor sit amet"
48
 
49
  Scenario: Show the maintenance mode message
50
    Given the following config values are set as admin:
51
      | maintenance_enabled | Disabled |
52
      | maintenance_message | Back online tomorrow |
53
    And I follow "Log in"
54
    Then I should see "Back online tomorrow"
55
 
56
  Scenario: User self registration
57
    Given the following config values are set as admin:
58
      | registerauth | Email-based self-registration |
59
    And I follow "Log in"
60
    Then I should see "Create new account"
61
 
62
  Scenario: Set OAuth providers
63
    Given I log in as "admin"
64
    And I navigate to "Plugins > Authentication > Manage authentication" in site administration
65
    And I click on "Enable" "link" in the "OAuth 2" "table_row"
66
    And I navigate to "Server > OAuth 2 services" in site administration
67
    And I press "Google"
68
    And I set the field "Client ID" to "1234"
69
    And I set the field "Client secret" to "1234"
70
    And I press "Save changes"
71
    And I press "Facebook"
72
    And I set the field "Client ID" to "1234"
73
    And I set the field "Client secret" to "1234"
74
    And I press "Save changes"
75
    And I press "Microsoft"
76
    And I set the field "Client ID" to "1234"
77
    And I set the field "Client secret" to "1234"
78
    And I press "Save changes"
79
    And I log out
80
    And I follow "Log in"
81
    Then I should see "Google"
82
    And I should see "Facebook"
83
    And I should see "Microsoft"
84
 
85
  Scenario: Test the login page auto focus feature
86
    Given the following config values are set as admin:
87
      | loginpageautofocus | Enabled |
88
    And I follow "Log in"
89
    Then the focused element is "Username" "field"
90
    And I set the field "Username" to "admin"
91
    And I set the field "Password" to "admin"
92
    And I press "Log in"
93
    And I log out
94
    And I follow "Log in"
95
    Then the focused element is "Password" "field"
96
 
97
  Scenario: Test the login page focus after error feature
98
    Given I follow "Log in"
99
    And I set the field "Username" to "admin"
100
    And I set the field "Password" to "wrongpassword"
101
    And I press "Log in"
102
    And I press the tab key
103
    Then the focused element is "Username" "field"
104
 
105
  Scenario: Display the password visibility toggle icon
106
    Given the following config values are set as admin:
107
      | loginpasswordtoggle | 1 |
108
    When I follow "Log in"
109
    Then "Toggle sensitive" "button" should be visible
110
    And the following config values are set as admin:
111
      | loginpasswordtoggle | 0 |
112
    And I reload the page
113
    And "Toggle sensitive" "button" should not be visible
114
 
115
  Scenario: Display the password visibility toggle icon for small screens only
116
    Given the following config values are set as admin:
117
      | loginpasswordtoggle | 2 |
118
    When I follow "Log in"
119
    Then "Toggle sensitive" "button" should not be visible
120
    And I change the viewport size to "mobile"
121
    And "Toggle sensitive" "button" should be visible