Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_forum
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
4
  As a user
5
  I need to distinct the unread posts from the read ones
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email | trackforums |
10
      | student1 | Student | 1 | student1@example.com | 1 |
11
      | student2 | Student | 2 | student2@example.com | 0 |
12
    And the following "courses" exist:
13
      | fullname | shortname | category |
14
      | Course 1 | C1 | 0 |
15
    And the following "course enrolments" exist:
16
      | user | course | role |
17
      | student1 | C1 | student |
18
      | student2 | C1 | student |
19
 
20
  Scenario: Tracking forum posts off
21
    Given the following "activity" exists:
22
      | activity      | forum                           |
23
      | course        | C1                              |
24
      | idnumber      | forum1                          |
25
      | type          | general                         |
26
      | name          | Test forum name                 |
27
      | trackingtype  | 0                               |
28
    And the following "mod_forum > discussion" exists:
29
      | forum   | forum1            |
30
      | course  | C1                |
31
      | user    | admin             |
32
      | name    | Test post subject |
33
      | message | Test post message |
34
    When I am on the "Course 1" course page logged in as student1
35
    Then I should not see "1 unread post"
36
    And I follow "Test forum name"
37
    And I should not see "Track unread posts"
38
 
39
  Scenario: Tracking forum posts optional with user tracking on
40
    Given the following "activity" exists:
41
      | activity     | forum                  |
42
      | course       | C1                     |
43
      | idnumber     | forum1                 |
44
      | name         | Test forum name        |
45
      | type         | general                |
46
      | trackingtype | 1                      |
47
    And the following "mod_forum > discussion" exists:
48
      | forum   | forum1            |
49
      | course  | C1                |
50
      | user    | admin             |
51
      | name    | Test post subject |
52
      | message | Test post message |
53
    When I am on the "Course 1" course page logged in as student1
54
    Then I should see "1 unread post"
55
    And I follow "Test forum name"
56
    And I follow "Don't track unread posts"
57
    And I wait to be redirected
58
    And I am on "Course 1" course homepage
59
    And I should not see "1 unread post"
60
    And I follow "Test forum name"
61
    And I follow "Track unread posts"
62
    And I wait to be redirected
63
    And I click on "1" "link" in the "Admin User" "table_row"
64
    And I am on "Course 1" course homepage
65
    And I should not see "1 unread post"
66
 
67
  Scenario: Tracking forum posts optional with user tracking off
68
    Given the following "activity" exists:
69
      | activity     | forum                       |
70
      | course       | C1                          |
71
      | idnumber     | 00001                       |
72
      | name         | Test forum name             |
73
      | type         | general                     |
74
      | trackingtype | 1                           |
75
    And the following "mod_forum > discussion" exists:
76
      | forum   | 00001             |
77
      | course  | C1                |
78
      | user    | admin             |
79
      | name    | Test post subject |
80
      | message | Test post message |
81
    When I am on the "Course 1" course page logged in as student2
82
    Then I should not see "1 unread post"
83
    And I follow "Test forum name"
84
    And I should not see "Track unread posts"
85
 
86
  Scenario: Tracking forum posts forced with user tracking on
87
    Given the following config values are set as admin:
88
      | forum_allowforcedreadtracking | 1 |
89
    And the following "activity" exists:
90
      | activity     | forum                       |
91
      | course       | C1                          |
92
      | idnumber     | 00001                       |
93
      | name         | Test forum name             |
94
      | type         | general                     |
95
      | trackingtype | 2                           |
96
    And the following "mod_forum > discussion" exists:
97
      | forum   | 00001            |
98
      | course  | C1                |
99
      | user    | admin             |
100
      | name    | Test post subject |
101
      | message | Test post message |
102
    When I am on the "Course 1" course page logged in as student1
103
    Then I should see "1 unread post"
104
    And I am on the "Test forum name" "forum activity" page
105
    And I should not see "Don't track unread posts"
106
    And I follow "Test post subject"
107
    And I am on "Course 1" course homepage
108
    And I should not see "1 unread post"
109
 
110
  Scenario: Tracking forum posts forced with user tracking off
111
    Given the following config values are set as admin:
112
      | forum_allowforcedreadtracking | 1 |
113
    And the following "activity" exists:
114
      | activity     | forum                       |
115
      | course       | C1                          |
116
      | idnumber     | 00001                       |
117
      | name         | Test forum name             |
118
      | type         | general                     |
119
      | trackingtype | 2                           |
120
    And the following "mod_forum > discussion" exists:
121
      | forum   | 00001             |
122
      | course  | C1                |
123
      | user    | admin             |
124
      | name    | Test post subject |
125
      | message | Test post message |
126
    When I am on the "Course 1" course page logged in as student2
127
    Then I should see "1 unread post"
128
    And I am on the "Test forum name" "forum activity" page
129
    And I should not see "Don't track unread posts"
130
    And I follow "Test post subject"
131
    And I am on "Course 1" course homepage
132
    And I should not see "1 unread post"
133
 
134
  Scenario: Tracking forum posts forced (with force disabled) with user tracking on
135
    Given the following config values are set as admin:
136
      | forum_allowforcedreadtracking | 1 |
137
    And the following "activity" exists:
138
      | activity     | forum                     |
139
      | course       | C1                        |
140
      | idnumber     | 00001                     |
141
      | name         | Test forum name           |
142
      | type         | general                   |
143
      | trackingtype | 2                         |
144
    And the following "mod_forum > discussion" exists:
145
      | forum   | 00001             |
146
      | course  | C1                |
147
      | user    | admin             |
148
      | name    | Test post subject |
149
      | message | Test post message |
150
    And the following config values are set as admin:
151
      | forum_allowforcedreadtracking | 0 |
152
    When I am on the "Course 1" course page logged in as student1
153
    Then I should see "1 unread post"
154
    And I follow "Test forum name"
155
    And I follow "Don't track unread posts"
156
    And I wait to be redirected
157
    And I am on "Course 1" course homepage
158
    And I should not see "1 unread post"
159
    And I follow "Test forum name"
160
    And I follow "Track unread posts"
161
    And I wait to be redirected
162
    And I click on "1" "link" in the "Admin User" "table_row"
163
    And I am on "Course 1" course homepage
164
    And I should not see "1 unread post"
165
 
166
  Scenario: Tracking forum posts forced (with force disabled) with user tracking off
167
    Given the following config values are set as admin:
168
      | forum_allowforcedreadtracking | 1 |
169
    And the following "activity" exists:
170
      | activity     | forum                  |
171
      | course       | C1                     |
172
      | idnumber     | 00001                  |
173
      | name         | Test forum name        |
174
      | type         | general                |
175
      | trackingtype | 2                      |
176
    And the following "mod_forum > discussion" exists:
177
      | forum   | 00001             |
178
      | course  | C1                |
179
      | user    | admin             |
180
      | name    | Test post subject |
181
      | message | Test post message |
182
    And the following config values are set as admin:
183
      | forum_allowforcedreadtracking | 0 |
184
    When I am on the "Course 1" course page logged in as student2
185
    Then I should not see "1 unread post"
186
    And I follow "Test forum name"
187
    And I should not see "Track unread posts"