| Línea 7... |
Línea 7... |
| 7 |
Background:
|
7 |
Background:
|
| 8 |
Given the following "users" exist:
|
8 |
Given the following "users" exist:
|
| 9 |
| username | firstname | lastname | email |
|
9 |
| username | firstname | lastname | email |
|
| 10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
| 11 |
| student1 | Student | 1 | student1@example.com |
|
11 |
| student1 | Student | 1 | student1@example.com |
|
| - |
|
12 |
| student2 | Student | 2 | student2@example.com |
|
| 12 |
And the following "courses" exist:
|
13 |
And the following "courses" exist:
|
| 13 |
| fullname | shortname | format |
|
14 |
| fullname | shortname | format |
|
| 14 |
| Course 1 | C1 | topics |
|
15 |
| Course 1 | C1 | topics |
|
| 15 |
And the following "course enrolments" exist:
|
16 |
And the following "course enrolments" exist:
|
| 16 |
| user | course | role |
|
17 |
| user | course | role |
|
| Línea 39... |
Línea 40... |
| 39 |
And I am on "Course 1" course homepage
|
40 |
And I am on "Course 1" course homepage
|
| 40 |
And I press "Enrol me"
|
41 |
And I press "Enrol me"
|
| 41 |
Then I should see "New section"
|
42 |
Then I should see "New section"
|
| 42 |
And I should not see "Enrolment options"
|
43 |
And I should not see "Enrolment options"
|
| Línea -... |
Línea 44... |
| - |
|
44 |
|
| 43 |
|
45 |
@javascript
|
| 44 |
Scenario: Self-enrolment enabled requiring an enrolment key
|
46 |
Scenario: Self-enrolment enabled requiring an enrolment key
|
| 45 |
Given I log in as "teacher1"
|
47 |
Given I log in as "teacher1"
|
| 46 |
When I add "Self enrolment" enrolment method in "Course 1" with:
|
48 |
When I add "Self enrolment" enrolment method in "Course 1" with:
|
| 47 |
| Custom instance name | Test student enrolment |
|
49 |
| Custom instance name | Test student enrolment |
|
| 48 |
| Enrolment key | moodle_rules |
|
50 |
| Enrolment key | moodle_rules |
|
| 49 |
And I log out
|
51 |
And I log out
|
| 50 |
And I log in as "student1"
|
52 |
And I log in as "student1"
|
| - |
|
53 |
And I am on "Course 1" course homepage
|
| - |
|
54 |
And I should see "An enrolment key will be required."
|
| 51 |
And I am on "Course 1" course homepage
|
55 |
And I press "Enrol me"
|
| 52 |
And I set the following fields to these values:
|
56 |
And I set the following fields to these values:
|
| 53 |
| Enrolment key | moodle_rules |
|
57 |
| Enrolment key | moodle_rules |
|
| 54 |
And I press "Enrol me"
|
58 |
And I click on "Enrol me" "button" in the "Test student enrolment" "dialogue"
|
| 55 |
Then I should see "New section"
|
59 |
Then I should see "New section"
|
| 56 |
And I should not see "Enrolment options"
|
60 |
And I should not see "Enrolment options"
|
| Línea 57... |
Línea 61... |
| 57 |
And I should not see "Enrol me in this course"
|
61 |
And I should not see "Enrol me in this course"
|
| 58 |
|
62 |
|
| 59 |
Scenario: Self-enrolment disabled
|
63 |
Scenario: Self-enrolment disabled
|
| 60 |
Given I log in as "student1"
|
64 |
Given I log in as "student1"
|
| Línea -... |
Línea 65... |
| - |
|
65 |
When I am on "Course 1" course homepage
|
| 61 |
When I am on "Course 1" course homepage
|
66 |
Then I should see "You cannot enrol yourself in this course"
|
| 62 |
Then I should see "You cannot enrol yourself in this course"
|
67 |
|
| 63 |
|
68 |
@javascript
|
| 64 |
Scenario: Self-enrolment enabled requiring a group enrolment key
|
69 |
Scenario: Self-enrolment enabled requiring a group enrolment key
|
| 65 |
Given I log in as "teacher1"
|
70 |
Given I log in as "teacher1"
|
| 66 |
When I add "Self enrolment" enrolment method in "Course 1" with:
|
71 |
When I add "Self enrolment" enrolment method in "Course 1" with:
|
| 67 |
| Custom instance name | Test student enrolment |
|
72 |
| Custom instance name | Test student enrolment |
|
| 68 |
| Enrolment key | moodle_rules |
|
73 |
| Enrolment key | moodle_rules |
|
| 69 |
| Use group enrolment keys | Yes |
|
74 |
| Use group enrolment keys | Yes |
|
| 70 |
And I am on the "Course 1" "groups" page
|
75 |
And I am on the "Course 1" "groups" page
|
| 71 |
And I press "Create group"
|
76 |
And I press "Create group"
|
| 72 |
And I set the following fields to these values:
|
77 |
And I set the following fields to these values:
|
| 73 |
| Group name | Group 1 |
|
78 |
| Group name | Group 1 |
|
| 74 |
| Enrolment key | Test-groupenrolkey1 |
|
79 |
| Enrolment key | Test-groupenrolkey1 |
|
| 75 |
And I press "Save changes"
|
80 |
And I press "Save changes"
|
| - |
|
81 |
And I log out
|
| 76 |
And I log out
|
82 |
And I log in as "student1"
|
| 77 |
And I log in as "student1"
|
83 |
And I am on "Course 1" course homepage
|
| 78 |
And I am on "Course 1" course homepage
|
84 |
And I press "Enrol me"
|
| 79 |
And I set the following fields to these values:
|
85 |
And I set the following fields to these values:
|
| 80 |
| Enrolment key | Test-groupenrolkey1 |
|
86 |
| Enrolment key | Test-groupenrolkey1 |
|
| 81 |
And I press "Enrol me"
|
87 |
And I click on "Enrol me" "button" in the "Test student enrolment" "dialogue"
|
| - |
|
88 |
Then I should see "New section"
|
| - |
|
89 |
And I should not see "Enrolment options"
|
| - |
|
90 |
And I should not see "Enrol me in this course"
|
| - |
|
91 |
And I am on the "Course 1" course page logged in as student2
|
| - |
|
92 |
And I press "Enrol me"
|
| - |
|
93 |
And I set the following fields to these values:
|
| - |
|
94 |
| Enrolment key | moodle_rules |
|
| - |
|
95 |
And I click on "Enrol me" "button" in the "Test student enrolment" "dialogue"
|
| - |
|
96 |
And I am on the "Course 1" course page logged in as teacher1
|
| - |
|
97 |
And I navigate to course participants
|
| - |
|
98 |
And the following should exist in the "participants" table:
|
| Línea 82... |
Línea 99... |
| 82 |
Then I should see "New section"
|
99 |
| First name | Email address | Roles | Groups |
|
| 83 |
And I should not see "Enrolment options"
|
100 |
| Student 1 | student1@example.com | Student | Group 1 |
|
| 84 |
And I should not see "Enrol me in this course"
|
101 |
| Student 2 | student2@example.com | Student | No groups |
|
| 85 |
|
102 |
|