1 |
efrain |
1 |
@core @core_group
|
|
|
2 |
Feature: The description and picture of a group can be viewed by students and teachers
|
|
|
3 |
In order to view the description and picture of a group
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to create groups and add descriptions and picture to them.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | format |
|
|
|
10 |
| Course 1 | C1 | topics |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
14 |
| student1 | Student | 1 | student1@example.com |
|
|
|
15 |
| student2 | Student | 2 | student2@example.com |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
|
|
|
22 |
@javascript @_file_upload
|
|
|
23 |
Scenario: A student can see the group description and picture when visible groups are set. Teachers can see group details.
|
|
|
24 |
Given I am on the "Course 1" "course editing" page logged in as "teacher1"
|
|
|
25 |
And I set the following fields to these values:
|
|
|
26 |
| Group mode | Visible groups |
|
|
|
27 |
And I press "Save and display"
|
|
|
28 |
And I am on the "Course 1" "groups" page
|
|
|
29 |
And I press "Create group"
|
|
|
30 |
And I set the following fields to these values:
|
|
|
31 |
| Group name | Group A |
|
|
|
32 |
| Group description | Description for Group A |
|
|
|
33 |
# Upload group picture
|
|
|
34 |
And I upload "lib/tests/fixtures/gd-logo.png" file to "New picture" filemanager
|
|
|
35 |
And I press "Save changes"
|
|
|
36 |
And I press "Create group"
|
|
|
37 |
And I set the following fields to these values:
|
|
|
38 |
| Group name | Group B |
|
|
|
39 |
And I press "Save changes"
|
|
|
40 |
And I add "Student 1 (student1@example.com)" user to "Group A" group members
|
|
|
41 |
And I add "Student 2 (student2@example.com)" user to "Group B" group members
|
|
|
42 |
And I navigate to course participants
|
|
|
43 |
And I click on "Student 1" "link" in the "participants" "table"
|
|
|
44 |
And I click on "Group A" "link"
|
|
|
45 |
And I should see "Description for Group A"
|
|
|
46 |
# As teacher, confirm that group picture is displayed
|
|
|
47 |
And "//img[@class='grouppicture']" "xpath_element" should exist
|
|
|
48 |
And ".groupinfobox" "css_element" should exist
|
|
|
49 |
And I set the field "type" in the "Filter 1" "fieldset" to "Groups"
|
|
|
50 |
And I set the field "Type or select..." in the "Filter 1" "fieldset" to "Group B"
|
|
|
51 |
And I click on "Apply filters" "button"
|
|
|
52 |
And I click on "Student 2" "link" in the "participants" "table"
|
|
|
53 |
And I click on "Group B" "link"
|
|
|
54 |
And I should see "Student 2" in the "participants" "table"
|
|
|
55 |
And ".groupinfobox" "css_element" should not exist
|
|
|
56 |
When I am on the "Course 1" course page logged in as student1
|
|
|
57 |
And I navigate to course participants
|
|
|
58 |
And I click on "Student 1" "link" in the "participants" "table"
|
|
|
59 |
And I click on "Group A" "link"
|
|
|
60 |
# As student, confirm that group description and picture is displayed
|
|
|
61 |
Then I should see "Description for Group A"
|
|
|
62 |
And "//img[@class='grouppicture']" "xpath_element" should exist
|
|
|
63 |
And I am on the "Course 1" course page logged in as student2
|
|
|
64 |
And I navigate to course participants
|
|
|
65 |
And I click on "Student 2" "link" in the "participants" "table"
|
|
|
66 |
And I click on "Group B" "link"
|
|
|
67 |
And I should see "Student 2" in the "participants" "table"
|
|
|
68 |
And ".groupinfobox" "css_element" should not exist
|
|
|
69 |
|
|
|
70 |
@javascript @_file_upload
|
|
|
71 |
Scenario: A student can not see the group description and picture when separate groups are set. Teachers can see group details.
|
|
|
72 |
Given I am on the "Course 1" "course editing" page logged in as "teacher1"
|
|
|
73 |
And I set the following fields to these values:
|
|
|
74 |
| Group mode | Separate groups |
|
|
|
75 |
And I press "Save and display"
|
|
|
76 |
And I am on the "Course 1" "groups" page
|
|
|
77 |
And I press "Create group"
|
|
|
78 |
And I set the following fields to these values:
|
|
|
79 |
| Group name | Group A |
|
|
|
80 |
| Group description | Description for Group A |
|
|
|
81 |
# Upload group picture
|
|
|
82 |
And I upload "lib/tests/fixtures/gd-logo.png" file to "New picture" filemanager
|
|
|
83 |
And I press "Save changes"
|
|
|
84 |
And I press "Create group"
|
|
|
85 |
And I set the following fields to these values:
|
|
|
86 |
| Group name | Group B |
|
|
|
87 |
And I press "Save changes"
|
|
|
88 |
And I add "Student 1 (student1@example.com)" user to "Group A" group members
|
|
|
89 |
And I add "Student 2 (student2@example.com)" user to "Group B" group members
|
|
|
90 |
And I navigate to course participants
|
|
|
91 |
And I click on "Student 1" "link" in the "participants" "table"
|
|
|
92 |
And I click on "Group A" "link"
|
|
|
93 |
And I should see "Description for Group A"
|
|
|
94 |
# As teacher, confirm that group picture is displayed
|
|
|
95 |
And "//img[@class='grouppicture']" "xpath_element" should exist
|
|
|
96 |
And ".groupinfobox" "css_element" should exist
|
|
|
97 |
And I set the field "type" in the "Filter 1" "fieldset" to "Groups"
|
|
|
98 |
And I set the field "Type or select..." in the "Filter 1" "fieldset" to "Group B"
|
|
|
99 |
And I click on "Apply filters" "button"
|
|
|
100 |
And I click on "Student 2" "link" in the "participants" "table"
|
|
|
101 |
And I click on "Group B" "link"
|
|
|
102 |
And ".groupinfobox" "css_element" should not exist
|
|
|
103 |
When I am on the "Course 1" course page logged in as student1
|
|
|
104 |
And I navigate to course participants
|
|
|
105 |
And I click on "Student 1" "link" in the "participants" "table"
|
|
|
106 |
And I click on "Group A" "link"
|
|
|
107 |
And I should see "Student 1" in the "participants" "table"
|
|
|
108 |
# As student, confirm that group description and picture are not displayed
|
|
|
109 |
Then I should not see "Description for Group A"
|
|
|
110 |
And "//img[@class='grouppicture']" "xpath_element" should not exist
|
|
|
111 |
And ".groupinfobox" "css_element" should not exist
|
|
|
112 |
When I am on the "Course 1" course page logged in as student2
|
|
|
113 |
And I navigate to course participants
|
|
|
114 |
And I click on "Student 2" "link" in the "participants" "table"
|
|
|
115 |
And I click on "Group B" "link"
|
|
|
116 |
And I should see "Student 2" in the "participants" "table"
|
|
|
117 |
And ".groupinfobox" "css_element" should not exist
|