1 |
efrain |
1 |
@enrol @ewallah @enrol_coursecompleted
|
|
|
2 |
Feature: Learnpaths with course completion enrolment
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "courses" exist:
|
|
|
6 |
| fullname | shortname | startdate | enddate | enablecompletion |
|
|
|
7 |
| Course 1 | C1 | ##yesterday## | ##tomorrow## | 1 |
|
|
|
8 |
| Course 2 | C2 | ##tomorrow## | ##last day of next month## | 1 |
|
|
|
9 |
| Course 3 | C3 | ##tomorrow## | ##last day of next month## | 1 |
|
|
|
10 |
| Course 4 | C4 | ##tomorrow## | ##last day of next month## | 1 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username |
|
|
|
13 |
| user1 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| user1 | C1 | student |
|
|
|
17 |
And I log in as "admin"
|
|
|
18 |
And I navigate to "Plugins > Enrolments > Manage enrol plugins" in site administration
|
|
|
19 |
And I click on "Disable" "link" in the "Guest access" "table_row"
|
|
|
20 |
And I click on "Disable" "link" in the "Self enrolment" "table_row"
|
|
|
21 |
And I click on "Disable" "link" in the "Cohort sync" "table_row"
|
|
|
22 |
And I click on "Enable" "link" in the "Course completed enrolment" "table_row"
|
|
|
23 |
|
|
|
24 |
@javascript
|
|
|
25 |
Scenario: Learning paths with course completion enrolments
|
|
|
26 |
Given I am on the "Course 2" "enrolment methods" page
|
|
|
27 |
And I select "Course completed enrolment" from the "Add method" singleselect
|
|
|
28 |
And I set the following fields to these values:
|
|
|
29 |
| Course | Course 1 |
|
|
|
30 |
And I press "Add method"
|
|
|
31 |
And I am on the "Course 3" "enrolment methods" page
|
|
|
32 |
And I select "Course completed enrolment" from the "Add method" singleselect
|
|
|
33 |
And I set the following fields to these values:
|
|
|
34 |
| Course | Course 2 |
|
|
|
35 |
And I press "Add method"
|
|
|
36 |
And I am on the "Course 4" "enrolment methods" page
|
|
|
37 |
And I select "Course completed enrolment" from the "Add method" singleselect
|
|
|
38 |
And I set the following fields to these values:
|
|
|
39 |
| Course | Course 3 |
|
|
|
40 |
And I press "Add method"
|
|
|
41 |
And I am on "Course 4" course homepage
|
|
|
42 |
And I log out
|
|
|
43 |
When I am on the "C2" "Course" page logged in as "user1"
|
|
|
44 |
Then I should see "You will be enrolled in this course when"
|
|
|
45 |
And I am on the "C3" "Course" page
|
|
|
46 |
Then I should see "You will be enrolled in this course when"
|
|
|
47 |
And I am on the "C3" "Course" page
|
|
|
48 |
Then I should see "You will be enrolled in this course when"
|