group_view_block.feature 22.7 KB
Newer Older
1
@javascript @core @core_group
2
3
4
5
6
7
8
9
10
11
12
13
Feature: Show the block "Group pages" in the group homepage
    In order to see group pages, shared and submitted pages/collections to a group
    As a group member or group admin
    So I can see these lists on the block "Group pages" in the group homepage

Background:
    Given the following "institutions" exist:
     | name | displayname | registerallowed | registerconfirm |
     | instone | Institution One | ON | OFF |
     | insttwo | Institution Two | ON | OFF |
    Given the following "users" exist:
     | username | password | email | firstname | lastname | institution | authname | role |
14
15
16
     | userA | Kupuhipa1 | test01@example.com | Pete | Mc | instone | internal | staff |
     | userB | Kupuhipa1 | test02@example.com | Son | Nguyen | instone | internal | member |
     | userC | Kupuhipa1 | test03@example.com | Tim | Bruce | instone | internal | member |
17
18
19
20
    And the following "groups" exist:
     | name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff |
     | Group Y | userA | This is group Y | standard | ON | OFF | all | OFF | OFF | userB, userC |  |
     | Group Z | userA | This is group Z | standard | ON | OFF | all | ON | OFF | userB, userC |  |
21
22
     | Group W | userA | This is group W | standard | ON | OFF | all | ON | OFF | userB, UserC |  |
     | Group X | userA | This is group X | course | ON | OFF | all | ON | OFF | userC | userB |
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    And the following "pages" exist:
      | title | description| ownertype | ownername |
      | Page userA_01 | This is the page 01 | user | userA |
      | Page userA_02 | This is the page 02 | user | userA |
      | Page userA_03 | This is the page 03 | user | userA |
      | Page userA_04 | This is the page 04 | user | userA |
      | Page userA_05 | This is the page 05 | user | userA |
      | Page userA_06 | This is the page 06 | user | userA |
      | Page userA_07 | This is the page 07 | user | userA |
      | Page userA_08 | This is the page 08 | user | userA |
      | Page userA_09 | This is the page 09 | user | userA |
      | Page userA_10 | This is the page 10 | user | userA |
      | Page userA_11 | This is the page 11 | user | userA |
      | Page userA_12 | This is the page 12 | user | userA |
      | Page userB_01 | userB's page 01 | user | userB |
      | Page userB_02 | userB's page 02 | user | userB |
      | Page userB_03 | userB's page 03 | user | userB |
      | Page userB_04 | userB's page 04 | user | userB |
      | Page userB_05 | userB's page 05 | user | userB |
      | Page userB_06 | userB's page 06 | user | userB |
      | Page userB_07 | userB's page 07 | user | userB |
      | Page Group Z_01 | Group page 01 | group | Group Z |
      | Page Group Z_02 | Group page 02 | group | Group Z |
      | Page Group Z_03 | Group page 03 | group | Group Z |
      | Page Group Z_04 | Group page 04 | group | Group Z |
      | Page Group Z_05 | Group page 05 | group | Group Z |
      | Page Group Z_06 | Group page 06 | group | Group Z |
      | Page Group Z_07 | Group page 07 | group | Group Z |
      | Page Group Z_08 | Group page 08 | group | Group Z |
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
      #to test shared/submitted views
      | Page userC_01 | This is the page 01 | user | userC |
      | Page userC_02 | This is the page 02 | user | userC |
      | Page userC_03 | This is the page 03 | user | userC |
      | Page userC_04 | This is the page 04 | user | userC |
      | Page userC_05 | This is the page 05 | user | userC |
      | Page userC_06 | This is the page 06 | user | userC |
      | Page userC_07 | This is the page 07 | user | userC |
      | Page userC_08 | This is the page 08 | user | userC |
      | Page userC_09 | This is the page 09 | user | userC |
      | Page userC_10 | This is the page 10 | user | userC |
      | Page userC_11 | This is the page 11 | user | userC |
      | Page userC_12 | This is the page 12 | user | userC |
      | Page userC_13 | This is the page 13 | user | userC |
      | Page userC_14 | This is the page 14 | user | userC |
      | Page userC_15 | This is the page 15 | user | userC |
      | Page userC_16 | This is the page 16 | user | userC |
69
70
71
72
73
74
75
76
    And the following "collections" exist:
      | title | description| ownertype | ownername | pages |
      | Collection userA_01 | This is the collection 01 | user | userA | Page userA_06, Page userA_12 |
      | Collection userA_02 | This is the collection 02 | user | userA | Page userA_07 |
      | Collection userA_03 | This is the collection 03 | user | userA | Page userA_08 |
      | Collection userA_04 | This is the collection 04 | user | userA | Page userA_09 |
      | Collection userA_05 | This is the collection 05 | user | userA | Page userA_10 |
      | Collection userA_06 | This is the collection 06 | user | userA | Page userA_11 |
77
78
79
80
81
82
83
84
85
      #to test shared/submitted views
      | Collection userC_01 | This is the collection 01 | user | userC | Page userC_05 |
      | Collection userC_02 | This is the collection 02 | user | userC | Page userC_06 |
      | Collection userC_03 | This is the collection 03 | user | userC | Page userC_07 |
      | Collection userC_04 | This is the collection 04 | user | userC | Page userC_08 |
      | Collection userC_05 | This is the collection 05 | user | userC | Page userC_13 |
      | Collection userC_06 | This is the collection 06 | user | userC | Page userC_14 |
      | Collection userC_07 | This is the collection 07 | user | userC | Page userC_15 |
      | Collection userC_08 | This is the collection 08 | user | userC | Page userC_16 |
86
87
88
89
90

Scenario: The list of group pages, shared/submitted pages and collections should
be displayed page by page and sorted by "page title (A-Z)" or "most recently updated".
These list must take into account the sort option choosen in the block config (Bug 1457246)
    # Log in as a normal user
91
    Given I log in as "userA" with password "Kupuhipa1"
92
93
94
95
96
97
    # Verifying log in was successful
    And I should see "Pete"
    And I should see "Group Z"
    # Share pages and collections to the "Group Z"
    # Edit access for Page userA_01
    And I choose "Shared by me" in "Portfolio"
Robert Lyon's avatar
Robert Lyon committed
98
    And I follow "Pages" in the "div#main-column-container" "css_element"
99
    And I click on "Edit access" in "Page userA_01" row
100
    And I set the select2 value "Page userA_01, Page userA_02, Page userA_03, Page userA_04, Page userA_05" for "editaccess_views"
Robert Lyon's avatar
Robert Lyon committed
101
    And I select "Group Z" from "accesslist[0][searchtype]"
102
103
104
    And I press "Save"
    # Edit access for Collection userA_01
    And I choose "Shared by me" in "Portfolio"
Robert Lyon's avatar
Robert Lyon committed
105
    And I follow "Collections" in the "div#main-column-container" "css_element"
106
    And I click on "Edit access" in "Collection userA_01" row
107
    And I should not see "Collection userA_02" in the "ul.select2-selection__rendered" "css_element"
108
    And I set the select2 value "Collection userA_01, Collection userA_02, Collection userA_03, Collection userA_04, Collection userA_05, Collection userA_06" for "editaccess_collections"
Robert Lyon's avatar
Robert Lyon committed
109
    And I select "Group Z" from "accesslist[0][searchtype]"
110
111
112
    And I press "Save"
    And I log out
    # Log in as a normal user
113
    Given I log in as "userB" with password "Kupuhipa1"
114
115
116
117
118
119
120
    # Verifying log in was successful
    And I should see "Son"
    And I should see "Group Z"
    # Share pages and collections to the "Group Z"
    # Edit access for pages
    And I choose "Shared by me" in "Portfolio"
    And I click on "Edit access" in "Page userB_01" row
121
    And I set the select2 value "Page userB_01, Page userB_02, Page userB_03, Page userB_04, Page userB_05, Page userB_06, Page userB_07" for "editaccess_views"
Robert Lyon's avatar
Robert Lyon committed
122
    And I select "Group Z" from "accesslist[0][searchtype]"
123
124
125
    And I press "Save"
    And I log out
    # Check the list of shared pages to group "Group Z"
126
    Given I log in as "userC" with password "Kupuhipa1"
127
128
129
    # Verifying log in was successful
    And I should see "Tim"
    And I should see "Group Z"
130
    And I scroll to the base of id "groups"
131
    And I follow "Group Z" in the "div#groups" "css_element"
132
    # Group pages
133
134
135
    And I should see "Page Group Z_01" in the "ul#groupviewlist" "css_element"
    And I should see "Page Group Z_05" in the "ul#groupviewlist" "css_element"
    And I should not see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
Son Nguyen's avatar
Son Nguyen committed
136
137
    #And I follow "Next page" in the "div#groupviews_pagination" "css_element"
    And I jump to next page of the list "groupviews_pagination"
138
    And I wait "2" seconds
139
140
141
    And I should see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
    And I should see "Page Group Z_08" in the "ul#groupviewlist" "css_element"
    And I should not see "Page Group Z_05" in the "ul#groupviewlist" "css_element"
142
    # Shared pages
143
144
145
    And I should see "Page userA_01" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userA_05" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userB_01" in the "ul#sharedviewlist" "css_element"
Son Nguyen's avatar
Son Nguyen committed
146
147
    #And I follow "2" in the "div#sharedviews_pagination" "css_element"
    And I jump to page "2" of the list "sharedviews_pagination"
148
149
150
151
    And I should see "Page userB_01" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userB_05" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userA_05" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userB_06" in the "ul#sharedviewlist" "css_element"
Son Nguyen's avatar
Son Nguyen committed
152
153
    #And I follow "3" in the "div#sharedviews_pagination" "css_element"
    And I jump to page "3" of the list "sharedviews_pagination"
154
155
156
157
    And I should see "Page userB_06" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userB_07" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userA_01" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userB_01" in the "ul#sharedviewlist" "css_element"
158
    # Shared collections
159
160
161
    And I should see "Collection userA_01" in the "ul#sharedcollectionlist" "css_element"
    And I should see "Collection userA_05" in the "ul#sharedcollectionlist" "css_element"
    And I should not see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
Son Nguyen's avatar
Son Nguyen committed
162
163
    #And I follow "2" in the "div#sharedcollections_pagination" "css_element"
    And I jump to page "2" of the list "sharedcollections_pagination"
164
165
    And I should see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
    And I should not see "Collection userA_05" in the "ul#sharedcollectionlist" "css_element"
166
    And I log out
167
168
169
170
171
172
173
174
175
176
177
178
    # Check that we can see submitted pages before editing/saving the configuration for group pages block
    Given I log in as "userB" with password "Kupuhipa1"
    And I should see "Group Z"
    And I choose "My groups" in "Groups"
    And I follow "Group Z"
    And I select "Page userB_01" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Page userB_02" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I log out
179
    # Change the sort options in the "Group pages" block
180
    Given I log in as "userA" with password "Kupuhipa1"
181
    And I should see "Group Z"
182
    And I follow "Group Z (Administrator)"
183
    And I should see "Page userB_01"
184
185
    And I follow "Pages" in the "ul.nav-inpage" "css_element"
    And I click on "Edit \"Group homepage\""
186
    And I scroll to the id "column-container"
187
    And I configure the block "Group pages"
Son Nguyen's avatar
Son Nguyen committed
188
189
190
191
    And I set the following fields to these values:
    | Sort group pages by | Most recently updated |
    | Sort shared pages and collections by | Most recently updated |
    | Sort submitted pages and collections by | Most recently submitted |
192
    And I press "Save"
Son Nguyen's avatar
Son Nguyen committed
193
    And I display the page
194
    # Update the group page "Page Group Z_06"
195
196
    And I follow "Pages" in the "ul.nav-inpage" "css_element"
    And I click on "Edit \"Page Group Z_06\""
197
198
199
    And I follow "Edit title and description"
    And I set the field "Page description" to "<p>Group page 06 (updated)</p>"
    And I press "Save"
Son Nguyen's avatar
Son Nguyen committed
200
    And I display the page
201
    # Check if it is now in the first page of the list of group pages
202
203
204
    And I follow "Groups"
    And I follow "Group Z"
    And I should see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
Son Nguyen's avatar
Son Nguyen committed
205
206
    #And I follow "Next" in the "div#groupviews_pagination" "css_element"
    And I jump to next page of the list "groupviews_pagination"
207
    And I should not see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
208
209
    # Update the shared page "Page userA_01"
    And I choose "Portfolio"
210
    And I scroll to the id "searchresultsheading"
211
    And I click on "Edit \"Page userA_01\""
212
    And I follow "Edit title and description"
213
    And I set the field "Page description" to "<p>This is the page 01 (updated)</p>"
214
    And I press "Save"
Son Nguyen's avatar
Son Nguyen committed
215
    And I display the page
216
217
218
    # Check if it is now in the first page of the list of shared pages
    And I choose "Groups"
    And I follow "Group Z"
219
    And I should see "Page userA_01" in the "ul#sharedviewlist" "css_element"
Son Nguyen's avatar
Son Nguyen committed
220
221
    #And I follow "2" in the "div#sharedviews_pagination" "css_element"
    And I jump to page "2" of the list "sharedviews_pagination"
222
    And I should not see "Page userA_01" in the "ul#sharedviewlist" "css_element"
223
224
    # Update the shared collection "Collection userA_06"
    And I choose "Collections" in "Portfolio"
225
    And I click on "Edit \"Collection userA_06\""
226
    And I set the field "Collection description" to "This is the collection 06 (updated)"
227
228
229
230
    And I press "Save"
    # Check if it is now in the first page of the list of shared collections
    And I choose "Groups"
    And I follow "Group Z"
231
    And I should see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
Son Nguyen's avatar
Son Nguyen committed
232
233
    #And I follow "2" in the "div#sharedcollections_pagination" "css_element"
    And I jump to page "2" of the list "sharedcollections_pagination"
234
    And I should not see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
    # Submit some pages and collections to the group "Group Z"
    And I select "Page userA_01" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Page userA_02" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Page userA_03" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userA_01" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userA_02" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userA_03" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    # Check the list of submitted pages/collections
255
256
    And I should see "Page userA_03" in the "ul#allsubmissionlist" "css_element"
    And I should see "Page userA_02" in the "ul#allsubmissionlist" "css_element"
257
    And I should see "Collection userA_03" in the "ul#allsubmissionlist" "css_element"
258
    And I should not see "Page userB_01" in the "ul#allsubmissionlist" "css_element"
Son Nguyen's avatar
Son Nguyen committed
259
260
    #And I follow "2" in the "div#allsubmitted_pagination" "css_element"
    And I jump to page "2" of the list "allsubmitted_pagination"
261
    And I should see "Page userA_01" in the "ul#allsubmissionlist" "css_element"
262
263
    And I should see "Page userB_01" in the "ul#allsubmissionlist" "css_element"
    And I should not see "Page userA_02" in the "ul#allsubmissionlist" "css_element"
264
    And I log out
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
    # Check pages and collections are shown in correct section
    # Share and submit pages and collections
    # Log in as a normal user
    Given I log in as "userC" with password "Kupuhipa1"
    # Verifying log in was successful
    And I should see "Tim"
    And I should see "Group W"
    # Share pages and collections to the standard "Group W"
    # Edit access for Page userC_01, Page userC_03, Page userC_04
    And I choose "Shared by me" in "Portfolio"
    And I follow "Pages" in the "div#main-column-container" "css_element"
    And I click on "Edit access" in "Page userC_01" row
    And I set the select2 value "Page userC_01, Page userC_03, Page userC_04" for "editaccess_views"
    And I select "Group W" from "accesslist[0][searchtype]"
    And I press "Save"
    # Edit access for Collection userC_01, Collection userC_03, Collection userC_04
    And I choose "Shared by me" in "Portfolio"
    And I follow "Collections" in the "div#main-column-container" "css_element"
    And I click on "Edit access" in "Collection userC_01" row
    And I set the select2 value "Collection userC_01, Collection userC_03, Collection userC_04" for "editaccess_collections"
    And I select "Group W" from "accesslist[0][searchtype]"
    And I press "Save"
    # Submit pages and collections to the "Group W" and "Group Z"
    And I choose "Groups"
    And I follow "Group W"
    And I select "Page userC_02" from "group_view_submission_form_3_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Page userC_03" from "group_view_submission_form_3_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userC_02" from "group_view_submission_form_3_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userC_03" from "group_view_submission_form_3_options"
    And I press "Submit"
    And I press "Yes"
    And I choose "Groups"
    And I follow "Group Z"
    And I select "Page userC_04" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userC_04" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I log out
    #Check cases
    Given I log in as "userA" with password "Kupuhipa1"
    # Verifying log in was successful
    And I should see "Pete"
    And I should see "Group W"
    And I follow "Group W"
    And I should see "Page userC_01" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userC_03" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userC_04" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userC_02" in the "ul#allsubmissionlist" "css_element"
    And I should see "Page userC_03" in the "ul#allsubmissionlist" "css_element"
    And I should see "Collection userC_01" in the "ul#sharedcollectionlist" "css_element"
    And I should not see "Collection userC_03" in the "ul#sharedcollectionlist" "css_element"
    And I should see "Collection userC_04" in the "ul#sharedcollectionlist" "css_element"
    And I should see "Collection userC_02" in the "ul#allsubmissionlist" "css_element"
    And I should see "Collection userC_03" in the "ul#allsubmissionlist" "css_element"
    And I log out
    Given I log in as "userB" with password "Kupuhipa1"
    # Verifying log in was successful
    And I should see "Son"
    And I should see "Group W"
    And I follow "Group W"
    And I should see "Page userC_01" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userC_02" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userC_03" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userC_04" in the "ul#sharedviewlist" "css_element"
    And I should see "Collection userC_01" in the "ul#sharedcollectionlist" "css_element"
    And I should not see "Collection userC_02" in the "ul#sharedcollectionlist" "css_element"
    And I should see "Collection userC_03" in the "ul#sharedcollectionlist" "css_element"
    And I should see "Collection userC_04" in the "ul#sharedcollectionlist" "css_element"
    And I log out
    # Share and submit pages and collections - for course group "Group X"
    # Log in as a normal user
    Given I log in as "userC" with password "Kupuhipa1"
    # Verifying log in was successful
    And I should see "Tim"
    And I should see "Group X"
    # Share pages and collections to the "Group X"
    # Edit access for Page userC_09, Page userC_11, Page userC_12
    And I choose "Shared by me" in "Portfolio"
    And I follow "Pages" in the "div#main-column-container" "css_element"
    And I click on "Edit access" in "Page userC_09" row
    And I set the select2 value "Page userC_09, Page userC_11, Page userC_12" for "editaccess_views"
    And I select "Group X" from "accesslist[0][searchtype]"
    And I press "Save"
    # Edit access for Collection userC_05, Collection userC_07, Collection userC_08
    And I choose "Shared by me" in "Portfolio"
    And I follow "Collections" in the "div#main-column-container" "css_element"
    And I click on "Edit access" in "Collection userC_05" row
    And I set the select2 value "Collection userC_05, Collection userC_07, Collection userC_08" for "editaccess_collections"
    And I select "Group X" from "accesslist[0][searchtype]"
    And I press "Save"
    # Submit pages and collections to the "Group X" and "Group Z"
    And I choose "Groups"
    And I follow "Group X"
    And I select "Page userC_10" from "group_view_submission_form_4_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Page userC_11" from "group_view_submission_form_4_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userC_06" from "group_view_submission_form_4_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userC_07" from "group_view_submission_form_4_options"
    And I press "Submit"
    And I press "Yes"
    And I choose "Groups"
    And I follow "Group Z"
    And I select "Page userC_12" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I select "Collection userC_08" from "group_view_submission_form_2_options"
    And I press "Submit"
    And I press "Yes"
    And I log out
    #Check cases
    Given I log in as "userB" with password "Kupuhipa1"
    # Verifying log in was successful
    And I should see "Son"
    And I should see "Group X"
    And I follow "Group X"
    And I should see "Page userC_09" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userC_10" in the "ul#sharedviewlist" "css_element"
    And I should not see "Page userC_11" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userC_12" in the "ul#sharedviewlist" "css_element"
    And I should see "Page userC_10" in the "ul#allsubmissionlist" "css_element"
    And I should see "Page userC_11" in the "ul#allsubmissionlist" "css_element"
    And I should see "Collection userC_05" in the "ul#sharedcollectionlist" "css_element"
    And I should not see "Collection userC_06" in the "ul#sharedcollectionlist" "css_element"
    And I should not see "Collection userC_07" in the "ul#sharedcollectionlist" "css_element"
    And I should see "Collection userC_08" in the "ul#sharedcollectionlist" "css_element"
    And I should see "Collection userC_06" in the "ul#allsubmissionlist" "css_element"
    And I should see "Collection userC_07" in the "ul#allsubmissionlist" "css_element"