Merge branch 'MDL-53140-master' of git://github.com/rezaies/moodle
[moodle.git] / completion / tests / behat / teacher_manual_completion.feature
CommitLineData
37ee40f3
AB
1@core @core_completion
2Feature: Allow teachers to manually mark users as complete when configured
95d1a366
DM
3 In order for teachers to mark students as complete
4 As a teacher
5 I need to be able to use the completion report mark complete functionality
37ee40f3 6
95d1a366
DM
7 Scenario: Mark a student as complete using the completion report
8 Given the following "courses" exist:
9 | fullname | shortname | category |
10 | Completion course | CC1 | 0 |
11 And the following "users" exist:
12 | username | firstname | lastname | email |
13 | student1 | Student | First | student1@example.com |
14 | teacher1 | Teacher | First | teacher1@example.com |
15 And the following "course enrolments" exist:
16 | user | course | role |
17 | student1 | CC1 | student |
18 | teacher1 | CC1 | editingteacher |
19 And I log in as "admin"
fdeeaff9 20 And I am on "Completion course" course homepage
95d1a366
DM
21 And completion tracking is "Enabled" in current course
22 And I follow "Course completion"
23 And I set the field "Teacher" to "1"
24 And I press "Save changes"
25 And I turn editing mode on
26 And I add the "Course completion status" block
27 And I log out
28 And I log in as "student1"
fdeeaff9 29 And I am on "Completion course" course homepage
95d1a366
DM
30 And I should see "Status: Not yet started"
31 And I log out
32 When I log in as "teacher1"
fdeeaff9 33 And I am on "Completion course" course homepage
95d1a366
DM
34 And I follow "View course report"
35 And I should see "Student First"
36 And I follow "Click to mark user complete"
442a3651
RT
37 # Running completion task just after clicking sometimes fail, as record
38 # should be created before the task runs.
8509c470 39 And I wait "1" seconds
442a3651 40 And I run the scheduled task "core\task\completion_regular_task"
39030d8d 41 And I am on site homepage
95d1a366
DM
42 And I log out
43 Then I log in as "student1"
fdeeaff9 44 And I am on "Completion course" course homepage
95d1a366 45 And I should see "Status: Complete"