0a7390163fd2f5eafdcbc1c8c036b6c1a0546e0b
[moodle.git] / completion / tests / behat / teacher_manual_completion.feature
1 @core @core_completion
2 Feature: Allow teachers to manually mark users as complete when configured
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
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"
20     And I am on site homepage
21     And I follow "Completion course"
22     And completion tracking is "Enabled" in current course
23     And I follow "Course completion"
24     And I set the field "Teacher" to "1"
25     And I press "Save changes"
26     And I turn editing mode on
27     And I add the "Course completion status" block
28     And I log out
29     And I log in as "student1"
30     And I am on site homepage
31     And I follow "Completion course"
32     And I should see "Status: Not yet started"
33     And I log out
34     When I log in as "teacher1"
35     And I am on site homepage
36     And I follow "Completion course"
37     And I follow "View course report"
38     And I should see "Student First"
39     And I follow "Click to mark user complete"
40     # Running cron just after clicking sometimes fail, as record
41     # should be created before the cron runs.
42     And I wait "1" seconds
43     And I trigger cron
44     And I am on site homepage
45     And I log out
46     Then I log in as "student1"
47     And I am on site homepage
48     And I follow "Completion course"
49     And I should see "Status: Complete"