Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@auth @auth_email
2
Feature: User must accept policy when logging in and signing up
3
  In order to record user agreement to use the site
4
  As a user
5
  I need to be able to accept site policy during sign up
6
 
7
  Scenario: Accept policy on sign up, no site policy
8
    Given the following config values are set as admin:
9
      | registerauth    | email |
10
      | passwordpolicy  | 0     |
11
    And I am on site homepage
12
    And I follow "Log in"
13
    When I click on "Create new account" "link"
14
    Then I should not see "I understand and agree"
15
    And I set the following fields to these values:
16
      | Username      | user1                 |
17
      | Password      | user1                 |
18
      | Email address | user1@address.invalid |
19
      | Email (again) | user1@address.invalid |
20
      | First name    | User1                 |
21
      | Last name     | L1                    |
22
    And I press "Create my new account"
23
    And I should see "Confirm your account"
24
    And I should see "An email should have been sent to your address at user1@address.invalid"
25
    And I confirm email for "user1"
26
    And I should see "Thanks, User1 L1"
27
    And I should see "Your registration has been confirmed"
28
    And I open my profile in edit mode
29
    And the field "First name" matches value "User1"
30
    And I log out
31
    # Confirm that user can login and browse the site (edit their profile).
32
    And I log in as "user1"
33
    And I open my profile in edit mode
34
    And the field "First name" matches value "User1"
35
 
36
  Scenario: Accept policy on sign up, with site policy
37
    Given the following config values are set as admin:
38
      | registerauth    | email              |
39
      | passwordpolicy  | 0                  |
40
      | sitepolicy      | https://moodle.org |
41
    And I am on site homepage
42
    And I follow "Log in"
43
    When I click on "Create new account" "link"
44
    Then the field "I understand and agree" matches value "0"
45
    And I set the following fields to these values:
46
      | Username      | user1                 |
47
      | Password      | user1                 |
48
      | Email address | user1@address.invalid |
49
      | Email (again) | user1@address.invalid |
50
      | First name    | User1                 |
51
      | Last name     | L1                    |
52
      | I understand and agree | 1            |
53
    And I press "Create my new account"
54
    And I should see "Confirm your account"
55
    And I should see "An email should have been sent to your address at user1@address.invalid"
56
    And I confirm email for "user1"
57
    And I should see "Thanks, User1 L1"
58
    And I should see "Your registration has been confirmed"
59
    And I open my profile in edit mode
60
    And the field "First name" matches value "User1"
61
    And I log out
62
    # Confirm that user is not asked to agree to site policy again after the next login.
63
    And I log in as "user1"
64
    And I open my profile in edit mode
65
    And the field "First name" matches value "User1"
66
 
67
  Scenario Outline: Email validation during email registration
68
    Given the following config values are set as admin:
69
      | allowaccountssameemail | <allowsameemail> |
70
      | registerauth           | email              |
71
      | passwordpolicy         | 0                  |
72
    And the following "users" exist:
73
      | username | firstname | lastname | email          |
74
      | s1       | John      | Doe      | s1@example.com |
75
    And I am on site homepage
76
    And I follow "Log in"
77
    When I click on "Create new account" "link"
78
    And I set the following fields to these values:
79
      | Username      | s2      |
80
      | Password      | test    |
81
      | Email address | <email1> |
82
      | Email (again) | <email2> |
83
      | First name    | Jane    |
84
      | Last name     | Doe     |
85
    And I press "Create my new account"
86
    Then I should <expect> "This email address is already registered. Perhaps you created an account in the past?"
87
    And I should <expect2> "Invalid email address"
88
 
89
    Examples:
90
      | allowsameemail | email1         | email2         | expect  | expect2 |
91
      | 0              | s1@example.com | s1@example.com | see     | not see |
92
      | 0              | S1@EXAMPLE.COM | S1@EXAMPLE.COM | see     | not see |
93
      | 0              | s1@example.com | S1@EXAMPLE.COM | see     | not see |
94
      | 0              | s2@example.com | s1@example.com | not see | see     |
95
      | 1              | s1@example.com | s1@example.com | not see | not see |
96
      | 1              | S1@EXAMPLE.COM | S1@EXAMPLE.COM | not see | not see |
97
      | 1              | s1@example.com | S1@EXAMPLE.COM | not see | not see |
98
      | 1              | s1@example.com | s2@example.com | not see | see     |