Merge branch 'MDL-53140-master' of git://github.com/rezaies/moodle
[moodle.git] / completion / tests / behat / completion_course_page_checkboxes.feature
CommitLineData
d6cea5cc
AB
1@core @core_completion
2Feature: Show activity completion status or activity completion configuration on the course page
3 In order to understand the configuration or status of an activity's completion
4 As a user
5 I want to see an appropriate checkbox icon besides the activity
6
7 Background:
8 Given the following "courses" exist:
9 | fullname | shortname | category |
10 | Course 1 | C1 | 0 |
11 And the following "users" exist:
12 | username | firstname | lastname | email |
13 | teacher1 | Teacher | First | teacher1@example.com |
14 | teacher2 | Teacher | Second | teacher2@example.com |
15 | student1 | Student | First | student1@example.com |
16 And the following "course enrolments" exist:
17 | user | course | role |
18 | teacher1 | C1 | editingteacher |
19 | teacher2 | C1 | teacher |
20 | student1 | C1 | student |
21 And I log in as "teacher1"
22 And I am on "Course 1" course homepage with editing mode on
23 And I navigate to "Edit settings" in current page administration
24 And I set the following fields to these values:
25 | Enable completion tracking | Yes |
26 And I press "Save and display"
27 And the following "activities" exist:
28 | activity | course | idnumber | name | intro | completion | completionview | completionexpected |
29 | forum | C1 | forum1 | Test forum name | Test forum description | 1 | 0 | 0 |
30 And the following "activities" exist:
31 | activity | course | idnumber | name | intro | completion | completionview | completionexpected |
32 | assign | C1 | assign1 | Test assignment name | Test assignment description | 2 | 1 | 0 |
33 And the following "activities" exist:
34 | activity | course | idnumber | name | intro | completion | completionview | completionexpected |
35 | quiz | C1 | quiz1 | Test quiz name | Test quiz description | 0 | 0 | 0 |
36 And I log out
37
38 Scenario: Show completion status to students
39 Given I log in as "student1"
40 And I am on "Course 1" course homepage
41 Then I should see "Your progress"
42 And the "Test forum name" "Forum" activity with "manual" completion shows a status completion checkbox
43 And the "Test assignment name" "Assign" activity with "auto" completion shows a status completion checkbox
44 And the "Test quiz name" "Quiz" activity does not show any completion checkbox
45
46 Scenario: Show completion configuration to editing teachers
47 Given I log in as "teacher1"
48 And I am on "Course 1" course homepage
49 Then I should not see "Your progress"
50 And the "Test forum name" "Forum" activity with "manual" completion shows a configuration completion checkbox
51 And the "Test assignment name" "Assign" activity with "auto" completion shows a configuration completion checkbox
52 And the "Test quiz name" "Quiz" activity does not show any completion checkbox
53 And I am on "Course 1" course homepage with editing mode on
54 And I should not see "Your progress"
55 And the "Test forum name" "Forum" activity with "manual" completion shows a configuration completion checkbox
56 And the "Test assignment name" "Assign" activity with "auto" completion shows a configuration completion checkbox
57 And the "Test quiz name" "Quiz" activity does not show any completion checkbox
58
59 Scenario: Show completion configuration to non-editing teachers
60 Given I log in as "teacher2"
61 And I am on "Course 1" course homepage
62 Then I should not see "Your progress"
63 And the "Test forum name" "Forum" activity with "manual" completion shows a configuration completion checkbox
64 And the "Test assignment name" "Assign" activity with "auto" completion shows a configuration completion checkbox
65 And the "Test quiz name" "Quiz" activity does not show any completion checkbox