search_users_by_share_pages.feature 3.43 KB
Newer Older
1
@javascript @core @core_user @core_portfolio
2
3
4
5
6
7
Feature: Searching by user in Shared Pages
    In order to search by name on the shared with me page
    As an admin I need to create users
    So I can search for them by name

Background:
8
9
    Given the following "users" exist:
    | username | password | email | firstname | lastname | institution | authname |role |
Gregor Anzelj's avatar
Gregor Anzelj committed
10
11
    | UserA | Kupuh1pa! | UserA@example.org  | Angela | User | mahara | internal | member |
    | UserB | Kupuh1pa! | UserB@example.org  | Bob | User | mahara | internal | member |
12

13
14
15
16
17
18
    And the following "pages" exist:
     | title | description | ownertype | ownername |
     | Page UserA_01 | Page 01 | user | UserA |
     | Page UserA_02 | Page 02 | user | UserA |
     | Page UserB_01 | Page 03 | user | UserB |
     | Page UserB_02 | Page 04 | user | UserB |
19
20
     | Page UserB_03 | Page 05 | user | UserB |
     | Page UserB_04 | Page 06 | user | UserB |
21

22
23
Scenario: Create users and search for them (Bug 897586)
    # Log in as the student user
Gregor Anzelj's avatar
Gregor Anzelj committed
24
    Given I log in as "UserA" with password "Kupuh1pa!"
25
    # Sharing both of the pages that have been created
26
    And I choose "Shared by me" in "Share" from main menu
27
28
    And I click on "Edit access" in "Page UserA_01" row
    And I set the select2 value "Page UserA_01, Page UserA_02" for "editaccess_views"
Robert Lyon's avatar
Robert Lyon committed
29
    And I select "Public" from "accesslist[0][searchtype]"
30
31
    And I press "Save"
    # Verifying that both of the pages have been shared
32
    And I should see "Access rules were updated for 2 pages."
33
    And I log out
34
    # Log in as the second student user
Gregor Anzelj's avatar
Gregor Anzelj committed
35
    And I log in as "UserB" with password "Kupuh1pa!"
36
    # Verifying log in was successful
37
    And I should see "Bob User"
38
    # Sharing 2 of the pages Bob created to public
39
    And I choose "Shared by me" in "Share" from main menu
40
41
    And I click on "Edit access" in "Page UserB_01" row
    And I set the select2 value "Page UserB_01, Page UserB_02" for "editaccess_views"
Robert Lyon's avatar
Robert Lyon committed
42
    And I select "Public" from "accesslist[0][searchtype]"
43
44
    And I press "Save"
    # Verifying that both of the pages have been shared
45
    And I should see "Access rules were updated for 2 pages."
46
    # Sharing 1 of the pages Bob created to admin user
47
    And I choose "Shared by me" in "Share" from main menu
48
49
    And I click on "Edit access" in "Page UserB_01" row
    And I set the select2 value "Page UserB_03" for "editaccess_views"
50
    And I select "User" from "accesslist[0][searchtype]"
51
52
53
54
    And I select "Admin User" from select2 search box in row number "1"
    And I press "Save"
    # Verifying that the page has been shared
    And I should see "Access rules were updated for 1 page."
55
    And I log out
56
    # Logging back in as admin to search for users on the shared with me page
Gregor Anzelj's avatar
Gregor Anzelj committed
57
    And I log in as "admin" with password "Kupuh1pa!"
58
    And I choose "Shared with me" in "Share" from main menu
59
    # Entering Angela name in the search box
60
    And I fill in the following:
61
    | Search: | Angela |
62
    And I check "Public"
63
    And I press "search_submit"
64
    # Verifying I can see an Angela's page
65
    Then I should see "Page UserA_01"
66
67
68
69
70
71
72
73
74
    # Verifying I can see some of Bob's pages
    # Entering Bob name in the search box
    And I fill in the following:
    | Search: | Bob |
    And I check "Public"
    And I press "search_submit"
    And I should see "Page UserB_02"
    And I should see "Page UserB_03"
    # Verifying I cannot see Bob's page not shared
75
    And I should not see "Page UserB_04"
76
    And I should not see "Page UserA_01"