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: Posting to all groups in a separate group discussion is restricted to users with access to all groups
3
  In order to post to all groups in a forum with separate groups
4
  As a teacher
5
  I need to have the accessallgroups capability
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher1 | Teacher | 1 | teacher1@example.com |
11
      | noneditor1 | Non-editing teacher | 1 | noneditor1@example.com |
12
      | noneditor2 | Non-editing teacher | 2 | noneditor2@example.com |
13
      | student1 | Student | 1 | student1@example.com |
14
      | student2 | Student | 2 | student2@example.com |
15
      | student3 | Student | 3 | student3@example.com |
16
      | student4 | Student | 4 | student4@example.com |
17
    And the following "courses" exist:
18
      | fullname | shortname | category |
19
      | Course 1 | C1 | 0 |
20
    And the following "course enrolments" exist:
21
      | user | course | role |
22
      | teacher1 | C1 | editingteacher |
23
      | noneditor1 | C1 | teacher |
24
      | noneditor2 | C1 | teacher |
25
      | student1 | C1 | student |
26
      | student2 | C1 | student |
27
      | student3 | C1 | student |
28
      | student4 | C1 | student |
29
    And the following "groups" exist:
30
      | name    | course | idnumber | participation |
31
      | Group A | C1     | G1       | 1             |
32
      | Group B | C1     | G2       | 1             |
33
      | Group C | C1     | G3       | 1             |
34
      | Group D | C1     | G4       | 0             |
35
    And the following "group members" exist:
36
      | user | group |
37
      | teacher1 | G1 |
38
      | teacher1 | G2 |
39
      | noneditor1 | G1 |
40
      | noneditor1 | G2 |
41
      | noneditor1 | G3 |
42
      | noneditor2 | G1 |
43
      | noneditor2 | G2 |
44
      | student1 | G1 |
45
      | student2 | G1 |
46
      | student2 | G2 |
47
      | student3 | G4 |
48
    And the following "activities" exist:
49
      | activity   | name                   | course | idnumber     | groupmode |
50
      | forum      | Standard forum name    | C1     | sepgroups    | 1         |
51
    And the following "mod_forum > discussions" exist:
52
      | forum     | name             | subject          | message          | group            |
53
      | sepgroups | Initial Disc ALL | Initial Disc ALL | Disc ALL content | All participants |
54
      | sepgroups | Initial Disc G1  | Initial Disc G1  | Disc G1 content  | G1               |
55
      | sepgroups | Initial Disc G2  | Initial Disc G2  | Disc G2 content  | G2               |
56
      | sepgroups | Initial Disc G3  | Initial Disc G3  | Disc G3 content  | G3               |
57
 
58
  Scenario: Teacher with accessallgroups can view all groups
59
    When I am on the "Standard forum name" "forum activity" page logged in as teacher1
60
    Then the "Separate groups" select box should contain "All participants"
61
    And the "Separate groups" select box should contain "Group A"
62
    And the "Separate groups" select box should contain "Group B"
63
    And the "Separate groups" select box should contain "Group C"
64
    And the "Separate groups" select box should not contain "Group D"
65
    And I select "All participants" from the "Separate groups" singleselect
66
    And I should see "Initial Disc ALL"
67
    And I should see "Initial Disc G1"
68
    And I should see "Initial Disc G2"
69
    And I should see "Initial Disc G2"
70
    And I select "Group A" from the "Separate groups" singleselect
71
    And I should see "Initial Disc ALL"
72
    And I should see "Initial Disc G1"
73
    But I should not see "Initial Disc G2"
74
    And I should not see "Initial Disc G3"
75
    And I select "Group B" from the "Separate groups" singleselect
76
    And I should see "Initial Disc ALL"
77
    And I should see "Initial Disc G2"
78
    But I should not see "Initial Disc G1"
79
    And I should not see "Initial Disc G3"
80
 
81
  Scenario: Teacher with accessallgroups can select any group when posting
82
    Given I am on the "Standard forum name" "forum activity" page logged in as teacher1
83
    When I click on "Add discussion topic" "link"
84
    And I click on "Advanced" "button"
85
    Then the "Group" select box should contain "All participants"
86
    And the "Group" select box should contain "Group A"
87
    And the "Group" select box should contain "Group B"
88
    And the "Group" select box should contain "Group C"
89
    And the "Group" select box should not contain "Group D"
90
    And I should see "Post a copy to all groups"
91
 
92
  Scenario: Teacher with accessallgroups can post in groups they are a member of
93
    Given I am on the "Standard forum name" "forum activity" page logged in as teacher1
94
    And I select "Group A" from the "Separate groups" singleselect
95
    When I click on "Add discussion topic" "link"
96
    And I click on "Advanced" "button"
97
    Then I should see "Post a copy to all groups"
98
    And I set the following fields to these values:
99
      | Subject | Teacher 1 -> Group B  |
100
      | Message | Teacher 1 -> Group B  |
101
      # Change the group in the post form.
102
      | Group   | Group B               |
103
    And I press "Post to forum"
104
    And I wait to be redirected
105
    # We should be redirected to the group that we selected when posting.
106
    And the field "Separate groups" matches value "Group B"
107
    And I should see "Group B" in the "Teacher 1 -> Group B" "table_row"
108
    And I should not see "Group A" in the "Teacher 1 -> Group B" "table_row"
109
    And I should not see "Group C" in the "Teacher 1 -> Group B" "table_row"
110
    # It should also be displayed under All participants
111
    And I select "All participants" from the "Separate groups" singleselect
112
    And I should see "Group B" in the "Teacher 1 -> Group B" "table_row"
113
    And I should not see "Group A" in the "Teacher 1 -> Group B" "table_row"
114
    And I should not see "Group C" in the "Teacher 1 -> Group B" "table_row"
115
    # It should not be displayed in Groups A, or C.
116
    And I select "Group A" from the "Separate groups" singleselect
117
    And I should not see "Teacher 1 -> Group B"
118
    And I select "Group C" from the "Separate groups" singleselect
119
    And I should not see "Teacher 1 -> Group B"
120
 
121
  Scenario: Teacher with accessallgroups can post in groups they are not a member of
122
    Given I am on the "Standard forum name" "forum activity" page logged in as teacher1
123
    And I select "Group A" from the "Separate groups" singleselect
124
    When I click on "Add discussion topic" "link"
125
    And I click on "Advanced" "button"
126
    Then I should see "Post a copy to all groups"
127
    And I set the following fields to these values:
128
      | Subject | Teacher 1 -> Group C  |
129
      | Message | Teacher 1 -> Group C  |
130
      | Group   | Group C               |
131
    And I press "Post to forum"
132
    And I wait to be redirected
133
    # We should be redirected to the group that we selected when posting.
134
    And the field "Separate groups" matches value "Group C"
135
    # We redirect to the group posted in automatically.
136
    And I should see "Group C" in the "Teacher 1 -> Group C" "table_row"
137
    And I should not see "Group A" in the "Teacher 1 -> Group C" "table_row"
138
    And I should not see "Group B" in the "Teacher 1 -> Group C" "table_row"
139
    # It should also be displayed under All participants
140
    And I select "All participants" from the "Separate groups" singleselect
141
    And I should see "Group C" in the "Teacher 1 -> Group C" "table_row"
142
    And I should not see "Group A" in the "Teacher 1 -> Group C" "table_row"
143
    And I should not see "Group B" in the "Teacher 1 -> Group C" "table_row"
144
    # It should not be displayed in Groups A, or B.
145
    And I select "Group A" from the "Separate groups" singleselect
146
    And I should not see "Teacher 1 -> Group C"
147
    And I select "Group B" from the "Separate groups" singleselect
148
    And I should not see "Teacher 1 -> Group C"
149
 
150
  Scenario: Teacher with accessallgroups can post to all groups
151
    Given I am on the "Standard forum name" "forum activity" page logged in as teacher1
152
    When I click on "Add discussion topic" "link"
153
    And I click on "Advanced" "button"
154
    And I set the following fields to these values:
155
      | Subject                   | Teacher 1 -> Post to all  |
156
      | Message                   | Teacher 1 -> Post to all  |
157
      | Post a copy to all groups | 1                       |
158
    And I press "Post to forum"
159
    And I wait to be redirected
160
    # Posting to all groups means that we should be redirected to the page we started from.
161
    And the field "Separate groups" matches value "All participants"
162
    And I select "Group A" from the "Separate groups" singleselect
163
    Then I should see "Group A" in the "Teacher 1 -> Post to all" "table_row"
164
    And I should not see "Group B" in the "Teacher 1 -> Post to all" "table_row"
165
    And I should not see "Group C" in the "Teacher 1 -> Post to all" "table_row"
166
    And I select "Group B" from the "Separate groups" singleselect
167
    And I should see "Group B" in the "Teacher 1 -> Post to all" "table_row"
168
    And I should not see "Group A" in the "Teacher 1 -> Post to all" "table_row"
169
    And I should not see "Group C" in the "Teacher 1 -> Post to all" "table_row"
170
    And I select "Group C" from the "Separate groups" singleselect
171
    And I should see "Group C" in the "Teacher 1 -> Post to all" "table_row"
172
    And I should not see "Group A" in the "Teacher 1 -> Post to all" "table_row"
173
    And I should not see "Group B" in the "Teacher 1 -> Post to all" "table_row"
174
    # No point testing the "All participants".
175
 
176
  Scenario: Students in one group can only post in their group
177
    When I am on the "Standard forum name" "forum activity" page logged in as student1
178
    Then I should see "Group A"
179
    And I click on "Add discussion topic" "link"
180
    And I should see "Group A"
181
    And I should not see "Group B"
182
    And I should not see "Group C"
183
    And I should not see "Post a copy to all groups"
184
    And I set the following fields to these values:
185
      | Subject | Student -> B |
186
      | Message | Student -> B |
187
    And I press "Post to forum"
188
    And I wait to be redirected
189
    And I should see "Group A" in the "Student -> B" "table_row"
190
    And I should not see "Group B" in the "Student -> B" "table_row"
191
 
192
  Scenario: Students in no group can see all group discussions, but not post.
193
    When I am on the "Standard forum name" "forum activity" page logged in as student4
194
    Then I should see "All participants"
195
    And I should see "Initial Disc ALL"
196
    And I should see "You are not able to create a discussion"
197
    And I should not see "Add discussion topic"
198
 
199
  Scenario: Students in non-participation groups can see all group discussions, but not post.
200
    When I am on the "Standard forum name" "forum activity" page logged in as student3
201
    Then I should see "All participants"
202
    And I should see "Initial Disc ALL"
203
    And I should see "You are not able to create a discussion"
204
    And I should not see "Add discussion topic"
205
 
206
  Scenario: Students in multiple group can post in all of their group individually
207
    When I am on the "Standard forum name" "forum activity" page logged in as student2
208
    And I select "Group A" from the "Separate groups" singleselect
209
    And I click on "Add discussion topic" "link"
210
    And I click on "Advanced" "button"
211
    And the "Group" select box should not contain "All participants"
212
    And the "Group" select box should contain "Group A"
213
    And the "Group" select box should contain "Group B"
214
    And the "Group" select box should not contain "Group C"
215
    And I should not see "Post a copy to all groups"
216
    And I set the following fields to these values:
217
      | Subject | Student -> B  |
218
      | Message | Student -> B  |
219
      | Group   | Group B       |
220
    And I press "Post to forum"
221
    And I wait to be redirected
222
    # We should be redirected to the group that we selected when posting.
223
    And the field "Separate groups" matches value "Group B"
224
    And I should see "Group B" in the "Student -> B" "table_row"
225
    And I should not see "Group A" in the "Student -> B" "table_row"
226
    And I select "Group A" from the "Separate groups" singleselect
227
    And I should not see "Student -> B"
228
    # Now try posting in Group A (starting at Group B)
229
    And I select "Group B" from the "Separate groups" singleselect
230
    And I click on "Add discussion topic" "link"
231
    And I click on "Advanced" "button"
232
    And the "Group" select box should not contain "All participants"
233
    And the "Group" select box should contain "Group A"
234
    And the "Group" select box should contain "Group B"
235
    And the "Group" select box should not contain "Group C"
236
    And I should not see "Post a copy to all groups"
237
    And I set the following fields to these values:
238
      | Subject | Student -> A  |
239
      | Message | Student -> A  |
240
      | Group   | Group A       |
241
    And I press "Post to forum"
242
    And I wait to be redirected
243
    # We should be redirected to the group that we selected when posting.
244
    And the field "Separate groups" matches value "Group A"
245
    And I should see "Group A" in the "Student -> A" "table_row"
246
    And I should not see "Group B" in the "Student -> A" "table_row"
247
    And I select "Group B" from the "Separate groups" singleselect
248
    And I should not see "Student -> A"
249
 
250
  Scenario: Teacher in all groups but without accessallgroups can only post in their groups
251
    Given I am on the "Standard forum name" "forum activity" page logged in as noneditor1
252
    When I click on "Add discussion topic" "link"
253
    And I click on "Advanced" "button"
254
    Then the "Group" select box should not contain "All participants"
255
    And the "Group" select box should contain "Group A"
256
    And the "Group" select box should contain "Group B"
257
    And I should see "Post a copy to all groups"
258
 
259
  Scenario: Teacher in some groups and without accessallgroups can only post in their groups
260
    Given I am on the "Standard forum name" "forum activity" page logged in as noneditor1
261
    When I click on "Add discussion topic" "link"
262
    And I click on "Advanced" "button"
263
    Then the "Group" select box should not contain "All participants"
264
    And the "Group" select box should contain "Group A"
265
    And the "Group" select box should contain "Group B"
266
    And I should see "Post a copy to all groups"
267
 
268
  Scenario: Students can view all participants discussions in separate groups mode
269
    When I am on the "Standard forum name" "forum activity" page logged in as student1
270
    Then I should see "Initial Disc ALL"