Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_myoverview @javascript
2
Feature: The my overview block allows users to easily access their courses
3
  In order to enable the my overview block in a course
4
  As a student
5
  I can add the my overview block to my dashboard
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                | idnumber |
10
      | student1 | Student   | X        | student1@example.com | S1       |
11
    And the following "categories" exist:
12
      | name        | category | idnumber |
13
      | Category 1  | 0        | CAT1     |
14
    And the following "courses" exist:
15
      | fullname | shortname | category | startdate                   | enddate         |
16
      | Course 1 | C1        | 0        | ##1 month ago##             | ##15 days ago## |
17
      | Course 2 | C2        | 0        | ##yesterday##               | ##tomorrow## |
18
      | Course 3 | C3        | 0        | ##yesterday##               | ##tomorrow## |
19
      | Course 4 | C4        | CAT1     | ##yesterday##               | ##tomorrow## |
20
      | Course 5 | C5        | 0        | ##first day of next month## | ##last day of next month## |
21
    And the following "course enrolments" exist:
22
      | user | course | role |
23
      | student1 | C1 | student |
24
      | student1 | C2 | student |
25
      | student1 | C3 | student |
26
      | student1 | C4 | student |
27
      | student1 | C5 | student |
28
 
29
  Scenario: View past courses
30
    Given I am on the "My courses" page logged in as "student1"
31
    And I click on "All" "button" in the "Course overview" "block"
32
    When I click on "Past" "link" in the "Course overview" "block"
33
    Then I should see "Course 1" in the "Course overview" "block"
34
    And I should not see "Course 2" in the "Course overview" "block"
35
    And I should not see "Course 3" in the "Course overview" "block"
36
    And I should not see "Course 4" in the "Course overview" "block"
37
    And I should not see "Course 5" in the "Course overview" "block"
38
 
39
  Scenario: View future courses
40
    Given I am on the "My courses" page logged in as "student1"
41
    And I click on "All" "button" in the "Course overview" "block"
42
    When I click on "Future" "link" in the "Course overview" "block"
43
    Then I should see "Course 5" in the "Course overview" "block"
44
    And I should not see "Course 1" in the "Course overview" "block"
45
    And I should not see "Course 2" in the "Course overview" "block"
46
    And I should not see "Course 3" in the "Course overview" "block"
47
    And I should not see "Course 4" in the "Course overview" "block"
48
 
49
  Scenario: View inprogress courses
50
    Given I am on the "My courses" page logged in as "student1"
51
    And I click on "All" "button" in the "Course overview" "block"
52
    When I click on "In progress" "link" in the "Course overview" "block"
53
    Then I should see "Course 2" in the "Course overview" "block"
54
    Then I should see "Course 3" in the "Course overview" "block"
55
    Then I should see "Course 4" in the "Course overview" "block"
56
    And I should not see "Course 1" in the "Course overview" "block"
57
    And I should not see "Course 5" in the "Course overview" "block"
58
 
59
  Scenario: View all (except removed) courses
60
    Given I am on the "My courses" page logged in as "student1"
61
    And I click on "All" "button" in the "Course overview" "block"
62
    When I click on "All" "link" in the "Course overview" "block"
63
    Then I should see "Course 1" in the "Course overview" "block"
64
    Then I should see "Course 2" in the "Course overview" "block"
65
    Then I should see "Course 3" in the "Course overview" "block"
66
    Then I should see "Course 4" in the "Course overview" "block"
67
    Then I should see "Course 5" in the "Course overview" "block"
68
 
69
  Scenario: View all (including removed from view) courses
70
    Given the following config values are set as admin:
71
      | config                            | value | plugin           |
72
      | displaygroupingallincludinghidden | 1     | block_myoverview |
73
    And I am on the "My courses" page logged in as "student1"
74
    And I click on "All" "button" in the "Course overview" "block"
75
    # We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including removed from view)" element instead
76
    When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
77
    Then I should see "Course 1" in the "Course overview" "block"
78
    Then I should see "Course 2" in the "Course overview" "block"
79
    Then I should see "Course 3" in the "Course overview" "block"
80
    Then I should see "Course 4" in the "Course overview" "block"
81
    Then I should see "Course 5" in the "Course overview" "block"
82
 
83
  Scenario: View inprogress courses - test persistence
84
    Given I am on the "My courses" page logged in as "student1"
85
    And I click on "All" "button" in the "Course overview" "block"
86
    And I click on "In progress" "link" in the "Course overview" "block"
87
    And I reload the page
88
    Then I should see "In progress" in the "Course overview" "block"
89
    Then I should see "Course 2" in the "Course overview" "block"
90
    Then I should see "Course 3" in the "Course overview" "block"
91
    Then I should see "Course 4" in the "Course overview" "block"
92
    And I should not see "Course 1" in the "Course overview" "block"
93
    And I should not see "Course 5" in the "Course overview" "block"
94
 
95
  Scenario: View all (except removed) courses - w/ persistence
96
    Given I am on the "My courses" page logged in as "student1"
97
    And I click on "All" "button" in the "Course overview" "block"
98
    When I click on "All" "link" in the "Course overview" "block"
99
    And I reload the page
100
    Then I should see "All" in the "Course overview" "block"
101
    Then I should see "Course 1" in the "Course overview" "block"
102
    Then I should see "Course 2" in the "Course overview" "block"
103
    Then I should see "Course 3" in the "Course overview" "block"
104
    Then I should see "Course 4" in the "Course overview" "block"
105
    Then I should see "Course 5" in the "Course overview" "block"
106
 
107
  Scenario: View past courses - w/ persistence
108
    Given I am on the "My courses" page logged in as "student1"
109
    And I click on "All" "button" in the "Course overview" "block"
110
    When I click on "Past" "link" in the "Course overview" "block"
111
    And I reload the page
112
    Then I should see "Past" in the "Course overview" "block"
113
    Then I should see "Course 1" in the "Course overview" "block"
114
    And I should not see "Course 2" in the "Course overview" "block"
115
    And I should not see "Course 3" in the "Course overview" "block"
116
    And I should not see "Course 4" in the "Course overview" "block"
117
    And I should not see "Course 5" in the "Course overview" "block"
118
 
119
  Scenario: View future courses - w/ persistence
120
    Given I am on the "My courses" page logged in as "student1"
121
    And I click on "All" "button" in the "Course overview" "block"
122
    When I click on "Future" "link" in the "Course overview" "block"
123
    And I reload the page
124
    Then I should see "Future" in the "Course overview" "block"
125
    Then I should see "Course 5" in the "Course overview" "block"
126
    And I should not see "Course 1" in the "Course overview" "block"
127
    And I should not see "Course 2" in the "Course overview" "block"
128
    And I should not see "Course 3" in the "Course overview" "block"
129
    And I should not see "Course 4" in the "Course overview" "block"
130
 
131
  Scenario: View favourite courses - w/ persistence
132
    Given I am on the "My courses" page logged in as "student1"
133
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
134
    And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
135
    And I click on "All" "button" in the "Course overview" "block"
136
    When I click on "Starred" "link" in the "Course overview" "block"
137
    And I reload the page
138
    Then I should see "Starred" in the "Course overview" "block"
139
    And I should see "Course 2" in the "Course overview" "block"
140
    And I should not see "Course 1" in the "Course overview" "block"
141
    And I should not see "Course 3" in the "Course overview" "block"
142
    And I should not see "Course 4" in the "Course overview" "block"
143
    And I should not see "Course 5" in the "Course overview" "block"
144
 
145
  Scenario: List display  persistence
146
    Given I am on the "My courses" page logged in as "student1"
147
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
148
    And I click on "List" "link" in the "Course overview" "block"
149
    And I reload the page
150
    Then I should see "List" in the "Course overview" "block"
151
    And "[data-display='list']" "css_element" in the "Course overview" "block" should be visible
152
 
153
  Scenario: Cards display  persistence
154
    Given I am on the "My courses" page logged in as "student1"
155
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
156
    And I click on "Card" "link" in the "Course overview" "block"
157
    And I reload the page
158
    Then I should see "Card" in the "Course overview" "block"
159
    And "[data-display='card']" "css_element" in the "Course overview" "block" should be visible
160
 
161
  Scenario: Summary display  persistence
162
    Given I am on the "My courses" page logged in as "student1"
163
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
164
    And I click on "Summary" "link" in the "Course overview" "block"
165
    And I reload the page
166
    Then I should see "Summary" in the "Course overview" "block"
167
    And "[data-display='summary']" "css_element" in the "Course overview" "block" should be visible
168
 
169
  Scenario: Course name sort persistence
170
    Given I am on the "My courses" page logged in as "student1"
171
    And I click on "sortingdropdown" "button" in the "Course overview" "block"
172
    And I click on "Sort by course name" "link" in the "Course overview" "block"
173
    And I reload the page
174
    Then I should see "Sort by course name" in the "Course overview" "block"
175
    And "[data-sort='fullname']" "css_element" in the "Course overview" "block" should be visible
176
 
177
  Scenario: Last accessed sort persistence
178
    Given I am on the "My courses" page logged in as "student1"
179
    And I click on "sortingdropdown" "button" in the "Course overview" "block"
180
    And I click on "Sort by last accessed" "link" in the "Course overview" "block"
181
    And I reload the page
182
    Then I should see "Sort by last accessed" in the "Course overview" "block"
183
    And "[data-sort='ul.timeaccess desc']" "css_element" in the "Course overview" "block" should be visible
184
 
185
  Scenario: Short name sort persistence
186
    Given I am on the "My courses" page logged in as "student1"
187
    When I click on "sortingdropdown" "button" in the "Course overview" "block"
188
    Then I should not see "Sort by short name" in the "Course overview" "block"
189
    When the following config values are set as admin:
190
      | config               | value |
191
      | courselistshortnames | 1     |
192
    And I reload the page
193
    And I click on "sortingdropdown" "button" in the "Course overview" "block"
194
    And I click on "Sort by short name" "link" in the "Course overview" "block"
195
    And I reload the page
196
    Then I should see "Sort by short name" in the "Course overview" "block"
197
    And "[data-sort='shortname']" "css_element" in the "Course overview" "block" should be visible
198
 
199
  Scenario: View inprogress courses with hide persistent functionality
200
    Given I am on the "My courses" page logged in as "student1"
201
    And I click on "All" "button" in the "Course overview" "block"
202
    When I click on "In progress" "link" in the "Course overview" "block"
203
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
204
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
205
    And I reload the page
206
    Then I should see "Course 3" in the "Course overview" "block"
207
    Then I should see "Course 4" in the "Course overview" "block"
208
    And I should not see "Course 2" in the "Course overview" "block"
209
    And I should not see "Course 1" in the "Course overview" "block"
210
    And I should not see "Course 5" in the "Course overview" "block"
211
 
212
  Scenario: View past courses with hide persistent functionality
213
    Given I am on the "My courses" page logged in as "student1"
214
    And I click on "All" "button" in the "Course overview" "block"
215
    When I click on "Past" "link" in the "Course overview" "block"
216
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 1')]" "xpath_element"
217
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 1')]" "xpath_element"
218
    And I reload the page
219
    Then I should not see "Course 1" in the "Course overview" "block"
220
    And I should not see "Course 2" in the "Course overview" "block"
221
    And I should not see "Course 3" in the "Course overview" "block"
222
    And I should not see "Course 4" in the "Course overview" "block"
223
    And I should not see "Course 5" in the "Course overview" "block"
224
 
225
  Scenario: View future courses with hide persistent functionality
226
    Given I am on the "My courses" page logged in as "student1"
227
    And I click on "All" "button" in the "Course overview" "block"
228
    When I click on "Future" "link" in the "Course overview" "block"
229
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
230
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
231
    And I reload the page
232
    Then I should not see "Course 5" in the "Course overview" "block"
233
    And I should not see "Course 1" in the "Course overview" "block"
234
    And I should not see "Course 2" in the "Course overview" "block"
235
    And I should not see "Course 3" in the "Course overview" "block"
236
    And I should not see "Course 4" in the "Course overview" "block"
237
 
238
  Scenario: View all (except hidden) courses with hide persistent functionality
239
    Given I am on the "My courses" page logged in as "student1"
240
    And I click on "All" "button" in the "Course overview" "block"
241
    When I click on "All" "link" in the "Course overview" "block"
242
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
243
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
244
    And I reload the page
245
    Then I should not see "Course 5" in the "Course overview" "block"
246
    And I should see "Course 1" in the "Course overview" "block"
247
    And I should see "Course 2" in the "Course overview" "block"
248
    And I should see "Course 3" in the "Course overview" "block"
249
    And I should see "Course 4" in the "Course overview" "block"
250
 
251
  Scenario: View all (including removed from view) courses with hide persistent functionality
252
    Given the following config values are set as admin:
253
      | config                            | value | plugin           |
254
      | displaygroupingallincludinghidden | 1     | block_myoverview |
255
    And I am on the "My courses" page logged in as "student1"
256
    And I click on "All" "button" in the "Course overview" "block"
257
    # We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including removed from view)" element instead
258
    When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
259
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
260
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 5')]" "xpath_element"
261
    And I reload the page
262
    Then I should see "Course 5" in the "Course overview" "block"
263
    And I should see "Course 1" in the "Course overview" "block"
264
    And I should see "Course 2" in the "Course overview" "block"
265
    And I should see "Course 3" in the "Course overview" "block"
266
    And I should see "Course 4" in the "Course overview" "block"
267
 
268
  Scenario: Show course category in cards display
269
    Given the following config values are set as admin:
270
      | displaycategories | 1 | block_myoverview |
271
    And I am on the "My courses" page logged in as "student1"
272
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
273
    When I click on "Card" "link" in the "Course overview" "block"
274
    Then I should see "Category 1" in the "Course overview" "block"
275
 
276
  Scenario: Show course category in list display
277
    Given the following config values are set as admin:
278
      | displaycategories | 1 | block_myoverview |
279
    And I am on the "My courses" page logged in as "student1"
280
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
281
    When I click on "List" "link" in the "Course overview" "block"
282
    Then I should see "Category 1" in the "Course overview" "block"
283
 
284
  Scenario: Show course category in summary display
285
    Given the following config values are set as admin:
286
      | displaycategories | 1 | block_myoverview |
287
    And I am on the "My courses" page logged in as "student1"
288
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
289
    When I click on "Summary" "link" in the "Course overview" "block"
290
    Then I should see "Category 1" in the "Course overview" "block"
291
 
292
  Scenario: Hide course category in cards display
293
    Given the following config values are set as admin:
294
      | displaycategories | 0 | block_myoverview |
295
    And I am on the "My courses" page logged in as "student1"
296
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
297
    When I click on "Card" "link" in the "Course overview" "block"
298
    Then I should not see "Category 1" in the "Course overview" "block"
299
 
300
  Scenario: Hide course category in list display
301
    Given the following config values are set as admin:
302
      | displaycategories | 0 | block_myoverview |
303
    And I am on the "My courses" page logged in as "student1"
304
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
305
    When I click on "List" "link" in the "Course overview" "block"
306
    Then I should not see "Category 1" in the "Course overview" "block"
307
 
308
  Scenario: Show course category in summary display
309
    Given the following config values are set as admin:
310
      | displaycategories | 0 | block_myoverview |
311
    And I am on the "My courses" page logged in as "student1"
312
    And I click on "Display drop-down menu" "button" in the "Course overview" "block"
313
    When I click on "Summary" "link" in the "Course overview" "block"
314
    Then I should not see "Category 1" in the "Course overview" "block"
315
 
316
  @accessibility
317
  Scenario: The dashboard page must have sufficient colour contrast
318
    When I am on the "My courses" page logged in as "student1"
319
    Then the page should meet "wcag143" accessibility standards