Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_recent_activity
2
Feature: View structural changes in recent activity block
3
  In order to know when activities were changed
4
  As a user
5
  In need to see the structural changes in recent activity block
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category |
10
      | Course 1 | C1 | 0 |
11
    And the following "users" exist:
12
      | username    | firstname | lastname | email            |
13
      | teacher1    | Terry1    | Teacher1 | teacher1@example.com |
14
      | assistant1  | Terry2    | Teacher2 | teacher2@example.com |
15
      | student1    | Sam1      | Student1 | student1@example.com |
16
      | student2    | Sam2      | Student2 | student2@example.com |
17
      | student3    | Sam3      | Student3 | student3@example.com |
18
    And the following "course enrolments" exist:
19
      | user        | course | role           |
20
      | teacher1    | C1     | editingteacher |
21
      | assistant1  | C1     | teacher        |
22
      | student1    | C1     | student        |
23
      | student2    | C1     | student        |
24
      | student3    | C1     | student        |
25
    And the following "groups" exist:
26
      | name | course | idnumber |
27
      | Group 1 | C1 | G1 |
28
      | Group 2 | C1 | G2 |
29
    And the following "groupings" exist:
30
      | name        | course | idnumber |
31
      | Grouping 1  | C1     | GG1      |
32
      | Grouping 2  | C1     | GG2      |
33
      | Grouping 3  | C1     | GG3      |
34
    And the following "group members" exist:
35
      | user        | group |
36
      | student1    | G1    |
37
      | student2    | G2    |
38
      | student3    | G1    |
39
      | student3    | G2    |
40
      | assistant1  | G1    |
41
    And the following "grouping groups" exist:
42
      | grouping | group |
43
      | GG1      | G1    |
44
      | GG2      | G2    |
45
      | GG3      | G1    |
46
      | GG3      | G2    |
47
 
48
  Scenario: Check that Added module information is displayed respecting view capability
49
    Given the following "activities" exist:
50
      | activity | course | name                  | idnumber | groupmode | grouping | visible |
51
      | forum    | C1     | ForumVisibleGroups    | forum1   | 2         |          | 1       |
52
      | forum    | C1     | ForumSeparateGroups   | forum2   | 1         |          | 1       |
53
      | forum    | C1     | ForumHidden           | forum3   | 1         |          | 0       |
54
      | forum    | C1     | ForumNoGroups         | forum4   | 0         |          | 1       |
55
      | forum    | C1     | ForumVisibleGroupsG1  | forum5   | 2         | GG1      | 1       |
56
      | forum    | C1     | ForumSeparateGroupsG1 | forum6   | 1         | GG1      | 1       |
57
      | forum    | C1     | ForumVisibleGroupsG2  | forum7   | 2         | GG2      | 1       |
58
      | forum    | C1     | ForumSeparateGroupsG2 | forum8   | 1         | GG2      | 1       |
59
 
60
    And I am on the "ForumVisibleGroupsG1" "forum activity editing" page logged in as teacher1
61
    And I set the following fields to these values:
62
      | Access restrictions | Grouping: Grouping 1 |
63
    And I press "Save and return to course"
64
 
65
    And I am on the "ForumSeparateGroupsG1" "forum activity editing" page
66
    And I set the following fields to these values:
67
      | Access restrictions | Grouping: Grouping 1 |
68
    And I press "Save and return to course"
69
 
70
    And I am on the "ForumVisibleGroupsG2" "forum activity editing" page
71
    And I set the following fields to these values:
72
      | Access restrictions | Grouping: Grouping 2 |
73
    And I press "Save and return to course"
74
 
75
    And I am on the "ForumSeparateGroupsG2" "forum activity editing" page
76
 
77
    And I set the following fields to these values:
78
      | Access restrictions | Grouping: Grouping 2 |
79
    And I press "Save and return to course"
80
 
81
    And I am on "Course 1" course homepage with editing mode on
82
    When I add the "Recent activity" block
83
 
84
    Then I should see "ForumVisibleGroups" in the "Recent activity" "block"
85
    And I should see "ForumSeparateGroups" in the "Recent activity" "block"
86
    And I should see "ForumNoGroups" in the "Recent activity" "block"
87
    And I should see "ForumHidden" in the "Recent activity" "block"
88
    And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
89
    And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
90
    And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
91
    And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
92
 
93
    And I am on the "Course 1" course page logged in as student1
94
    And I should see "ForumVisibleGroups" in the "Recent activity" "block"
95
    And I should see "ForumSeparateGroups" in the "Recent activity" "block"
96
    And I should see "ForumNoGroups" in the "Recent activity" "block"
97
    And I should not see "ForumHidden" in the "Recent activity" "block"
98
    And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
99
    And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
100
    And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block"
101
    And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block"
102
 
103
    And I am on the "Course 1" course page logged in as student2
104
    And I should see "ForumVisibleGroups" in the "Recent activity" "block"
105
    And I should see "ForumSeparateGroups" in the "Recent activity" "block"
106
    And I should see "ForumNoGroups" in the "Recent activity" "block"
107
    And I should not see "ForumHidden" in the "Recent activity" "block"
108
    And I should not see "ForumVisibleGroupsG1" in the "Recent activity" "block"
109
    And I should not see "ForumSeparateGroupsG1" in the "Recent activity" "block"
110
    And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
111
    And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
112
 
113
    And I am on the "Course 1" course page logged in as student3
114
    And I should see "ForumVisibleGroups" in the "Recent activity" "block"
115
    And I should see "ForumSeparateGroups" in the "Recent activity" "block"
116
    And I should see "ForumNoGroups" in the "Recent activity" "block"
117
    And I should not see "ForumHidden" in the "Recent activity" "block"
118
    And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
119
    And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
120
    And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
121
    And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
122
 
123
    # Teachers have capability to see all groups and hidden activities
124
    And I am on the "Course 1" course page logged in as assistant1
125
    And I should see "ForumHidden" in the "Recent activity" "block"
126
    And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
127
    And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
128
    And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
129
    And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
130
 
131
  Scenario: Updates and deletes in recent activity block
132
    Given the following "activity" exists:
133
      | activity    | forum          |
134
      | course      | C1             |
135
      | idnumber    | forum1         |
136
      | name        | ForumNew       |
137
    When I log in as "teacher1"
138
    And I am on "Course 1" course homepage with editing mode on
139
    And I add the "Recent activity" block
140
    Then I should see "Added Forum" in the "Recent activity" "block"
141
    And I should see "ForumNew" in the "Recent activity" "block"
142
    And I log out
143
 
144
    # Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
145
    And I wait "1" seconds
146
    And I am on the "Course 1" course page logged in as student1
147
    And I should see "Added Forum" in the "Recent activity" "block"
148
    And I should see "ForumNew" in the "Recent activity" "block"
149
    And I log out
150
    # Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
151
    And I wait "1" seconds
152
 
153
    # Update forum as a teacher
154
    And I am on the "ForumNew" "forum activity editing" page logged in as teacher1
155
    And I set the following fields to these values:
156
      | name | ForumUpdated |
157
    And I press "Save and return to course"
158
    And I log out
159
    And I wait "1" seconds
160
    # Student 1 already saw that forum was created, now he can see that forum was updated
161
 
162
    And I am on the "Course 1" course page logged in as student1
163
    And I should not see "Added Forum" in the "Recent activity" "block"
164
    And I should not see "ForumNew" in the "Recent activity" "block"
165
    And I should see "Updated Forum" in the "Recent activity" "block"
166
    And I should see "ForumUpdated" in the "Recent activity" "block"
167
    And I log out
168
    And I wait "1" seconds
169
    # Student 2 has bigger interval and he can see one entry that forum was created but with the new name
170
 
171
    And I am on the "Course 1" course page logged in as student2
172
    And I should see "Added Forum" in the "Recent activity" "block"
173
    And I should not see "ForumNew" in the "Recent activity" "block"
174
    And I should not see "Updated Forum" in the "Recent activity" "block"
175
    And I should see "ForumUpdated" in the "Recent activity" "block"
176
    And I log out
177
    And I wait "1" seconds
178
    # Delete forum as a teacher
179
 
180
    And I log in as "teacher1"
181
    And I am on "Course 1" course homepage with editing mode on
182
    And I delete "ForumUpdated" activity
183
    And I run all adhoc tasks
184
    And I log out
185
    And I wait "1" seconds
186
    # Students 1 and 2 see that forum was deleted
187
 
188
    And I am on the "Course 1" course page logged in as student1
189
    And I should not see "Added Forum" in the "Recent activity" "block"
190
    And I should not see "ForumNew" in the "Recent activity" "block"
191
    And I should not see "Updated Forum" in the "Recent activity" "block"
192
    And I should not see "ForumUpdated" in the "Recent activity" "block"
193
    And I should see "Deleted Forum" in the "Recent activity" "block"
194
    And I log out
195
    And I wait "1" seconds
196
    # Student 3 never knew that forum was created, so he does not see anything
197
 
198
    And I am on the "Course 1" course page logged in as student3
199
    And I should not see "Added Forum" in the "Recent activity" "block"
200
    And I should not see "ForumNew" in the "Recent activity" "block"
201
    And I should not see "Updated Forum" in the "Recent activity" "block"
202
    And I should not see "ForumUpdated" in the "Recent activity" "block"
203
    And I should not see "Deleted Forum" in the "Recent activity" "block"