2 Feature: A teacher can set one of 3 possible options for tracking read forum posts
3 In order to ease the forum posts follow up
5 I need to distinct the unread posts from the read ones
8 Given the following "users" exists:
9 | username | firstname | lastname | email | trackforums |
10 | student1 | Student | 1 | student1@asd.com | 1 |
11 | student2 | Student | 2 | student2@asd.com | 0 |
12 And the following "courses" exists:
13 | fullname | shortname | category |
15 And the following "course enrolments" exists:
16 | user | course | role |
17 | student1 | C1 | student |
18 | student2 | C1 | student |
19 And I log in as "admin"
20 And I follow "Course 1"
21 And I turn editing mode on
24 Scenario: Tracking forum posts off
25 Given I add a "Forum" to section "1" and I fill the form with:
26 | Forum name | Test forum name |
27 | Forum type | Standard forum for general use |
28 | Description | Test forum description |
29 | Read tracking | Off |
30 And I add a new discussion to "Test forum name" forum with:
31 | Subject | Test post subject |
32 | Message | Test post message |
34 When I log in as "student1"
35 And I follow "Course 1"
36 Then I should not see "1 unread post"
37 And I follow "Test forum name"
38 And I should not see "Track unread posts"
41 Scenario: Tracking forum posts optional with user tracking on
42 Given I add a "Forum" to section "1" and I fill the form with:
43 | Forum name | Test forum name |
44 | Forum type | Standard forum for general use |
45 | Description | Test forum description |
46 | Read tracking | Optional |
47 And I add a new discussion to "Test forum name" forum with:
48 | Subject | Test post subject |
49 | Message | Test post message |
51 When I log in as "student1"
52 And I follow "Course 1"
53 Then I should see "1 unread post"
54 And I follow "Test forum name"
55 And I follow "Don't track unread posts"
56 And I wait to be redirected
57 And I follow "Course 1"
58 And I should not see "1 unread post"
59 And I follow "Test forum name"
60 And I follow "Track unread posts"
61 And I wait to be redirected
63 And I follow "Course 1"
64 And I should not see "1 unread post"
67 Scenario: Tracking forum posts optional with user tracking off
68 Given I add a "Forum" to section "1" and I fill the form with:
69 | Forum name | Test forum name |
70 | Forum type | Standard forum for general use |
71 | Description | Test forum description |
72 | Read tracking | Optional |
73 And I add a new discussion to "Test forum name" forum with:
74 | Subject | Test post subject |
75 | Message | Test post message |
77 When I log in as "student2"
78 And I follow "Course 1"
79 Then I should not see "1 unread post"
80 And I follow "Test forum name"
81 And I should not see "Track unread posts"
84 Scenario: Tracking forum posts forced with user tracking on
85 Given I set the following administration settings values:
86 | Allow forced read tracking | 1 |
88 And I follow "Course 1"
89 Given I add a "Forum" to section "1" and I fill the form with:
90 | Forum name | Test forum name |
91 | Forum type | Standard forum for general use |
92 | Description | Test forum description |
93 | Read tracking | Force |
94 And I add a new discussion to "Test forum name" forum with:
95 | Subject | Test post subject |
96 | Message | Test post message |
98 When I log in as "student1"
99 And I follow "Course 1"
100 Then I should see "1 unread post"
101 And I follow "1 unread post"
102 And I should not see "Don't track unread posts"
103 And I follow "Test post subject"
104 And I follow "Course 1"
105 And I should not see "1 unread post"
108 Scenario: Tracking forum posts forced with user tracking off
109 Given I set the following administration settings values:
110 | Allow forced read tracking | 1 |
112 And I follow "Course 1"
113 Given I add a "Forum" to section "1" and I fill the form with:
114 | Forum name | Test forum name |
115 | Forum type | Standard forum for general use |
116 | Description | Test forum description |
117 | Read tracking | Force |
118 And I add a new discussion to "Test forum name" forum with:
119 | Subject | Test post subject |
120 | Message | Test post message |
122 When I log in as "student2"
123 And I follow "Course 1"
124 Then I should see "1 unread post"
125 And I follow "1 unread post"
126 And I should not see "Don't track unread posts"
127 And I follow "Test post subject"
128 And I follow "Course 1"
129 And I should not see "1 unread post"
132 Scenario: Tracking forum posts forced (with force disabled) with user tracking on
133 Given I set the following administration settings values:
134 | Allow forced read tracking | 1 |
136 And I follow "Course 1"
137 Given I add a "Forum" to section "1" and I fill the form with:
138 | Forum name | Test forum name |
139 | Forum type | Standard forum for general use |
140 | Description | Test forum description |
141 | Read tracking | Force |
142 And I add a new discussion to "Test forum name" forum with:
143 | Subject | Test post subject |
144 | Message | Test post message |
145 And I set the following administration settings values:
146 | Allow forced read tracking | 0 |
148 When I log in as "student1"
149 And I follow "Course 1"
150 Then I should see "1 unread post"
151 And I follow "Test forum name"
152 And I follow "Don't track unread posts"
153 And I wait to be redirected
154 And I follow "Course 1"
155 And I should not see "1 unread post"
156 And I follow "Test forum name"
157 And I follow "Track unread posts"
158 And I wait to be redirected
160 And I follow "Course 1"
161 And I should not see "1 unread post"
164 Scenario: Tracking forum posts forced (with force disabled) with user tracking off
165 Given I set the following administration settings values:
166 | Allow forced read tracking | 1 |
168 And I follow "Course 1"
169 Given I add a "Forum" to section "1" and I fill the form with:
170 | Forum name | Test forum name |
171 | Forum type | Standard forum for general use |
172 | Description | Test forum description |
173 | Read tracking | Force |
174 And I add a new discussion to "Test forum name" forum with:
175 | Subject | Test post subject |
176 | Message | Test post message |
177 And I set the following administration settings values:
178 | Allow forced read tracking | 0 |
180 When I log in as "student2"
181 And I follow "Course 1"
182 Then I should not see "1 unread post"
183 And I follow "Test forum name"
184 And I should not see "Track unread posts"