Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_auth
2
Feature: Test the 'remember username' feature works.
3
  In order for users to easily log in to the site
4
  As a user
5
  I need the site to remember my username when the feature is enabled
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username |
10
      | teacher1 |
11
 
12
  # Given the user has logged in and selected 'Remember username', when they log in again, then their username should be remembered.
13
  Scenario: Check that 'remember username' works without javascript for teachers.
14
    # Log in the first time with $CFG->rememberusername set to Yes.
15
    Given the following config values are set as admin:
16
      | rememberusername | 1 |
17
    And I am on homepage
18
    And I click on "Log in" "link" in the ".logininfo" "css_element"
19
    And I set the field "Username" to "teacher1"
20
    And I set the field "Password" to "teacher1"
21
    And I press "Log in"
22
    And I log out
23
    # Log out and check that the username was remembered.
24
    When I am on homepage
25
    And I click on "Log in" "link" in the ".logininfo" "css_element"
26
    Then the field "username" matches value "teacher1"
27
 
28
  # Given the user has logged in before and selected 'Remember username', when they log in again and unset 'Remember username', then
29
  # their username should be forgotten for future log in attempts.
30
  Scenario: Check that 'remember username' unsetting works without javascript for teachers.
31
    # Log in the first time with $CFG->rememberusername set to Optional.
32
    Given the following config values are set as admin:
33
      | rememberusername | 2 |
34
    And I am on homepage
35
    And I click on "Log in" "link" in the ".logininfo" "css_element"
36
    And I set the field "Username" to "teacher1"
37
    And I set the field "Password" to "teacher1"
38
    And I press "Log in"
39
    And I log out
40
    # Log in again, the username should have been remembered.
41
    When I am on homepage
42
    And I click on "Log in" "link" in the ".logininfo" "css_element"
43
    Then the field "username" matches value "teacher1"
44
    And I set the field "Password" to "teacher1"
45
    And I press "Log in"
46
    And I log out
47
    And the following config values are set as admin:
48
      | rememberusername | 0 |
49
    # Check username has been forgotten.
50
    And I am on homepage
51
    And I click on "Log in" "link" in the ".logininfo" "css_element"
52
    Then the field "username" matches value ""