Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_course
2
Feature: We can change the visibility of categories in the management interface.
3
  As a moodle admin
4
  I need to test hiding and showing a category.
5
  I need to test hiding and showing a sub category.
6
  I need to test visibility is applied to sub categories.
7
  I need to test visibility is applied to courses.
8
  I need to test visibility of children is reset when changing back.
9
 
10
  # Tests hiding and then showing a single category.
11
  Scenario: Test making a category hidden and then visible again.
12
    Given the following "categories" exist:
13
      | name | category | idnumber |
14
      | Cat 1 | 0 | CAT1 |
15
 
16
    And I log in as "admin"
17
    And I go to the courses management page
18
    And I should see the "Course categories and courses" management page
19
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
20
    And category in management listing should be visible "CAT1"
21
    And I toggle visibility of category "CAT1" in management listing
22
    # Redirect.
23
    And I should see the "Course categories and courses" management page
24
    And category in management listing should be dimmed "CAT1"
25
    And I toggle visibility of category "CAT1" in management listing
26
    # Redirect.
27
    And I should see the "Course categories and courses" management page
28
    And category in management listing should be visible "CAT1"
29
 
30
  # Tests hiding and then showing a single category.
31
  @javascript
32
  Scenario: Test using AJAX to make a category hidden and then visible again.
33
    Given the following "categories" exist:
34
      | name | category | idnumber |
35
      | Cat 1 | 0 | CAT1 |
36
 
37
    And I log in as "admin"
38
    And I go to the courses management page
39
    And I start watching to see if a new page loads
40
    And I should see the "Course categories and courses" management page
41
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
42
    And category in management listing should be visible "CAT1"
43
    And I toggle visibility of category "CAT1" in management listing
44
    And a new page should not have loaded since I started watching
45
    And category in management listing should be dimmed "CAT1"
46
    And I toggle visibility of category "CAT1" in management listing
47
    And a new page should not have loaded since I started watching
48
    And category in management listing should be visible "CAT1"
49
 
50
  # Tests hiding and then showing a subcategory.
51
  Scenario: Test making a subcategory hidden and then visible again.
52
    Given the following "categories" exist:
53
      | name | category | idnumber |
54
      | Cat 1 | 0 | CAT1 |
55
      | Cat 2 | CAT1 | CAT2 |
56
 
57
    And I log in as "admin"
58
    And I go to the courses management page
59
    And I should see the "Course categories and courses" management page
60
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
61
    And I should not see "Cat 2" in the "#category-listing ul" "css_element"
62
    And category in management listing should be visible "CAT1"
63
    And I click on category "Cat 1" in the management interface
64
    # Redirect.
65
    And I should see the "Course categories and courses" management page
66
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
67
    And I should see "Cat 2" in the "#category-listing ul" "css_element"
68
    And category in management listing should be visible "CAT1"
69
    And category in management listing should be visible "CAT2"
70
    And I toggle visibility of category "CAT2" in management listing
71
    # Redirect.
72
    And I should see the "Course categories and courses" management page
73
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
74
    And I should see "Cat 2" in the "#category-listing ul" "css_element"
75
    And category in management listing should be visible "CAT1"
76
    And category in management listing should be dimmed "CAT2"
77
    And I toggle visibility of category "CAT2" in management listing
78
    # Redirect.
79
    And I should see the "Course categories and courses" management page
80
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
81
    And I should see "Cat 2" in the "#category-listing ul" "css_element"
82
    And category in management listing should be visible "CAT1"
83
    And category in management listing should be visible "CAT2"
84
 
85
  # Tests hiding and then showing a subcategory.
86
  @javascript
87
  Scenario: Test using AJAX to make a subcategory hidden and then visible again.
88
    Given the following "categories" exist:
89
      | name | category | idnumber |
90
      | Cat 1 | 0 | CAT1 |
91
      | Cat 2 | CAT1 | CAT2 |
92
 
93
    And I log in as "admin"
94
    And I go to the courses management page
95
    And I start watching to see if a new page loads
96
    And I should see the "Course categories and courses" management page
97
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
98
    And I should not see "Cat 2" in the "#category-listing ul" "css_element"
99
    And category in management listing should be visible "CAT1"
100
    And I click to expand category "CAT1" in the management interface
101
    And a new page should not have loaded since I started watching
102
    And category in management listing should be visible "CAT1"
103
    And category in management listing should be visible "CAT2"
104
    And I toggle visibility of category "CAT2" in management listing
105
    And a new page should not have loaded since I started watching
106
    And category in management listing should be visible "CAT1"
107
    And category in management listing should be dimmed "CAT2"
108
    And I toggle visibility of category "CAT2" in management listing
109
    And a new page should not have loaded since I started watching
110
    And category in management listing should be visible "CAT1"
111
    And category in management listing should be visible "CAT2"
112
 
113
  # The test below this is identical except with JavaScript enabled.
114
  Scenario: Test relation between category and course when changing visibility.
115
    Given the following "categories" exist:
116
      | name | category | idnumber |
117
      | Cat 1 | 0 | CAT1 |
118
      | Cat 2 | 0 | CAT2 |
119
      | Cat 3 | CAT1 | CAT3 |
120
      | Cat 4 | CAT1 | CAT4 |
121
    And the following "courses" exist:
122
      | category | fullname | shortname | idnumber |
123
      | CAT1 | Course 1 | Course 1 | C1 |
124
      | CAT1 | Course 2 | Course 2 | C2 |
125
      | CAT1 | Course 3 | Course 3 | C3 |
126
 
127
    And I log in as "admin"
128
    And I go to the courses management page
129
    And I should see the "Course categories and courses" management page
130
    And I click on category "Cat 1" in the management interface
131
    # Redirect.
132
    And I should see the "Course categories and courses" management page
133
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
134
    And I should see "Cat 2" in the "#category-listing ul" "css_element"
135
    And I should see "Cat 3" in the "#category-listing ul" "css_element"
136
    And I should see "Cat 4" in the "#category-listing ul" "css_element"
137
    And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
138
    And I should see "Course 2" in the "#course-listing ul.course-list" "css_element"
139
    And I should see "Course 3" in the "#course-listing ul.course-list" "css_element"
140
    And category in management listing should be visible "CAT1"
141
    And category in management listing should be visible "CAT2"
142
    And category in management listing should be visible "CAT3"
143
    And category in management listing should be visible "CAT4"
144
    And course in management listing should be visible "C1"
145
    And course in management listing should be visible "C2"
146
    And course in management listing should be visible "C3"
147
    And I toggle visibility of course "C2" in management listing
148
    # Redirect.
149
    And I should see the "Course categories and courses" management page with a course selected
150
    And course in management listing should be visible "C1"
151
    And course in management listing should be dimmed "C2"
152
    And course in management listing should be visible "C3"
153
    And I toggle visibility of category "CAT3" in management listing
154
    # Redirect.
155
    And I should see the "Course categories and courses" management page
156
    And I toggle visibility of category "CAT1" in management listing
157
    # Redirect.
158
    And I should see the "Course categories and courses" management page
159
    And category in management listing should be dimmed "CAT1"
160
    And category in management listing should be visible "CAT2"
161
    And category in management listing should be dimmed "CAT3"
162
    And category in management listing should be dimmed "CAT4"
163
    And course in management listing should be dimmed "C1"
164
    And course in management listing should be dimmed "C2"
165
    And course in management listing should be dimmed "C3"
166
    And I toggle visibility of category "CAT1" in management listing
167
    # Redirect.
168
    And I should see the "Course categories and courses" management page
169
    And category in management listing should be visible "CAT1"
170
    And category in management listing should be visible "CAT2"
171
    And category in management listing should be dimmed "CAT3"
172
    And category in management listing should be visible "CAT4"
173
    And course in management listing should be visible "C1"
174
    And course in management listing should be dimmed "C2"
175
    And course in management listing should be visible "C3"
176
 
177
  # The test above this is identical except without JavaScript enabled.
178
  @javascript @_cross_browser
179
  Scenario: Test the relation between category and course when changing visibility with AJAX
180
    Given the following "categories" exist:
181
      | name | category | idnumber |
182
      | Cat 1 | 0 | CAT1 |
183
      | Cat 2 | 0 | CAT2 |
184
      | Cat 3 | CAT1 | CAT3 |
185
      | Cat 4 | CAT1 | CAT4 |
186
    And the following "courses" exist:
187
      | category | fullname | shortname | idnumber |
188
      | CAT1 | Course 1 | Course 1 | C1 |
189
      | CAT1 | Course 2 | Course 2 | C2 |
190
      | CAT1 | Course 3 | Course 3 | C3 |
191
 
192
    And I log in as "admin"
193
    And I go to the courses management page
194
    And I start watching to see if a new page loads
195
    And I should see the "Course categories and courses" management page
196
    And I click on category "Cat 1" in the management interface
197
    And a new page should have loaded since I started watching
198
    And I start watching to see if a new page loads
199
    And I should see the "Course categories and courses" management page
200
    And I should see "Cat 1" in the "#category-listing ul" "css_element"
201
    And I should see "Cat 2" in the "#category-listing ul" "css_element"
202
    And I should see "Cat 3" in the "#category-listing ul" "css_element"
203
    And I should see "Cat 4" in the "#category-listing ul" "css_element"
204
    And I should see "Course 1" in the "#course-listing ul.course-list" "css_element"
205
    And I should see "Course 2" in the "#course-listing ul.course-list" "css_element"
206
    And I should see "Course 3" in the "#course-listing ul.course-list" "css_element"
207
    And category in management listing should be visible "CAT1"
208
    And category in management listing should be visible "CAT2"
209
    And category in management listing should be visible "CAT3"
210
    And category in management listing should be visible "CAT4"
211
    And course in management listing should be visible "C1"
212
    And course in management listing should be visible "C2"
213
    And course in management listing should be visible "C3"
214
    And I toggle visibility of course "C2" in management listing
215
    And a new page should not have loaded since I started watching
216
    And I should see "Cat 3" in the "#category-listing ul" "css_element"
217
    And course in management listing should be visible "C1"
218
    And course in management listing should be dimmed "C2"
219
    And course in management listing should be visible "C3"
220
    And I toggle visibility of category "CAT3" in management listing
221
    And a new page should not have loaded since I started watching
222
    And category in management listing should be visible "CAT1"
223
    And category in management listing should be visible "CAT2"
224
    And category in management listing should be dimmed "CAT3"
225
    And category in management listing should be visible "CAT4"
226
    And course in management listing should be visible "C1"
227
    And course in management listing should be dimmed "C2"
228
    And course in management listing should be visible "C3"
229
    And I toggle visibility of category "CAT1" in management listing
230
    And a new page should not have loaded since I started watching
231
    And category in management listing should be dimmed "CAT1"
232
    And category in management listing should be visible "CAT2"
233
    And category in management listing should be dimmed "CAT3"
234
    And category in management listing should be dimmed "CAT4"
235
    And course in management listing should be dimmed "C1"
236
    And course in management listing should be dimmed "C2"
237
    And course in management listing should be dimmed "C3"
238
    And I toggle visibility of category "CAT1" in management listing
239
    And a new page should not have loaded since I started watching
240
    And category in management listing should be visible "CAT1"
241
    And category in management listing should be visible "CAT2"
242
    And category in management listing should be dimmed "CAT3"
243
    And category in management listing should be visible "CAT4"
244
    And course in management listing should be visible "C1"
245
    And course in management listing should be dimmed "C2"
246
    And course in management listing should be visible "C3"
247
 
248
  @javascript @_cross_browser
249
  Scenario: Test courses are hidden when selected category parent is hidden.
250
    Given the following "categories" exist:
251
      | name | category | idnumber |
252
      | Cat 1 | 0 | CAT1 |
253
      | Cat 2 | CAT1 | CAT2 |
254
      | Cat 3 | CAT2 | CAT3 |
255
    And the following "courses" exist:
256
      | category | fullname | shortname | idnumber |
257
      | CAT3 | Course 1 | Course 1 | C1 |
258
 
259
    And I log in as "admin"
260
    And I go to the courses management page
261
    And I start watching to see if a new page loads
262
    And I should see the "Course categories and courses" management page
263
    And I click on category "Cat 1" in the management interface
264
    And a new page should have loaded since I started watching
265
    And I start watching to see if a new page loads
266
    And I should see the "Course categories and courses" management page
267
    And I click on category "Cat 2" in the management interface
268
    And a new page should have loaded since I started watching
269
    And I start watching to see if a new page loads
270
    And I should see the "Course categories and courses" management page
271
    And I click on category "Cat 3" in the management interface
272
    And a new page should have loaded since I started watching
273
    And I start watching to see if a new page loads
274
    And I should see the "Course categories and courses" management page
275
    And category in management listing should be visible "CAT1"
276
    And category in management listing should be visible "CAT2"
277
    And category in management listing should be visible "CAT3"
278
    And course in management listing should be visible "C1"
279
    And I toggle visibility of category "CAT1" in management listing
280
    And a new page should not have loaded since I started watching
281
    And category in management listing should be dimmed "CAT1"
282
    And category in management listing should be dimmed "CAT2"
283
    And category in management listing should be dimmed "CAT3"
284
    And course in management listing should be dimmed "C1"
285
    And I toggle visibility of category "CAT1" in management listing
286
    And a new page should not have loaded since I started watching
287
    And category in management listing should be visible "CAT1"
288
    And category in management listing should be visible "CAT2"
289
    And category in management listing should be visible "CAT3"
290
    And course in management listing should be visible "C1"
291
    And I toggle visibility of course "C1" in management listing
292
    And a new page should not have loaded since I started watching
293
    And category in management listing should be visible "CAT1"
294
    And category in management listing should be visible "CAT2"
295
    And category in management listing should be visible "CAT3"
296
    And course in management listing should be dimmed "C1"
297
    And I toggle visibility of category "CAT1" in management listing
298
    And a new page should not have loaded since I started watching
299
    And category in management listing should be dimmed "CAT1"
300
    And category in management listing should be dimmed "CAT2"
301
    And category in management listing should be dimmed "CAT3"
302
    And course in management listing should be dimmed "C1"
303
    And I toggle visibility of category "CAT1" in management listing
304
    And a new page should not have loaded since I started watching
305
    And category in management listing should be visible "CAT1"
306
    And category in management listing should be visible "CAT2"
307
    And category in management listing should be visible "CAT3"
308
    And course in management listing should be dimmed "C1"