AutorÃa | Ultima modificación | Ver Log |
@enrol @ewallah @enrol_coursecompleted @javascriptFeature: Duration Enrolment on course completionBackground:Given the following "courses" exist:| fullname | shortname | enablecompletion || Course 1 | C1 | 1 || Course 2 | C2 | 1 |And the following "users" exist:| username || user1 || teacher1 |And the following "course enrolments" exist:| user | course | role || user1 | C1 | student || teacher1 | C1 | editingteacher || teacher1 | C2 | editingteacher |And the following config values are set as admin:| expiredaction | Unenrol user from course | enrol_coursecompleted |And I log in as "admin"And I navigate to "Plugins > Enrolments > Manage enrol plugins" in site administrationAnd I click on "Enable" "link" in the "Course completed enrolment" "table_row"And I am on "Course 1" course homepageAnd I navigate to "Course completion" in current page administrationAnd I expand all fieldsetsAnd I set the field "Teacher" to "1"And I press "Save changes"And I add "Course completed enrolment" enrolment method in "Course 2" with:| Course | Course 1 || id_enrolperiod_enabled | 1 || id_enrolperiod_number | 3 || id_enrolperiod_timeunit | seconds |And I log outScenario: Guest users see basic coursecompleted enrolment info.Given I log in as "guest"And I am on course indexWhen I follow "Course 2"Then I should see "You will be enrolled in this course when you complete course"Scenario: Normal students see basic coursecompleted enrolment info.Given I log in as "user1"And I am on course indexWhen I follow "Course 2"Then I should see "You will be enrolled in this course when you complete course"Scenario: Course completion with duration setGiven I am on the "C2" "Course" page logged in as "teacher1"And I navigate to course participantsAnd I should see "1 participants found"And I am on "Course 2" course homepageAnd I am on the "C1" "Course" page logged in as "teacher1"And I navigate to "Reports" in current page administrationAnd I click on "Course completion" "link" in the "region-main" "region"When I follow "Click to mark user complete"And I wait "1" secondsAnd I run the scheduled task "core\task\completion_regular_task"And I run all adhoc tasksAnd I am on "Course 2" course homepageAnd I navigate to course participantsThen I should see "2 participants found"And I wait "4" secondsAnd I run the scheduled task "\enrol_coursecompleted\task\process_expirations"And I am on "Course 2" course homepageAnd I navigate to course participantsAnd I should see "2 participants found"But I should see "Not current"And I log out# When the enrolment is over, students should not have access.And I log in as "user1"And I am on course indexAnd I follow "Course 2"And I should see "You will be enrolled in this course when you complete course"