notifications.feature 7.89 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
@javascript
Feature: Notifications
  In order to see what is happening
  As a User
  I want to get notifications

  Background:
    Given That following users:
      | email             |
      | bob@bob.bob       |
      | alice@alice.alice |
12
      | carol@carol.carol |
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

  Scenario: someone shares with me
    When I sign in as "bob@bob.bob"
    And I am on "alice@alice.alice"'s page
    And I add the person to my "Besties" aspect
    And I sign out
    When I sign in as "alice@alice.alice"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    Then I should see "started sharing with you"
    And I go to the notifications page
    Then I should see "started sharing with you"
    And I should have 1 email delivery

  Scenario: someone re-shares my post
    Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
    And "alice@alice.alice" has a public post with text "check this out!"
    When I sign in as "bob@bob.bob"
    And I am on "alice@alice.alice"'s page
32
    And I confirm the alert after I follow "Reshare"
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
    And I sign out
    When I sign in as "alice@alice.alice"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    Then I should see "reshared your post"
    And I should have 1 email delivery

  Scenario: someone likes my post
    Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
    And "alice@alice.alice" has a public post with text "check this out!"
    When I sign in as "bob@bob.bob"
    And I am on "alice@alice.alice"'s page
    And I follow "Like"
    And I sign out
    When I sign in as "alice@alice.alice"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    Then I should see "liked your post"
    And I should have 1 email delivery

  Scenario: someone comments on my post
    Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
    And "alice@alice.alice" has a public post with text "check this out!"
56
    And "bob@bob.bob" has commented "great post!" on "check this out!"
57 58 59 60 61 62
    When I sign in as "alice@alice.alice"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    Then I should see "commented on your post"
    And I should have 1 email delivery

63 64
  Scenario: unconnected user comments in reply to comment by another user who commented a post of someone who she shares with
    Given "alice@alice.alice" has a public post with text "check this out!"
65 66
    And "bob@bob.bob" has commented "great post, alice!" on "check this out!"
    And "carol@carol.carol" has commented "great comment, bob!" on "check this out!"
67 68 69 70 71 72 73 74 75
    When I sign in as "bob@bob.bob"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    And I should see "also commented on"
    And I should have 3 email delivery


  Scenario: unconnected user comments in reply to my comment to her post
    Given "alice@alice.alice" has a public post with text "check this out!"
76 77
    And "carol@carol.carol" has commented "great post, alice!" on "check this out!"
    And "alice@alice.alice" has commented "great comment, carol!" on "check this out!"
78 79 80 81 82 83 84 85 86
    When I sign in as "carol@carol.carol"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    And I should see "also commented on"
    And I should have 2 email delivery

  Scenario: connected user comments in reply to my comment to an unconnected user's post
    Given "alice@alice.alice" has a public post with text "check this out!"
    And a user with email "bob@bob.bob" is connected with "carol@carol.carol"
87 88
    And "carol@carol.carol" has commented "great post, alice!" on "check this out!"
    And "bob@bob.bob" has commented "great post!" on "check this out!"
89 90 91 92 93 94
    When I sign in as "carol@carol.carol"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    And I should see "also commented on"
    And I should have 3 email delivery

95 96 97 98 99 100
  Scenario: someone mentioned me in their post
    Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
    And Alice has a post mentioning Bob
    When I sign in as "bob@bob.bob"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
101
    Then I should see "mentioned you in the post"
102
    And I should have 1 email delivery
103

104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
  Scenario: someone mentioned me in a comment
    Given "alice@alice.alice" has a public post with text "check this out!"
    And "bob@bob.bob" has commented mentioning "alice@alice.alice" on "check this out!"
    When I sign in as "alice@alice.alice"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    And I should see "mentioned you in a comment"
    And I should have 1 email delivery

  Scenario: I mark a notification as read
    Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
    And Alice has a post mentioning Bob
    When I sign in as "bob@bob.bob"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    And I wait for notifications to load
    And I should see a ".unread .unread-toggle .entypo-eye"
    When I click on selector ".unread .unread-toggle .entypo-eye"
    Then I should see a ".read .unread-toggle"

124 125 126 127 128 129 130 131 132 133 134
  Scenario: filter notifications
    Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
    And Alice has a post mentioning Bob
    When I sign in as "bob@bob.bob"
    And I am on the notifications page
    Then I should see "mentioned you in the post"
    When I filter notifications by likes
    Then I should not see "mentioned you in the post"
    When I filter notifications by mentions
    Then I should see "mentioned you in the post"

135
  Scenario: show hovercard in notification dropdown from the profile edit page
136 137 138 139 140
    When I sign in as "bob@bob.bob"
    And I am on "alice@alice.alice"'s page
    And I add the person to my "Besties" aspect
    And I sign out
    When I sign in as "alice@alice.alice"
141
    And I go to the edit profile page
142
    And I follow "Notifications" in the header
143 144 145 146
    Then the notification dropdown should be visible
    When I wait for notifications to load
    And I activate the first hovercard in the notification dropdown
    And I press the aspect dropdown
147
    Then the aspect dropdown should be visible
148

149
  Scenario: show hovercard in notification dropdown from the stream
150 151 152 153 154 155 156
    When I sign in as "bob@bob.bob"
    And I am on "alice@alice.alice"'s page
    And I add the person to my "Besties" aspect
    And I sign out
    When I sign in as "alice@alice.alice"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
157 158
    When I wait for notifications to load
    And I activate the first hovercard in the notification dropdown
159 160
    And I press the aspect dropdown
    Then the aspect dropdown should be visible
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176

  Scenario: scrollbar shows up when >5 notifications
    Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
    And Alice has 6 posts mentioning Bob
    When I sign in as "bob@bob.bob"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    Then the notification dropdown scrollbar should be visible

  Scenario: dropdown will load more elements when bottom is reached
    Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
    And Alice has 20 posts mentioning Bob
    When I sign in as "bob@bob.bob"
    And I follow "Notifications" in the header
    Then the notification dropdown should be visible
    Then the notification dropdown scrollbar should be visible
177
    When I wait for notifications to load
178 179
    Then there should be 10 notifications loaded
    When I scroll down on the notifications dropdown
180
    When I wait for notifications to load
181
    Then there should be 15 notifications loaded