friends.feature 5.06 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
    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"

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
73
74
75
    # sending a friend request from a users profile page
    When I select "Everyone" from "Filter"
    And I press "Search"
    Then I should see "Earl UserE"
    When I follow "Earl UserE"
    Then I should see "Earl UserE"
    And I should see "Member of Institution Two"
    When I click on "Request friendship"
    Then I should see "Send Earl UserE a friendship request"
    When I fill in "Would you like to be my friend Earl?" for "Message"
    And I press "Request friendship"
    Then I should see "Sent a friendship request to Earl UserE"
    And I log out

    # log in as Earl and view pending friend Requests and accept
    Given I log in as "UserE" with password "Kupuh1pa!"
    And I follow "pending friend"
    Then I should see "Angela UserA (UserA)"
    And I should see the date "today" in the ".pendingfriend" element with the format "l, d F Y"
    And I should see "Member of Institution One"
    When I press "Approve"
    Then I should see "Accepted friend request"
    And I log out

    # Admin User sets Friends control so Nobody may add them as a friend
    Given I log in as "admin" with password "Kupuh1pa!"
    And I choose "People" in "Engage" from main menu
    And I select the radio "Nobody may add me as a friend"
76
77
78
79
80
81
82
83
    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)"
84
    And I should see the date "today" in the ".pendingfriend" element with the format "l, d F Y"
85
    And I should see "Member of Institution One"
86
    When I press "Approve"
87
88
89
90
91
    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)"
92
    And I should see the date "today" in the ".pendingfriend" element with the format "l, d F Y"
93
    And I should see "Member of Institution One"
94
    When I click on "Deny"
95
96
97
98
99
100
    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

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