Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_timeline @javascript
2
Feature: The timeline block allows users to see upcoming courses
3
  In order to enable the timeline block
4
  As a student
5
  I can add the timeline block to my dashboard
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                | idnumber |
10
      | student1 | Student   | 1        | student1@example.com | S1       |
11
      | student2 | Student   | 2        | student2@example.com | S2       |
12
    And the following "courses" exist:
13
      | fullname | shortname | category | startdate                   | enddate         |
14
      | Course 1 | C1        | 0        | ##yesterday##               | ##tomorrow## |
15
      | Course 2 | C2        | 0        | ##yesterday##               | ##tomorrow## |
16
      | Course 3 | C3        | 0        | ##yesterday##               | ##tomorrow## |
17
      | Course 4 | C4        | 0        | ##first day of next month## | ##last day of next month## |
18
      | Course 5 | C5        | 0        | ##yesterday##               | ##tomorrow## |
19
    And the following "activities" exist:
20
      | activity | course | idnumber  | name            | intro                   | timeopen      | timeclose     |
21
      | choice   | C2     | choice1   | Test choice 1   | Test choice description | ##yesterday## | ##tomorrow##  |
22
      | choice   | C1     | choice2   | Test choice 2   | Test choice description | ##1 month ago## | ##15 days ago##  |
23
      | choice   | C3     | choice3   | Test choice 3   | Test choice description | ##first day of +5 months## | ##last day of +5 months##  |
24
      | feedback | C2     | feedback1 | Test feedback 1 | Test feedback description | ##yesterday## | ##tomorrow##  |
25
      | feedback | C1     | feedback2 | Test feedback 2 | Test feedback description | ##first day of +10 months## | ##last day of +10 months##  |
26
      | feedback | C3     | feedback3 | Test feedback 3 | Test feedback description | ##first day of +5 months## | ##last day of +5 months## |
27
      | feedback | C4     | feedback4 | Test feedback 4 | Test feedback description | ##yesterday## | ##tomorrow## |
28
      | feedback | C1     | feedback5 | Test feedback 5 | Test feedback description | ##yesterday## | ##now +1 minute## |
29
    And the following "activities" exist:
30
      | activity | course | idnumber  | name            | intro                   | timeopen        | duedate           |
31
      | assign   | C1     | assign1   | Test assign 1   | Test assign description | ##1 month ago## | ##yesterday##     |
32
      | assign   | C2     | assign2   | Test assign 2   | Test assign description | ##yesterday##   | ##now -1 minute## |
33
    And the following "course enrolments" exist:
34
      | user | course | role |
35
      | student1 | C1 | student |
36
      | student1 | C2 | student |
37
      | student1 | C3 | student |
38
      | student1 | C4 | student |
39
 
40
  Scenario: Next 30 days in course view
41
    Given I log in as "student1"
42
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
43
    And I click on "Next 30 days" "link" in the "Timeline" "block"
44
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
45
    When I click on "Sort by courses" "link" in the "Timeline" "block"
46
    Then I should see "Course 1" in the ".block_timeline [data-region='view-courses']" "css_element"
47
    And I should see "Course 2" in the ".block_timeline [data-region='view-courses']" "css_element"
48
    And I should see "Show more courses" in the "Timeline" "block"
49
    And I click on "Show more courses" "button" in the "Timeline" "block"
50
    And I should see "Course 4" in the ".block_timeline [data-region='view-courses']" "css_element"
51
    And "Test choice 1" "link" should exist in the "Timeline" "block"
52
    And I should see "Choice closes" in the "Timeline" "block"
53
    And "Test feedback 1" "link" should exist in the "Timeline" "block"
54
    And I should see "Feedback closes" in the "Timeline" "block"
55
    And "Test feedback 4" "link" should exist in the "Timeline" "block"
56
    And "Test feedback 5" "link" should exist in the "Timeline" "block"
57
    And "Test assign 2" "link" should exist in the "Timeline" "block"
58
    And I should not see "Course 3" in the "Timeline" "block"
59
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
60
    And "Test choice 3" "link" should not exist in the "Timeline" "block"
61
    And "Test feedback 2" "link" should not exist in the "Timeline" "block"
62
    And "Test feedback 3" "link" should not exist in the "Timeline" "block"
63
    And "Test assign 1" "link" should not exist in the "Timeline" "block"
64
 
65
  Scenario: All in course view
66
    Given I log in as "student1"
67
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
68
    And I click on "All" "link" in the "Timeline" "block"
69
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
70
    And I click on "Sort by courses" "link" in the "Timeline" "block"
71
    When I click on "Show more courses" "button" in the "Timeline" "block"
72
    Then I should see "Course 3" in the "Timeline" "block"
73
    And I should see "Course 2" in the "Timeline" "block"
74
    And I should see "Course 1" in the "Timeline" "block"
75
    And "Test choice 1" "link" should exist in the "Timeline" "block"
76
    And "Test choice 3" "link" should exist in the "Timeline" "block"
77
    And "Test feedback 1" "link" should exist in the "Timeline" "block"
78
    And "Test feedback 2" "link" should exist in the "Timeline" "block"
79
    And "Test feedback 3" "link" should exist in the "Timeline" "block"
80
    And "Test feedback 5" "link" should exist in the "Timeline" "block"
81
    And "Test assign 1" "link" should exist in the "Timeline" "block"
82
    And "Test assign 2" "link" should exist in the "Timeline" "block"
83
    And I should see "Assignment is due" in the "Timeline" "block"
84
    And I should see "Choice closes" in the "Timeline" "block"
85
    And I should see "Course 4" in the "Timeline" "block"
86
    And I should see "Test feedback 4" in the "Timeline" "block"
87
    And I should not see "Show more courses" in the "Timeline" "block"
88
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
89
 
90
  Scenario: Persistent sort filter
91
    Given I log in as "student1"
92
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
93
    And I click on "Sort by dates" "link" in the "Timeline" "block"
94
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
95
    And I click on "Sort by courses" "link" in the "Timeline" "block"
96
    When I reload the page
97
    Then I should see "Course 1" in the "Timeline" "block"
98
    And I should see "Course 2" in the "Timeline" "block"
99
    And I should see "Show more courses" in the "Timeline" "block"
100
    And I click on "Show more courses" "button" in the "Timeline" "block"
101
    And I should see "Course 4" in the ".block_timeline [data-region='view-courses']" "css_element"
102
    And "Test choice 1" "link" should exist in the "Timeline" "block"
103
    And "Test feedback 1" "link" should exist in the "Timeline" "block"
104
    And "Test feedback 4" "link" should exist in the "Timeline" "block"
105
    And "Test feedback 5" "link" should exist in the "Timeline" "block"
106
    And "Test assign 2" "link" should exist in the "Timeline" "block"
107
    And I should not see "Course 3" in the "Timeline" "block"
108
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
109
    And "Test choice 3" "link" should not exist in the "Timeline" "block"
110
    And "Test feedback 2" "link" should not exist in the "Timeline" "block"
111
    And "Test feedback 3" "link" should not exist in the "Timeline" "block"
112
    And "Test assign 1" "link" should not exist in the "Timeline" "block"
113
 
114
  Scenario: Persistent All in course view
115
    Given I log in as "student1"
116
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
117
    And I click on "Sort by courses" "link" in the "Timeline" "block"
118
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
119
    And I click on "All" "link" in the "Timeline" "block"
120
    When I reload the page
121
    And I should not see "Course 3" in the "Timeline" "block"
122
    And I should see "Course 2" in the "Timeline" "block"
123
    And I should see "Course 1" in the "Timeline" "block"
124
    And I click on "Show more courses" "button" in the "Timeline" "block"
125
    Then I should see "Course 3" in the "Timeline" "block"
126
    And I should see "Course 2" in the "Timeline" "block"
127
    And I should see "Course 1" in the "Timeline" "block"
128
    And "Test choice 1" "link" should exist in the "Timeline" "block"
129
    And "Test choice 3" "link" should exist in the "Timeline" "block"
130
    And "Test feedback 1" "link" should exist in the "Timeline" "block"
131
    And "Test feedback 2" "link" should exist in the "Timeline" "block"
132
    And "Test feedback 3" "link" should exist in the "Timeline" "block"
133
    And "Test assign 1" "link" should exist in the "Timeline" "block"
134
    And I should not see "Show more courses" in the "Timeline" "block"
135
    And I should see "Course 4" in the "Timeline" "block"
136
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
137
    And "Test feedback 4" "link" should exist in the "Timeline" "block"
138
 
139
  Scenario: Current filtering always applies in courses view
140
    Given I log in as "student1"
141
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
142
    And I click on "Sort by courses" "link" in the "Timeline" "block"
143
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
144
    And I click on "Overdue" "link" in the "Timeline" "block"
145
    And I reload the page
146
    And "Test assign 1" "link" should exist in the "Timeline" "block"
147
    And "Test feedback 2" "link" should not exist in the "Timeline" "block"
148
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
149
    And I click on "Sort by dates" "link" in the "Timeline" "block"
150
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
151
    # Confirm that when we switch back to courses view, the "All" filer continues to be applied (and not "overdue").
152
    When I click on "All" "link" in the "Timeline" "block"
153
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
154
    And I click on "Sort by courses" "link" in the "Timeline" "block"
155
    And I click on "Show more courses" "button" in the "Timeline" "block"
156
    Then "Test assign 1" "link" should exist in the "Timeline" "block"
157
    And "Test feedback 2" "link" should exist in the "Timeline" "block"
158
 
159
  Scenario: Overdue in course view
160
    Given I log in as "student1"
161
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
162
    And I click on "Sort by courses" "link" in the "Timeline" "block"
163
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
164
    When I click on "Overdue" "link" in the "Timeline" "block"
165
    Then "Test assign 1" "link" should exist in the "Timeline" "block"
166
    And "Test assign 2" "link" should exist in the "Timeline" "block"
167
    And I should not see "Test feedback 1" in the "Timeline" "block"
168
    And I should not see "Test feedback 2" in the "Timeline" "block"
169
    And I should not see "Test feedback 3" in the "Timeline" "block"
170
    And I should not see "Test feedback 4" in the "Timeline" "block"
171
    And I should not see "Test feedback 5" in the "Timeline" "block"
172
    And I should not see "Test choice 1" in the "Timeline" "block"
173
    And I should not see "Test choice 2" in the "Timeline" "block"
174
    And I should not see "Test choice 3" in the "Timeline" "block"
175
 
176
  Scenario: Persistent Overdue in course view
177
    Given I log in as "student1"
178
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
179
    And I click on "Sort by courses" "link" in the "Timeline" "block"
180
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
181
    When I click on "Overdue" "link" in the "Timeline" "block"
182
    And I reload the page
183
    Then "Test assign 1" "link" should exist in the "Timeline" "block"
184
    And  "Test assign 2" "link" should exist in the "Timeline" "block"
185
    And "Test feedback 1" "link" should not exist in the "Timeline" "block"
186
    And "Test feedback 2" "link" should not exist in the "Timeline" "block"
187
    And "Test feedback 3" "link" should not exist in the "Timeline" "block"
188
    And "Test feedback 4" "link" should not exist in the "Timeline" "block"
189
    And "Test feedback 5" "link" should not exist in the "Timeline" "block"
190
    And "Test choice 1" "link" should not exist in the "Timeline" "block"
191
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
192
    And "Test choice 3" "link" should not exist in the "Timeline" "block"
193
 
194
  Scenario: Student not enrolled in any courses sees a message
195
    Given I log in as "student2"
196
    When I click on "Sort timeline items" "button" in the "Timeline" "block"
197
    And I click on "Sort by courses" "link" in the "Timeline" "block"
198
    Then I should see "No in-progress courses" in the "Timeline" "block"
199
    And I should not see "Test choice 1"
200
 
201
  Scenario: Only courses with matching events are displayed and are refreshed when filtering changes
202
    Given the following "activities" exist:
203
      | activity | course | idnumber  | name            | intro                   | timeopen        | duedate           |
204
      | assign   | C5     | assign3   | Test assign 3   | Test assign description | ##yesterday##   | ##now +1 minute## |
205
    And the following "course enrolments" exist:
206
      | user     | course | role    |
207
      | student1 | C5     | student |
208
    When I log in as "student1"
209
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
210
    And I click on "Sort by courses" "link" in the "Timeline" "block"
211
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
212
    And I click on "All" "link" in the "Timeline" "block"
213
    And I click on "Show more courses" "button" in the "Timeline" "block"
214
    And I should see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
215
    And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
216
    And I should see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
217
    And I should see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
218
    And I should not see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
219
    And I click on "Show more courses" "button" in the "Timeline" "block"
220
    And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
221
    And "Test assign 1" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
222
    And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
223
    And "Test assign 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
224
    And "Test choice 1" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
225
    And "Test choice 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
226
    And "Test feedback 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
227
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
228
    And I click on "Overdue" "link" in the "Timeline" "block"
229
    Then I should see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
230
    And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
231
    And I should not see "Course 3" in the "Timeline" "block"
232
    And I should not see "Course 5" in the "Timeline" "block"
233
    And I should not see "Show more courses" in the "Timeline" "block"
234
    And "Test assign 1" "link" should exist in the "Timeline" "block"
235
    And "Test assign 2" "link" should exist in the "Timeline" "block"
236
    And "Test assign 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
237
    And "Test choice 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
238
    And "Test choice 2" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
239
    And "Test choice 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
240
    And "Test feedback 5" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
241
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
242
    And I click on "Next 7 days" "link" in the "Timeline" "block"
243
    And I click on "Show more courses" "button" in the "Timeline" "block"
244
    And I should see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
245
    And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
246
    And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
247
    And I should not see "Course 3" in the "Timeline" "block"
248
    And I should not see "Show more courses" in the "Timeline" "block"
249
    And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
250
    And "Test assign 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
251
    And "Test choice 1" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
252
    And "Test feedback 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
253
    And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
254
    And "Test choice 2" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
255
    And "Test choice 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"