1 |
efrain |
1 |
@core @core_user
|
|
|
2 |
Feature: View course participants groups
|
|
|
3 |
In order to know who is on a course
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to view the participants groups on a course
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1x | Teacher | 1x | teacher1x@example.com |
|
|
|
11 |
| student1x | Student | 1x | student1x@example.com |
|
|
|
12 |
| student2x | Student | 2x | student2x@example.com |
|
|
|
13 |
| student3x | Student | 3x | student3x@example.com |
|
|
|
14 |
| student4x | Student | 4x | student4x@example.com |
|
|
|
15 |
And the following "courses" exist:
|
|
|
16 |
| fullname | shortname | format | groupmode |
|
|
|
17 |
| Course 1 | C1 | topics | 1 |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| teacher1x | C1 | editingteacher |
|
|
|
21 |
| student1x | C1 | student |
|
|
|
22 |
| student2x | C1 | student |
|
|
|
23 |
| student3x | C1 | student |
|
|
|
24 |
| student4x | C1 | student |
|
|
|
25 |
And the following "groups" exist:
|
|
|
26 |
| name | course | idnumber |
|
|
|
27 |
| Group A | C1 | G1 |
|
|
|
28 |
| Group B | C1 | G2 |
|
|
|
29 |
And the following "group members" exist:
|
|
|
30 |
| user | group |
|
|
|
31 |
| student1x | G1 |
|
|
|
32 |
| student2x | G1 |
|
|
|
33 |
| student3x | G2 |
|
|
|
34 |
| student4x | G2 |
|
|
|
35 |
|
|
|
36 |
Scenario: User should not be able to see other groups in separated group mode
|
|
|
37 |
Given I log in as "student1x"
|
|
|
38 |
And I am on "Course 1" course homepage
|
|
|
39 |
When I navigate to course participants
|
|
|
40 |
Then I should see "Group A"
|
|
|
41 |
And I should see "Student 1x"
|
|
|
42 |
And I should see "Student 2x"
|
|
|
43 |
And I should not see "Group B"
|
|
|
44 |
And I should not see "Student 3x"
|
|
|
45 |
And I should not see "Student 4x"
|
|
|
46 |
|
|
|
47 |
@javascript
|
|
|
48 |
Scenario: User should be able to see other groups in visible group mode
|
|
|
49 |
Given I log in as "admin"
|
|
|
50 |
And I am on "Course 1" course homepage
|
|
|
51 |
And I navigate to "Settings" in current page administration
|
|
|
52 |
And I expand all fieldsets
|
|
|
53 |
And I set the field "Group mode" to "Visible groups"
|
|
|
54 |
And I press "Save and display"
|
|
|
55 |
And I log out
|
|
|
56 |
And I log in as "student1x"
|
|
|
57 |
And I am on "Course 1" course homepage
|
|
|
58 |
When I navigate to course participants
|
|
|
59 |
Then I should see "Group A"
|
|
|
60 |
And I should see "Student 1x"
|
|
|
61 |
And I should see "Student 2x"
|
|
|
62 |
And I set the field "type" in the "Filter 1" "fieldset" to "Groups"
|
|
|
63 |
And I set the field "Type or select..." in the "Filter 1" "fieldset" to "Group B"
|
|
|
64 |
And I click on "Apply filters" "button"
|
|
|
65 |
And I should see "Student 3x"
|
|
|
66 |
And I should see "Student 4x"
|
|
|
67 |
|
|
|
68 |
Scenario: User should be able to see all users in no groups mode
|
|
|
69 |
Given I log in as "admin"
|
|
|
70 |
And I am on "Course 1" course homepage
|
|
|
71 |
And I navigate to "Settings" in current page administration
|
|
|
72 |
And I expand all fieldsets
|
|
|
73 |
And I set the field "Group mode" to "No groups"
|
|
|
74 |
And I press "Save and display"
|
|
|
75 |
And I log out
|
|
|
76 |
And I log in as "student1x"
|
|
|
77 |
And I am on "Course 1" course homepage
|
|
|
78 |
When I navigate to course participants
|
|
|
79 |
Then I should see "Group A"
|
|
|
80 |
And I should see "Student 1x"
|
|
|
81 |
And I should see "Student 2x"
|
|
|
82 |
And I should see "Group B"
|
|
|
83 |
And I should see "Student 3x"
|
|
|
84 |
And I should see "Student 4x"
|
|
|
85 |
And I should see "Teacher 1x"
|
|
|
86 |
And I should see "No groups"
|