1 |
efrain |
1 |
@mod @mod_forum
|
|
|
2 |
Feature: A user with access to multiple groups should be able to post a copy of a message to all the groups they have access to
|
|
|
3 |
In order to post to all groups a user has access to
|
|
|
4 |
As a user
|
|
|
5 |
I need to have the option to post a copy of a message to all groups
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
| student2 | Student | 2 | student2@example.com |
|
|
|
13 |
| student3 | Student | 3 | student3@example.com |
|
|
|
14 |
And the following "courses" exist:
|
|
|
15 |
| fullname | shortname | category |
|
|
|
16 |
| Course 1 | C1 | 0 |
|
|
|
17 |
| Course 2 | C2 | 0 |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| teacher1 | C1 | editingteacher |
|
|
|
21 |
| teacher1 | C2 | editingteacher |
|
|
|
22 |
| student1 | C1 | student |
|
|
|
23 |
| student1 | C2 | student |
|
|
|
24 |
| student2 | C1 | student |
|
|
|
25 |
| student2 | C2 | student |
|
|
|
26 |
| student3 | C1 | student |
|
|
|
27 |
| student3 | C2 | student |
|
|
|
28 |
And the following "groups" exist:
|
|
|
29 |
| name | course | idnumber |
|
|
|
30 |
| Group A | C1 | C1G1 |
|
|
|
31 |
| Group B | C1 | C1G2 |
|
|
|
32 |
| Group C | C1 | C1G3 |
|
|
|
33 |
| Group A | C2 | C2G1 |
|
|
|
34 |
| Group B | C2 | C2G2 |
|
|
|
35 |
| Group C | C2 | C2G3 |
|
|
|
36 |
And the following "groupings" exist:
|
|
|
37 |
| name | course | idnumber |
|
|
|
38 |
| G1 | C2 | G1 |
|
|
|
39 |
And the following "group members" exist:
|
|
|
40 |
| user | group |
|
|
|
41 |
| teacher1 | C1G1 |
|
|
|
42 |
| teacher1 | C1G2 |
|
|
|
43 |
| teacher1 | C1G3 |
|
|
|
44 |
| teacher1 | C2G1 |
|
|
|
45 |
| teacher1 | C2G1 |
|
|
|
46 |
| student1 | C1G1 |
|
|
|
47 |
| student1 | C2G1 |
|
|
|
48 |
| student1 | C2G2 |
|
|
|
49 |
| student2 | C1G1 |
|
|
|
50 |
| student2 | C1G2 |
|
|
|
51 |
| student3 | C1G1 |
|
|
|
52 |
| student3 | C1G2 |
|
|
|
53 |
| student3 | C1G3 |
|
|
|
54 |
And the following "grouping groups" exist:
|
|
|
55 |
| grouping | group |
|
|
|
56 |
| G1 | C2G1 |
|
|
|
57 |
| G1 | C2G2 |
|
|
|
58 |
And the following "activities" exist:
|
|
|
59 |
| activity | name | course | idnumber | groupmode | grouping |
|
|
|
60 |
| forum | No group forum | C1 | forum | 0 | |
|
|
|
61 |
| forum | Separate group forum | C1 | forum | 1 | |
|
|
|
62 |
| forum | Visible group forum | C1 | forum | 2 | |
|
|
|
63 |
| forum | Groupings forum | C2 | forum | 1 | G1 |
|
|
|
64 |
And the following forum discussions exist in course "Course 1":
|
|
|
65 |
| user | forum | name | message | posttomygroups |
|
|
|
66 |
| teacher1 | Separate group forum | Discussion 1 | test | 1 |
|
|
|
67 |
| teacher1 | Visible group forum | Discussion 1 | test | 1 |
|
|
|
68 |
|
|
|
69 |
Scenario: Teacher is able to post a copy of a message to all groups in a separate group forum
|
|
|
70 |
When I am on the "Separate group forum" "forum activity" page logged in as student1
|
|
|
71 |
Then I should see "Discussion 1"
|
|
|
72 |
And I am on the "Separate group forum" "forum activity" page logged in as student2
|
|
|
73 |
And I should see "Discussion 1"
|
|
|
74 |
And I am on the "Separate group forum" "forum activity" page logged in as student3
|
|
|
75 |
And I should see "Discussion 1"
|
|
|
76 |
|
|
|
77 |
Scenario: Teacher is able to post a copy of a message to all groups in a visible group forum
|
|
|
78 |
When I am on the "Visible group forum" "forum activity" page logged in as student1
|
|
|
79 |
Then I should see "Discussion 1"
|
|
|
80 |
And I am on the "Visible group forum" "forum activity" page logged in as student2
|
|
|
81 |
And I should see "Discussion 1"
|
|
|
82 |
And I am on the "Visible group forum" "forum activity" page logged in as student3
|
|
|
83 |
And I should see "Discussion 1"
|
|
|
84 |
|
|
|
85 |
Scenario: Teacher is unable to post a copy of a message to all groups in a no group forum
|
|
|
86 |
Given I am on the "No group forum" "forum activity" page logged in as teacher1
|
|
|
87 |
When I click on "Add discussion topic" "link"
|
|
|
88 |
Then I should not see "Post a copy to all groups"
|
|
|
89 |
|
|
|
90 |
Scenario: Posts to all groups that have groupings should only display within the grouping and not to other groups
|
|
|
91 |
Given I log in as "teacher1"
|
|
|
92 |
And I am on "Course 2" course homepage
|
|
|
93 |
And I add a new discussion to "Groupings forum" forum with:
|
|
|
94 |
| Subject | Discussion 1 |
|
|
|
95 |
| Message | test |
|
|
|
96 |
| Post a copy to all groups | 1 |
|
|
|
97 |
When I am on the "Groupings forum" "forum activity" page logged in as student1
|
|
|
98 |
Then I should see "Discussion 1"
|
|
|
99 |
And I am on the "Groupings forum" "forum activity" page logged in as student2
|
|
|
100 |
And I should not see "Discussion 1"
|
|
|
101 |
|
|
|
102 |
@javascript @mod_forum_quick_discussion_post_to_all_groups
|
|
|
103 |
Scenario: The 'Post a copy to all groups' option can be available in the quick discussion creation form
|
|
|
104 |
Given I log in as "teacher1"
|
|
|
105 |
And I am on "Course 1" course homepage
|
|
|
106 |
And I follow "Separate group forum"
|
|
|
107 |
When I click on "Add discussion topic" "link"
|
|
|
108 |
Then "Post a copy to all groups" "field" should exist
|