friends.feature 3.96 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@javascript @core @core_user @core_portfolio @friends
Feature: Friends feature functionality
    1. UserA find people within and without their Institution
        a. Verify page elements
            - Search field
            - Side blocks
            - Results - User image, user name, institution member and action buttons (send friend request, send message)
    2. UserA request friendship - add message (make 4 friend requests)

Background:
    Given the following "institutions" exist:
    | name | displayname |
    | instone | Institution One |
    | insttwo | Institution Two |

    Given the following "users" exist:
    | username | password | email | firstname | lastname | institution | authname |role |
    | UserA | Kupuh1pa! | UserA@example.org  | Angela  | UserA | instone | internal | member |
    | UserB | Kupuh1pa! | UserB@example.org  | Bob     | UserB | instone | internal | member |
    | UserC | Kupuh1pa! | UserC@example.org  | Cecilia | UserC | instone | internal | member |
    | UserD | Kupuh1pa! | UserD@example.org  | Dave    | UserD | insttwo | internal | member |
    | UserE | Kupuh1pa! | UserE@example.org  | Earl    | UserE | insttwo | internal | member |

Scenario: UserA sends friend requests to UserB, UserC, User E
    Given I log in as "UserA" with password "Kupuh1pa!"
26
    And I choose "People" in "Engage" from main menu
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
    Then I should see "Bob UserB"
    And I should see "Cecilia UserC"
    And I should not see "Dave UserD"
    When I click on "Send friend request" in "Bob UserB" row
    Then I should see "Send Bob UserB a friendship request"
    When I fill in "Would you like to be my friend?" for "Message"
    And I press "Request friendship"
    Then I should see "Sent a friendship request to Bob UserB"
    When I click on "Send friend request" in "Cecilia UserC" row
    Then I should see "Send Cecilia UserC a friendship request"
    When I fill in "Would you like to be my friend Cecilia?" for "Message"
    And I press "Request friendship"
    Then I should see "Sent a friendship request to Cecilia UserC"
    When I select "Everyone" from "Filter"
    And I press "Search"
    And I click on "Send friend request" in "Dave UserD" row
    Then I should see "Send Dave UserD a friendship request"
    When I fill in "Would you like to be my friend Dave?" for "Message"
    And I press "Request friendship"
    Then I should see "Sent a friendship request to Dave UserD"

    # UserA sets Friends control so Nobody may add them as a friend
    Given I select the radio "Nobody may add me as a friend"
    And press "Save"
    Then I should see "Updated friends control"
    And I log out

    # User B accepts the friendship request
    Given I log in as "UserB" with password "Kupuh1pa!"
    When  I follow "pending friend"
    Then I should see "Angela UserA (UserA)"
58
    And I should see the date "today" in the ".pendingfriend" element with the format "l, d F Y"
59
    And I should see "Member of Institution One"
60
    When I press "Approve"
61
62
63
64
65
    Then I should see "Accepted friend request"
    And I log out
    Given I log in as "UserC" with password "Kupuh1pa!"
    When  I follow "pending friend"
    Then I should see "Angela UserA (UserA)"
66
    And I should see the date "today" in the ".pendingfriend" element with the format "l, d F Y"
67
    And I should see "Member of Institution One"
68
    When I click on "Deny"
69
70
71
72
73
74
75
76
    Then I should see "Reason for rejecting request"
    When I fill in "I don't know who you are" for "Reason for rejecting request"
    And I press "Deny friend request"
    Then I should see "Rejected friend request"
    Then I log out

# UserC logs in and tries to add UserA who has set their friends control to Nobody may add me as a friend
    Given I log in as "UserE" with password "Kupuh1pa!"
77
    And I choose "People" in "Engage" from main menu
78
79
80
81
    When I select "Everyone" from "Filter"
    And I press "Search"
    Then I should see "This user does not want any new friends." in the "Angela UserA" row
    And I click on "Send friend request" in "Dave UserD" row