Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@enrol @ewallah @enrol_coursecompleted @javascript
2
Feature: Duration Enrolment on course completion
3
 
4
  Background:
5
    Given the following "courses" exist:
6
      | fullname | shortname | enablecompletion |
7
      | Course 1 | C1        | 1                |
8
      | Course 2 | C2        | 1                |
9
    And the following "users" exist:
10
      | username |
11
      | user1    |
12
      | teacher1 |
13
    And the following "course enrolments" exist:
14
      | user     | course | role           |
15
      | user1    | C1     | student        |
16
      | teacher1 | C1     | editingteacher |
17
      | teacher1 | C2     | editingteacher |
18
    And the following config values are set as admin:
19
      | expiredaction | Unenrol user from course | enrol_coursecompleted |
20
    And I log in as "admin"
21
    And I navigate to "Plugins > Enrolments > Manage enrol plugins" in site administration
22
    And I click on "Enable" "link" in the "Course completed enrolment" "table_row"
23
    And I am on "Course 1" course homepage
24
    And I navigate to "Course completion" in current page administration
25
    And I expand all fieldsets
26
    And I set the field "Teacher" to "1"
27
    And I press "Save changes"
28
    And I add "Course completed enrolment" enrolment method in "Course 2" with:
29
       | Course                  | Course 1 |
30
       | id_enrolperiod_enabled  | 1        |
31
       | id_enrolperiod_number   | 3        |
32
       | id_enrolperiod_timeunit | seconds  |
33
    And I log out
34
 
35
  Scenario: Guest users see basic coursecompleted enrolment info.
36
    Given I log in as "guest"
37
    And I am on course index
38
    When I follow "Course 2"
39
    Then I should see "You will be enrolled in this course when you complete course"
40
 
41
  Scenario: Normal students see basic coursecompleted enrolment info.
42
    Given I log in as "user1"
43
    And I am on course index
44
    When I follow "Course 2"
45
    Then I should see "You will be enrolled in this course when you complete course"
46
 
47
  Scenario: Course completion with duration set
48
    Given I am on the "C2" "Course" page logged in as "teacher1"
49
    And I navigate to course participants
50
    And I should see "1 participants found"
51
    And I am on "Course 2" course homepage
52
    And I am on the "C1" "Course" page logged in as "teacher1"
53
    And I navigate to "Reports" in current page administration
54
    And I click on "Course completion" "link" in the "region-main" "region"
55
    When I follow "Click to mark user complete"
56
    And I wait "1" seconds
57
    And I run the scheduled task "core\task\completion_regular_task"
58
    And I run all adhoc tasks
59
    And I am on "Course 2" course homepage
60
    And I navigate to course participants
61
    Then I should see "2 participants found"
62
    And I wait "4" seconds
63
    And I run the scheduled task "\enrol_coursecompleted\task\process_expirations"
64
    And I am on "Course 2" course homepage
65
    And I navigate to course participants
66
    And I should see "2 participants found"
67
    But I should see "Not current"
68
    And I log out
69
    # When the enrolment is over, students should not have access.
70
    And I log in as "user1"
71
    And I am on course index
72
    And I follow "Course 2"
73
    And I should see "You will be enrolled in this course when you complete course"