shared_with_group.feature 6.46 KB
Newer Older
1
2
3
4
5
6
7
8
9
@javascript @core @core_group
Feature: List of shared pages to a group
    In order to see shared pages to a group
    As a group member
    So I can see shared pages to the group

Background:
    Given the following "users" exist:
     | username | password | email | firstname | lastname | institution | authname | role |
Gregor Anzelj's avatar
Gregor Anzelj committed
10
11
12
     | UserA | Kupuh1pa! | UserA@example.org | Angela | User | mahara | internal | member |
     | UserB | Kupuh1pa! | UserB@example.org | Bob | User | mahara | internal | member |
     | UserC | Kupuh1pa! | UserC@example.org | Cecilia | User | mahara | internal | member |
13
14
    And the following "groups" exist:
     | name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff |
15
     | GroupA | UserB | GroupA owned by UserB | standard | ON | OFF | all | OFF | OFF | UserA |  |
16
     | GroupB | admin | GroupB owned by admin | standard | ON | ON | all | ON | ON | UserA, UserB, UserC |  |
17
    And the following "pages" exist:
18
      | title | description| ownertype | ownername |
19
20
21
22
23
      | Page UserA_01 | Page 01 | user | UserA |
      | Page UserA_02 | Page 02 | user | UserA |
      | Page UserA_03 | Page 03 | user | UserA |
      | Page UserA_05 | Page 05 | user | UserA |
      | Page UserA_06 | Page 06 | user | UserA |
24
      | Page UserA_07 | Page 07 to be used as solo page | user | UserA |
25
26
27
      | Page UserA_08 | Page 08 | user | UserA |
      | Page UserA_10 | Page 10 | user | UserA |
      | Page UserA_12 | Page 12 | user | UserA |
28
29
30
      | Page GroupB_01 | Group page 01 | group | GroupB |
      | Page GroupB_02 | Group page 02 | group | GroupB |
      | Page GroupB_03 | Group page 03 | group | GroupB |
31
    And the following "collections" exist:
32
      | title | description| ownertype | ownername | pages |
33
34
35
      | Collection UserA_01 | Collection 01 | user | UserA | Page UserA_06, Page UserA_12 |
      | Collection UserA_03 | Collection 03 | user | UserA | Page UserA_08 |
      | Collection UserA_05 | Collection 05 | user | UserA | Page UserA_10 |
36
37
38
39

Scenario: Share pages and collections to a group.
The list of shared pages must take into account of access date (Bug 1374163)
    # Log in as a normal user
Gregor Anzelj's avatar
Gregor Anzelj committed
40
    Given I log in as "UserA" with password "Kupuh1pa!"
41
    # Edit access for Page 01
42
    And I choose "Shared by me" in "Share" from main menu
43
    And I follow "Pages"
44
    And I click on "Edit access" in "Page UserA_01" row
45
    And I select "GroupA" from "accesslist[0][searchtype]"
46
    And I fill in "accesslist[0][startdate]" with "2015/06/15 03:00"
47
    And I press "Save"
48
    # Edit access for Page UserA_02
49
    And I choose "Shared by me" in "Share" from main menu
50
    And I follow "Pages"
51
    And I click on "Edit access" in "Page UserA_02" row
52
    And I select "GroupA" from "accesslist[0][searchtype]"
53
    And I fill in "accesslist[0][stopdate]" with "2015/04/15 02:50"
54
55
56
    And I press "Save"
    And I should see "The end date for 'group' access cannot be in the past."
    And I press "Cancel"
57
    # Edit access for Page UserA_03
58
    And I choose "Shared by me" in "Share" from main menu
59
    And I follow "Pages"
60
    And I click on "Edit access" in "Page UserA_03" row
61
62
63
64
    And I follow "Advanced options"
    And I fill in the following:
      | Access start date/time | 2015/06/15 00:00 |
    And I press "Save"
65
    # Edit access for Page UserA_05
66
    And I choose "Shared by me" in "Share" from main menu
67
    And I follow "Pages"
68
    And I click on "Edit access" in "Page UserA_05" row
69
    And I select "GroupA" from "accesslist[0][searchtype]"
70
    And I press "Save"
71
72

    #Checking the last modified date on a collection shared to a group.
73
    And I choose "Shared by me" in "Share" from main menu
74
75
76
77
    And I follow "Edit access"
    And I select "GroupA" from "accesslist[0][searchtype]"
    And I press "Save"
    Then I should see "Access rules were updated for 2 pages"
78
    And I choose "My groups" in "Engage" from main menu
79
80
81
82
    And I follow "GroupA"
    # the formats "strftimedate" and "j F Y" both resolve to dd Month YYYY, which is wanted here.
    And I should see the date "today" in the "#sharedcollectionlist" element with the format "d F Y"

83
    # Edit access for Collection 01
84
    And I choose "Shared by me" in "Share" from main menu
85
86
    And I click on "Edit access" in "Collection UserA_01" row
    And I set the select2 value "Collection UserA_01" for "editaccess_collections"
87
    And I select "GroupA" from "accesslist[0][searchtype]"
88
    And I fill in "accesslist[0][startdate]" with "2015/06/15 03:00"
89
    And I press "Save"
90
    # Edit access for Collection 03
91
92
    And I click on "Edit access" in "Collection UserA_03" row
    And I set the select2 value "Collection UserA_03" for "editaccess_collections"
93
94
95
96
    And I follow "Advanced options"
    And I fill in the following:
      | Access start date/time | 2015/06/15 00:00 |
    And I press "Save"
97
    # Edit access for Collection 05
98
99
    And I click on "Edit access" in "Collection UserA_05" row
    And I set the select2 value "Collection UserA_05" for "editaccess_collections"
100
    And I select "GroupA" from "accesslist[0][searchtype]"
101
    And I press "Save"
102
    # Check the list of shared pages to group "GroupA"
103
    And I choose "My groups" in "Engage" from main menu
104
    And I follow "GroupA"
105
106
107
108
    And I should see "Page UserA_05"
    And I should see "Collection UserA_05"
    And I should not see "Page UserA_03"
    And I should not see "Collection UserA_03"
109
    #Testing that view access for views in collections are editable properly
110
    And I choose "Shared by me" in "Share" from main menu
111
112
113
114
115
    Then I should see "Collection UserA_01"
    And I follow "Edit access"
    Then I should see "Collection UserA_01"
    And I should not see "Page UserA_01"

116
    And I choose "Shared by me" in "Share" from main menu
117
118
119
120
121
122
    And I follow "Pages"
    Then I click on "Edit access" in "Page UserA_07" row
    Then I should see "Page UserA_07"
    And I should not see "Collection UserA_01"
    And I log out
    #Displaying shared pages in most recently updated order (Bug 1490569)
Gregor Anzelj's avatar
Gregor Anzelj committed
123
    Given I log in as "admin" with password "Kupuh1pa!"
124
    And I choose "My groups" in "Engage" from main menu
125
    And I follow "GroupB"
126
    And I follow "Edit"
127
128
129
130
131
132
133
    And I scroll to the id "column-container"
    And I configure the block "Group portfolios"
    When I set the following fields to these values:
      | Sort shared pages and collections by | Most recently updated |
    And I press "Save"
    Then "GroupB_01" "text" should appear before "GroupB_02" "text"
    And "GroupB_03" "text" should appear after "GroupB_02" "text"