1 |
efrain |
1 |
@core @core_group
|
|
|
2 |
Feature: Private groups
|
|
|
3 |
As a teacher
|
|
|
4 |
In order to organise students into groups while protecting their privacy
|
|
|
5 |
I want to define groups that are not visible to all students
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | format | enablecompletion | numsections |
|
|
|
10 |
| Course 1 | C1 | topics | 1 | 3 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname |
|
|
|
13 |
| teacher1 | Teacher | Teacher |
|
|
|
14 |
| student1 | Student | 1 |
|
|
|
15 |
| student2 | Student | 2 |
|
|
|
16 |
| student3 | Student | 3 |
|
|
|
17 |
| student4 | Student | 4 |
|
|
|
18 |
| student5 | Student | 5 |
|
|
|
19 |
| student6 | Student | 6 |
|
|
|
20 |
| student7 | Student | 7 |
|
|
|
21 |
| student8 | Student | 8 |
|
|
|
22 |
And the following "course enrolments" exist:
|
|
|
23 |
| user | course | role |
|
|
|
24 |
| teacher1 | C1 | editingteacher |
|
|
|
25 |
| student1 | C1 | student |
|
|
|
26 |
| student2 | C1 | student |
|
|
|
27 |
| student3 | C1 | student |
|
|
|
28 |
| student4 | C1 | student |
|
|
|
29 |
| student5 | C1 | student |
|
|
|
30 |
| student6 | C1 | student |
|
|
|
31 |
| student7 | C1 | student |
|
|
|
32 |
| student8 | C1 | student |
|
|
|
33 |
And the following "groups" exist:
|
|
|
34 |
| name | course | idnumber | visibility | participation |
|
|
|
35 |
| Visible/Participation | C1 | VP | 0 | 1 |
|
|
|
36 |
| Only visible to members/Participation | C1 | MP | 1 | 1 |
|
|
|
37 |
| Only see own membership | C1 | O | 2 | 0 |
|
|
|
38 |
| Not visible | C1 | N | 3 | 0 |
|
|
|
39 |
| Visible/Non-Participation | C1 | VN | 0 | 0 |
|
|
|
40 |
| Only visible to members/Non-Participation | C1 | MN | 1 | 0 |
|
|
|
41 |
And the following "group members" exist:
|
|
|
42 |
| user | group |
|
|
|
43 |
| student1 | VP |
|
|
|
44 |
| student1 | VN |
|
|
|
45 |
| student2 | MP |
|
|
|
46 |
| student2 | MN |
|
|
|
47 |
| student3 | O |
|
|
|
48 |
| student4 | N |
|
|
|
49 |
| student5 | VP |
|
|
|
50 |
| student5 | VN |
|
|
|
51 |
| student6 | MP |
|
|
|
52 |
| student6 | MN |
|
|
|
53 |
| student7 | O |
|
|
|
54 |
| student8 | N |
|
|
|
55 |
|
|
|
56 |
Scenario: Participants in "Visible" groups see their membership and other members:
|
|
|
57 |
Given I am on the "C1" "enrolled users" page logged in as "student1"
|
|
|
58 |
Then the following should exist in the "participants" table:
|
|
|
59 |
| First name / Surname | Groups |
|
|
|
60 |
| Student 1 | Visible/Non-Participation, Visible/Participation |
|
|
|
61 |
| Student 2 | No groups |
|
|
|
62 |
| Student 3 | No groups |
|
|
|
63 |
| Student 4 | No groups |
|
|
|
64 |
| Student 5 | Visible/Non-Participation, Visible/Participation |
|
|
|
65 |
| Student 6 | No groups |
|
|
|
66 |
| Student 7 | No groups |
|
|
|
67 |
| Student 8 | No groups |
|
|
|
68 |
|
|
|
69 |
Scenario: Participants in "Only visible to members" groups see their membership and other members, plus "Visible"
|
|
|
70 |
Given I am on the "C1" "enrolled users" page logged in as "student2"
|
|
|
71 |
Then the following should exist in the "participants" table:
|
|
|
72 |
| First name / Surname | Groups |
|
|
|
73 |
| Student 1 | Visible/Non-Participation, Visible/Participation |
|
|
|
74 |
| Student 2 | Only visible to members/Non-Participation, Only visible to members/Participation |
|
|
|
75 |
| Student 3 | No groups |
|
|
|
76 |
| Student 4 | No groups |
|
|
|
77 |
| Student 5 | Visible/Non-Participation, Visible/Participation |
|
|
|
78 |
| Student 6 | Only visible to members/Non-Participation, Only visible to members/Participation |
|
|
|
79 |
| Student 7 | No groups |
|
|
|
80 |
| Student 8 | No groups |
|
|
|
81 |
|
|
|
82 |
Scenario: Participants in "Only see own membership" groups see their membership but not other members, plus "Visible"
|
|
|
83 |
Given I am on the "C1" "enrolled users" page logged in as "student3"
|
|
|
84 |
Then the following should exist in the "participants" table:
|
|
|
85 |
| First name / Surname | Groups |
|
|
|
86 |
| Student 1 | Visible/Non-Participation, Visible/Participation |
|
|
|
87 |
| Student 2 | No groups |
|
|
|
88 |
| Student 3 | Only see own membership |
|
|
|
89 |
| Student 4 | No groups |
|
|
|
90 |
| Student 5 | Visible/Non-Participation, Visible/Participation |
|
|
|
91 |
| Student 6 | No groups |
|
|
|
92 |
| Student 7 | No groups |
|
|
|
93 |
| Student 8 | No groups |
|
|
|
94 |
|
|
|
95 |
Scenario: Participants in "Not visible" groups do not see that group, do see "Visible"
|
|
|
96 |
Given I am on the "C1" "enrolled users" page logged in as "student4"
|
|
|
97 |
Then the following should exist in the "participants" table:
|
|
|
98 |
| First name / Surname | Groups |
|
|
|
99 |
| Student 1 | Visible/Non-Participation, Visible/Participation |
|
|
|
100 |
| Student 2 | No groups |
|
|
|
101 |
| Student 3 | No groups |
|
|
|
102 |
| Student 4 | No groups |
|
|
|
103 |
| Student 5 | Visible/Non-Participation, Visible/Participation |
|
|
|
104 |
| Student 6 | No groups |
|
|
|
105 |
| Student 7 | No groups |
|
|
|
106 |
| Student 8 | No groups |
|
|
|
107 |
|
|
|
108 |
Scenario: View participants list as a teacher:
|
|
|
109 |
Given I am on the "C1" "enrolled users" page logged in as "teacher1"
|
|
|
110 |
Then the following should exist in the "participants" table:
|
|
|
111 |
| First name / Surname | Groups |
|
|
|
112 |
| Student 1 | Visible/Non-Participation, Visible/Participation |
|
|
|
113 |
| Student 2 | Only visible to members/Non-Participation, Only visible to members/Participation |
|
|
|
114 |
| Student 3 | Only see own membership |
|
|
|
115 |
| Student 4 | Not visible |
|
|
|
116 |
| Student 5 | Visible/Non-Participation, Visible/Participation |
|
|
|
117 |
| Student 6 | Only visible to members/Non-Participation, Only visible to members/Participation |
|
|
|
118 |
| Student 7 | Only see own membership |
|
|
|
119 |
| Student 8 | Not visible |
|
|
|
120 |
|
|
|
121 |
@javascript
|
|
|
122 |
Scenario: Filtering by "Only see own membership" groups should not show other members.
|
|
|
123 |
Given I am on the "C1" "enrolled users" page logged in as "student3"
|
|
|
124 |
When I set the field "type" to "Groups"
|
|
|
125 |
And I set the field "Type or select..." to "Only see own membership"
|
|
|
126 |
And I click on "Apply filters" "button"
|
|
|
127 |
Then the following should exist in the "participants" table:
|
|
|
128 |
| First name / Surname | Groups |
|
|
|
129 |
| Student 3 | Only see own membership |
|
|
|
130 |
And the following should not exist in the "participants" table:
|
|
|
131 |
| First name / Surname | Groups |
|
|
|
132 |
| Student 7 | No groups |
|
|
|
133 |
|
|
|
134 |
@javascript
|
|
|
135 |
Scenario: Filtering by "No group" should show all users whose memberships I cannot see
|
|
|
136 |
Given I am on the "C1" "enrolled users" page logged in as "student3"
|
|
|
137 |
When I set the field "type" to "Groups"
|
|
|
138 |
And I set the field "Type or select..." to "No group"
|
|
|
139 |
And I click on "Apply filters" "button"
|
|
|
140 |
Then the following should exist in the "participants" table:
|
|
|
141 |
| First name / Surname | Groups |
|
|
|
142 |
| Student 2 | No groups |
|
|
|
143 |
| Student 4 | No groups |
|
|
|
144 |
| Student 6 | No groups |
|
|
|
145 |
| Student 7 | No groups |
|
|
|
146 |
| Student 8 | No groups |
|
|
|
147 |
|
|
|
148 |
@javascript
|
|
|
149 |
Scenario: Filtering by not a member of "Only see own membership" groups I am a member of should show everyone except me
|
|
|
150 |
Given I am on the "C1" "enrolled users" page logged in as "student3"
|
|
|
151 |
When I set the field "Match" in the "Filter 1" "fieldset" to "None"
|
|
|
152 |
And I set the field "type" to "Groups"
|
|
|
153 |
And I set the field "Type or select..." to "Only see own membership"
|
|
|
154 |
And I click on "Apply filters" "button"
|
|
|
155 |
Then the following should exist in the "participants" table:
|
|
|
156 |
| First name / Surname | Groups |
|
|
|
157 |
| Student 1 | Visible/Non-Participation, Visible/Participation |
|
|
|
158 |
| Student 2 | No groups |
|
|
|
159 |
| Student 4 | No groups |
|
|
|
160 |
| Student 5 | Visible/Non-Participation, Visible/Participation |
|
|
|
161 |
| Student 6 | No groups |
|
|
|
162 |
| Student 7 | No groups |
|
|
|
163 |
| Student 8 | No groups |
|
|
|
164 |
|
|
|
165 |
@javascript
|
|
|
166 |
Scenario: Filtering by not a member of "No group" should only show users whose memberships I can see
|
|
|
167 |
Given I am on the "C1" "enrolled users" page logged in as "student3"
|
|
|
168 |
When I set the field "Match" in the "Filter 1" "fieldset" to "None"
|
|
|
169 |
And I set the field "type" to "Groups"
|
|
|
170 |
And I set the field "Type or select..." to "No group"
|
|
|
171 |
And I click on "Apply filters" "button"
|
|
|
172 |
Then the following should exist in the "participants" table:
|
|
|
173 |
| First name / Surname | Groups |
|
|
|
174 |
| Student 1 | Visible/Non-Participation, Visible/Participation |
|
|
|
175 |
| Student 3 | Only see own membership |
|
|
|
176 |
| Student 5 | Visible/Non-Participation, Visible/Participation |
|