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

Background:
    Given the following "institutions" exist:
     | name | displayname | registerallowed | registerconfirm |
     | instone | Institution One | ON | OFF |
     | insttwo | Institution Two | ON | OFF |
12
13

    And the following "users" exist:
14
     | username | password | email | firstname | lastname | institution | authname | role |
Gregor Anzelj's avatar
Gregor Anzelj committed
15
16
17
     | UserA | Kupuh1pa! | UserA@example.org | Angela | User | instone | internal | staff |
     | UserB | Kupuh1pa! | UserB@example.org | Bob | User | instone | internal | member |
     | UserC | Kupuh1pa! | UserC@example.org | Cecilia | User | instone | internal | member |
18

19
20
    And the following "groups" exist:
     | name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff |
21
22
23
24
     | GroupA | UserA | GroupA owned by UserA | standard | ON | OFF | all | ON | OFF | UserB, UserC |  |
     | GroupB | UserA | GroupB owned by UserA | standard | ON | OFF | all | OFF | OFF | UserB, UserC |  |
     | GroupC | UserA | GroupC owned by UserA | course | ON | OFF | all | ON | OFF | UserC | UserB |
     | GroupD | UserA | GroupD owned by UserA | standard | ON | OFF | all | ON | OFF | UserB, UserC |  |
25

26
    And the following "pages" exist:
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
     | title | description | ownertype | ownername |
     | Page UserA_01 | Page 01 | user | UserA |
     | Page UserA_02 | Page 02 | user | UserA |
     | Page UserA_03 | Page 03 | user | UserA |
     | Page UserA_04 | Page 04 | user | UserA |
     | Page UserA_05 | Page 05 | user | UserA |
     | Page UserA_06 | Page 06 | user | UserA |
     | Page UserA_07 | Page 07 | user | UserA |
     | Page UserA_08 | Page 08 | user | UserA |
     | Page UserA_09 | Page 09 | user | UserA |
     | Page UserA_10 | Page 10 | user | UserA |
     | Page UserA_11 | Page 11 | user | UserA |
     | Page UserA_12 | 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 GroupA_01 | Group page 01 | group | GroupA |
     | Page GroupA_02 | Group page 02 | group | GroupA |
     | Page GroupA_03 | Group page 03 | group | GroupA |
     | Page GroupA_04 | Group page 04 | group | GroupA |
     | Page GroupA_05 | Group page 05 | group | GroupA |
     | Page GroupA_06 | Group page 06 | group | GroupA |
     | Page GroupA_07 | Group page 07 | group | GroupA |
     | Page GroupA_08 | Group page 08 | group | GroupA |
    # To test shared/submitted views
     | Page UserC_01 | Page 01 | user | UserC |
     | Page UserC_02 | Page 02 | user | UserC |
     | Page UserC_03 | Page 03 | user | UserC |
     | Page UserC_04 | Page 04 | user | UserC |
     | Page UserC_05 | Page 05 | user | UserC |
     | Page UserC_06 | Page 06 | user | UserC |
     | Page UserC_07 | Page 07 | user | UserC |
     | Page UserC_08 | Page 08 | user | UserC |
     | Page UserC_09 | Page 09 | user | UserC |
     | Page UserC_10 | Page 10 | user | UserC |
     | Page UserC_11 | Page 11 | user | UserC |
     | Page UserC_12 | Page 12 | user | UserC |
     | Page UserC_13 | Page 13 | user | UserC |
     | Page UserC_14 | Page 14 | user | UserC |
     | Page UserC_15 | Page 15 | user | UserC |
     | Page UserC_16 | Page 16 | user | UserC |

73
    And the following "collections" exist:
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
     | title | description | ownertype | ownername | pages |
     | Collection UserA_01 | Collection 01 | user | UserA | Page UserA_06, Page UserA_12 |
     | Collection UserA_02 | Collection 02 | user | UserA | Page UserA_07 |
     | Collection UserA_03 | Collection 03 | user | UserA | Page UserA_08 |
     | Collection UserA_04 | Collection 04 | user | UserA | Page UserA_09 |
     | Collection UserA_05 | Collection 05 | user | UserA | Page UserA_10 |
     | Collection UserA_06 | Collection 06 | user | UserA | Page UserA_11 |
    # To test shared/submitted views
     | Collection UserC_01 | Collection 01 | user | UserC | Page UserC_05 |
     | Collection UserC_02 | Collection 02 | user | UserC | Page UserC_06 |
     | Collection UserC_03 | Collection 03 | user | UserC | Page UserC_07 |
     | Collection UserC_04 | Collection 04 | user | UserC | Page UserC_08 |
     | Collection UserC_05 | Collection 05 | user | UserC | Page UserC_13 |
     | Collection UserC_06 | Collection 06 | user | UserC | Page UserC_14 |
     | Collection UserC_07 | Collection 07 | user | UserC | Page UserC_15 |
     | Collection UserC_08 | Collection 08 | user | UserC | Page UserC_16 |
90
91
92

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".
93
These list must take into account the sort option chosen in the block config (Bug 1457246)
94
    # Log in as a normal user
Gregor Anzelj's avatar
Gregor Anzelj committed
95
    Given I log in as "UserA" with password "Kupuh1pa!"
96
    # Verifying log in was successful
97
98
99
100
    And I should see "Angela"
    And I should see "GroupA"
    # Share pages and collections to the "GroupA"
    # Edit access for Page UserA_01
101
    And I choose "Shared by me" in "Share" from main menu
102
    And I follow "Pages"
103
104
105
    And I click on "Edit access" in "Page UserA_01" row
    And I set the select2 value "Page UserA_01, Page UserA_02, Page UserA_03, Page UserA_04, Page UserA_05" for "editaccess_views"
    And I select "GroupA" from "accesslist[0][searchtype]"
106
    And I press "Save"
107
    # Edit access for Collection UserA_01
108
    And I choose "Shared by me" in "Share" from main menu
109
    And I follow "Collections"
110
    And I click on "Edit access" in "Collection UserA_01" row
111
    And I should not see "Collection UserA_02" in the "Collections text-box" property
112
113
    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"
    And I select "GroupA" from "accesslist[0][searchtype]"
114
115
116
    And I press "Save"
    And I log out
    # Log in as a normal user
Gregor Anzelj's avatar
Gregor Anzelj committed
117
    Given I log in as "UserB" with password "Kupuh1pa!"
118
    # Verifying log in was successful
119
120
121
    And I should see "Bob"
    And I should see "GroupA"
    # Share pages and collections to the "GroupA"
122
    # Edit access for pages
123
    And I choose "Shared by me" in "Share" from main menu
124
125
126
    And I click on "Edit access" in "Page UserB_01" row
    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"
    And I select "GroupA" from "accesslist[0][searchtype]"
127
128
    And I press "Save"
    And I log out
129
    # Check the list of shared pages to group "GroupA"
Gregor Anzelj's avatar
Gregor Anzelj committed
130
    Given I log in as "UserC" with password "Kupuh1pa!"
131
    # Verifying log in was successful
132
133
    And I should see "Cecilia"
    And I should see "GroupA"
134
    And I scroll to the base of id "groups"
135
    And I follow "GroupA" in the "My groups box" property
136
    # Group portfolios
137
138
    And I should see "Page GroupA_05" in the "Group portfolios" property
    And I should not see "Page GroupA_06" in the "Group portfolios" property
Son Nguyen's avatar
Son Nguyen committed
139
140
    #And I follow "Next page" in the "div#groupviews_pagination" "css_element"
    And I jump to next page of the list "groupviews_pagination"
141
142
    And I should see "Page GroupA_08" in the "Group portfolios" property
    And I should not see "Page GroupA_05" in the "Group portfolios" property
143
    # Shared pages
144
145
146
    And I should see "Page UserA_01" in the "Pages shared with this group" property
    And I should see "Page UserA_05" in the "Pages shared with this group" property
    And I should not see "Page UserB_01" in the "Pages shared with this group" property
Son Nguyen's avatar
Son Nguyen committed
147
148
    #And I follow "2" in the "div#sharedviews_pagination" "css_element"
    And I jump to page "2" of the list "sharedviews_pagination"
149
150
    And I should see "Page UserB_05" in the "Pages shared with this group" property
    And I should not see "Page UserA_05" in the "Pages shared with this group" property
Son Nguyen's avatar
Son Nguyen committed
151
152
    #And I follow "3" in the "div#sharedviews_pagination" "css_element"
    And I jump to page "3" of the list "sharedviews_pagination"
153
154
    And I should see "Page UserB_06" in the "Pages shared with this group" property
    And I should not see "Page UserB_01" in the "Pages shared with this group" property
155
    # Shared collections
156
157
    And I should see "Collection UserA_05" in the "Collections shared with this group" property
    And I should not see "Collection UserA_06" in the "Collections shared with this group" property
Son Nguyen's avatar
Son Nguyen committed
158
159
    #And I follow "2" in the "div#sharedcollections_pagination" "css_element"
    And I jump to page "2" of the list "sharedcollections_pagination"
160
161
    And I should see "Collection UserA_06" in the "Collections shared with this group" property
    And I should not see "Collection UserA_05" in the "Collections shared with this group" property
162
    And I log out
163
    # Check that we can see submitted pages before editing/saving the configuration for group pages block
Gregor Anzelj's avatar
Gregor Anzelj committed
164
    Given I log in as "UserB" with password "Kupuh1pa!"
165
    And I should see "GroupA"
166
    And I choose "My groups" in "Engage" from main menu
167
    And I scroll to the base of id "mygroups"
168
169
    And I follow "GroupA"
    And I select "Page UserB_01" from "group_view_submission_form_1_options"
170
171
    And I press "Submit"
    And I press "Yes"
172
    And I select "Page UserB_02" from "group_view_submission_form_1_options"
173
174
175
    And I press "Submit"
    And I press "Yes"
    And I log out
176
    # Change the sort options in the "Group pages" block
Gregor Anzelj's avatar
Gregor Anzelj committed
177
    Given I log in as "UserA" with password "Kupuh1pa!"
178
179
    And I follow "GroupA (Administrator)"
    And I should see "Page UserB_01"
180
    And I follow "Pages and collections (tab)"
181
182
183
    And I click on "Group homepage" panel menu
    And I click on "Edit" in "Group homepage" panel menu

184
    And I scroll to the id "column-container"
185
    And I configure the block "Group portfolios"
Son Nguyen's avatar
Son Nguyen committed
186
    And I set the following fields to these values:
187
    | Sort group pages and collections by | Most recently updated |
Son Nguyen's avatar
Son Nguyen committed
188
189
    | Sort shared pages and collections by | Most recently updated |
    | Sort submitted pages and collections by | Most recently submitted |
190
    And I press "Save"
Son Nguyen's avatar
Son Nguyen committed
191
    And I display the page
192
    # Update the group page "Page GroupA_06"
193
    And I follow "Pages and collections (tab)"
194
195
    And I click on "Page GroupA_06" panel menu
    And I click on "Edit" in "Page GroupA_06" panel menu
196
    And I follow "Settings" in the "Toolbar buttons" property
197
    And I set the field "Page description" to "<p>Group page 06 (updated)</p>"
198
    And I scroll to the id "settings_submit"
199
    And I press "Save"
Son Nguyen's avatar
Son Nguyen committed
200
    And I display the page
201
202
203
204
    #add test for group button lang string (Bug 1772327)
    And I click on "Edit"
    And I click on "Return to group pages and collections"
    And I should see "Pages and collections | GroupA"
205
    # Check if it is now in the first page of the list of group pages
206
    And I choose "My groups" in "Engage" from main menu
207
    And I scroll to the base of id "mygroups"
208
    And I follow "GroupA"
209
    And I should see "Page GroupA_06" in the "Group portfolios" property
Son Nguyen's avatar
Son Nguyen committed
210
211
    #And I follow "Next" in the "div#groupviews_pagination" "css_element"
    And I jump to next page of the list "groupviews_pagination"
212
    And I should not see "Page GroupA_06" in the "Group portfolios" property
213
    # Update the shared page "Page UserA_01"
214
    And I choose "Pages and collections" in "Create" from main menu
215
216
    And I click on "Page UserA_01" panel menu
    And I click on "Edit" in "Page UserA_01" panel menu
217
    And I follow "Settings" in the "Toolbar buttons" property
218
    And I set the field "Page description" to "<p>Page 01 (updated)</p>"
219
    And I scroll to the id "settings_submit"
220
    And I press "Save"
Son Nguyen's avatar
Son Nguyen committed
221
    And I display the page
222
    # Check if it is now in the first page of the list of shared pages
223
    And I choose "My groups" in "Engage" from main menu
224
    And I scroll to the base of id "mygroups"
225
    And I follow "GroupA"
226
    And I should see "Page UserA_01" in the "Pages shared with this group" property
Son Nguyen's avatar
Son Nguyen committed
227
228
    #And I follow "2" in the "div#sharedviews_pagination" "css_element"
    And I jump to page "2" of the list "sharedviews_pagination"
229
    And I should not see "Page UserA_01" in the "Pages shared with this group" property
230
    # Update the shared collection "Collection UserA_06"
231
    And I choose "Pages and collections" in "Create" from main menu
232
233
234
    And I click on "Collection UserA_06" panel menu
    And I click on "Edit" in "Collection UserA_06" panel menu
    And I fill in "Collection description" with "Collection 06 (updated)"
235
    And I scroll to the id "edit_submit"
236
237
    And I press "Save"
    # Check if it is now in the first page of the list of shared collections
238
    And I choose "My groups" in "Engage" from main menu
239
    And I scroll to the base of id "mygroups"
240
    And I follow "GroupA"
241
    And I should see "Collection UserA_06" in the "Collections shared with this group" property
Son Nguyen's avatar
Son Nguyen committed
242
243
    #And I follow "2" in the "div#sharedcollections_pagination" "css_element"
    And I jump to page "2" of the list "sharedcollections_pagination"
244
    And I should not see "Collection UserA_06" in the "Collections shared with this group" property
245
246
    # Submit some pages and collections to the group "GroupA"
    And I select "Page UserA_01" from "group_view_submission_form_1_options"
247
248
    And I press "Submit"
    And I press "Yes"
249
    And I select "Page UserA_02" from "group_view_submission_form_1_options"
250
251
    And I press "Submit"
    And I press "Yes"
252
    And I select "Page UserA_03" from "group_view_submission_form_1_options"
253
254
    And I press "Submit"
    And I press "Yes"
255
    And I select "Collection UserA_01" from "group_view_submission_form_1_options"
256
257
    And I press "Submit"
    And I press "Yes"
258
    And I select "Collection UserA_02" from "group_view_submission_form_1_options"
259
260
    And I press "Submit"
    And I press "Yes"
261
    And I select "Collection UserA_03" from "group_view_submission_form_1_options"
262
263
264
    And I press "Submit"
    And I press "Yes"
    # Check the list of submitted pages/collections
265
266
267
    And I should see "Page UserA_03" in the "Submissions to this group" property
    And I should see "Collection UserA_03" in the "Submissions to this group" property
    And I should not see "Page UserB_01" in the "Submissions to this group" property
Son Nguyen's avatar
Son Nguyen committed
268
269
    #And I follow "2" in the "div#allsubmitted_pagination" "css_element"
    And I jump to page "2" of the list "allsubmitted_pagination"
270
271
    And I should see "Page UserA_01" in the "Submissions to this group" property
    And I should not see "Page UserA_02" in the "Submissions to this group" property
272
    And I log out
273
274
275
    # Check pages and collections are shown in correct section
    # Share and submit pages and collections
    # Log in as a normal user
Gregor Anzelj's avatar
Gregor Anzelj committed
276
    Given I log in as "UserC" with password "Kupuh1pa!"
277
    # Verifying log in was successful
278
279
280
281
    And I should see "Cecilia"
    And I should see "GroupD"
    # Share pages and collections to the standard "GroupD"
    # Edit access for Page UserC_01, Page UserC_03, Page UserC_04
282
    And I choose "Shared by me" in "Share" from main menu
283
    And I follow "Pages"
284
285
286
    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 "GroupD" from "accesslist[0][searchtype]"
287
    And I press "Save"
288
    # Edit access for Collection UserC_01, Collection UserC_03, Collection UserC_04
289
    And I choose "Shared by me" in "Share" from main menu
290
    And I follow "Collections"
291
292
293
    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 "GroupD" from "accesslist[0][searchtype]"
294
    And I press "Save"
295
    # Submit pages and collections to the "GroupD" and "GroupA"
296
    And I choose "My groups" in "Engage" from main menu
297
298
    And I follow "GroupD"
    And I select "Page UserC_03" from "group_view_submission_form_4_options"
299
300
    And I press "Submit"
    And I press "Yes"
301
    And I select "Collection UserC_03" from "group_view_submission_form_4_options"
302
303
    And I press "Submit"
    And I press "Yes"
304
    And I choose "My groups" in "Engage" from main menu
305
    And I scroll to the base of id "mygroups"
306
307
    And I follow "GroupA"
    And I select "Page UserC_04" from "group_view_submission_form_1_options"
308
309
    And I press "Submit"
    And I press "Yes"
310
    And I select "Collection UserC_04" from "group_view_submission_form_1_options"
311
312
313
314
    And I press "Submit"
    And I press "Yes"
    And I log out
    #Check cases
Gregor Anzelj's avatar
Gregor Anzelj committed
315
    Given I log in as "UserA" with password "Kupuh1pa!"
316
    # Verifying log in was successful
317
318
    And I should see "Angela"
    And I follow "GroupD"
319
320
321
322
323
324
    And I should not see "Page UserC_03" in the "Pages shared with this group" property
    And I should see "Page UserC_03" in the "Submissions to this group" property
    And I should see "Collection UserC_01" in the "Collections shared with this group" property
    And I should not see "Collection UserC_03" in the "Collections shared with this group" property
    And I should see "Collection UserC_04" in the "Collections shared with this group" property
    And I should see "Collection UserC_03" in the "Submissions to this group" property
325
    And I log out
Gregor Anzelj's avatar
Gregor Anzelj committed
326
    Given I log in as "UserB" with password "Kupuh1pa!"
327
    # Verifying log in was successful
328
329
330
    And I should see "Bob"
    And I should see "GroupD"
    And I follow "GroupD"
331
332
333
334
335
336
337
338
    And I should see "Page UserC_01" in the "Pages shared with this group" property
    And I should not see "Page UserC_02" in the "Pages shared with this group" property
    And I should see "Page UserC_03" in the "Pages shared with this group" property
    And I should see "Page UserC_04" in the "Pages shared with this group" property
    And I should see "Collection UserC_01" in the "Collections shared with this group" property
    And I should not see "Collection UserC_02" in the "Collections shared with this group" property
    And I should see "Collection UserC_03" in the "Collections shared with this group" property
    And I should see "Collection UserC_04" in the "Collections shared with this group" property
339
    And I log out
340
    # Share and submit pages and collections - for course group "GroupC"
341
    # Log in as a normal user
Gregor Anzelj's avatar
Gregor Anzelj committed
342
    Given I log in as "UserC" with password "Kupuh1pa!"
343
    # Verifying log in was successful
344
345
346
347
    And I should see "Cecilia"
    And I should see "GroupC"
    # Share pages and collections to the "GroupC"
    # Edit access for Page UserC_09, Page UserC_11, Page UserC_12
348
    And I choose "Shared by me" in "Share" from main menu
349
    And I follow "Pages"
350
351
352
    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 "GroupC" from "accesslist[0][searchtype]"
353
    And I press "Save"
354
    # Edit access for Collection UserC_05, Collection UserC_07, Collection UserC_08
355
    And I choose "Shared by me" in "Share" from main menu
356
    And I follow "Collections"
357
358
359
    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 "GroupC" from "accesslist[0][searchtype]"
360
    And I press "Save"
361
    # Submit pages and collections to the "GroupC" and "GroupA"
362
    And I choose "My groups" in "Engage" from main menu
363
364
    And I follow "GroupC"
    And I select "Page UserC_10" from "group_view_submission_form_3_options"
365
366
    And I press "Submit"
    And I press "Yes"
367
    And I select "Page UserC_11" from "group_view_submission_form_3_options"
368
369
    And I press "Submit"
    And I press "Yes"
370
    And I select "Collection UserC_06" from "group_view_submission_form_3_options"
371
372
    And I press "Submit"
    And I press "Yes"
373
    And I select "Collection UserC_07" from "group_view_submission_form_3_options"
374
375
    And I press "Submit"
    And I press "Yes"
376
    And I choose "My groups" in "Engage" from main menu
377
    And I scroll to the base of id "mygroups"
378
379
    And I follow "GroupA"
    And I select "Page UserC_12" from "group_view_submission_form_1_options"
380
381
    And I press "Submit"
    And I press "Yes"
382
    And I select "Collection UserC_08" from "group_view_submission_form_1_options"
383
384
385
386
    And I press "Submit"
    And I press "Yes"
    And I log out
    #Check cases
Gregor Anzelj's avatar
Gregor Anzelj committed
387
    Given I log in as "UserB" with password "Kupuh1pa!"
388
    # Verifying log in was successful
389
390
391
    And I should see "Bob"
    And I should see "GroupC"
    And I follow "GroupC"
392
393
394
395
396
397
398
399
400
401
402
403
    And I should see "Page UserC_09" in the "Pages shared with this group" property
    And I should not see "Page UserC_10" in the "Pages shared with this group" property
    And I should not see "Page UserC_11" in the "Pages shared with this group" property
    And I should see "Page UserC_12" in the "Pages shared with this group" property
    And I should see "Page UserC_10" in the "Submissions to this group" property
    And I should see "Page UserC_11" in the "Submissions to this group" property
    And I should see "Collection UserC_05" in the "Collections shared with this group" property
    And I should not see "Collection UserC_06" in the "Collections shared with this group" property
    And I should not see "Collection UserC_07" in the "Collections shared with this group" property
    And I should see "Collection UserC_08" in the "Collections shared with this group" property
    And I should see "Collection UserC_06" in the "Submissions to this group" property
    And I should see "Collection UserC_07" in the "Submissions to this group" property