diff --git a/cypress/e2e/User.Authentication.feature b/cypress/e2e/User.Authentication.feature new file mode 100644 index 000000000..db7680bd4 --- /dev/null +++ b/cypress/e2e/User.Authentication.feature @@ -0,0 +1,26 @@ +Feature: User authentication + As an user + I want to sign in + In order to be able to posts and do other contributions as myself + Furthermore I want to be able to stay logged in and logout again + + Background: + Given the following "users" are in the database: + | email | password | id | name | slug | termsAndConditionsAgreedVersion | + | peterpan@example.org | 1234 | id-of-peter-pan | Peter Pan | peter-pan | 0.0.4 | + + Scenario: Log in + When I navigate to page "/login" + And I fill in my credentials "peterpan@example.org" "1234" + And I click on "submit button" + Then I am logged in with username "Peter Pan" + + Scenario: Refresh and stay logged in + Given I am logged in as "peter-pan" + When I refresh the page + Then I am logged in with username "Peter Pan" + + Scenario: Log out + Given I am logged in as "peter-pan" + When I log out + Then I am on page "login" diff --git a/cypress/e2e/User.Block.feature.broken b/cypress/e2e/User.Block.feature.broken new file mode 100644 index 000000000..3d58c3c27 --- /dev/null +++ b/cypress/e2e/User.Block.feature.broken @@ -0,0 +1,69 @@ +Feature: User - block an user + As a user + I'd like to have a button to block another user + To prevent him from seeing and interacting with my contributions + + Background: + Given the following "users" are in the database: + | email | password | id | name | slug | termsAndConditionsAgreedVersion | + | peterpan@example.org | 123 | id-of-peter-pan | Peter Pan | peter-pan | 0.0.4 | + | user@example.org | 123 | harassing-user | Harassing User | harassing-user | 0.0.4 | + And the following "posts" are in the database: + | id | title | slug | authorId | + | bWBjpkTKZp | previously created post | previously-created-post | id-of-peter-pan | + And I am logged in as "peter-pan" + + Scenario: Block a user + When I navigate to page "profile/harassing-user" + And I click on "Block user" from the content menu in the user info box + And I "should" see "Unblock user" from the content menu in the user info box + And I navigate to my "Blocked users" settings page + Then I can see the following table: + | Avatar | Name | + | | Harassing User | + + Scenario: Blocked user cannot interact with my contributions + Given I block the user "Harassing User" + And I am logged in as "harassing-user" + And I navigate to page "/post/previously-created-post" + Then they should see a text explaining why commenting is not possible + And they should not see the comment form + + Scenario: Block a previously followed user + Given I follow the user "Harassing User" + When I navigate to page "/profile/harassing-user" + And I click on "Block user" from the content menu in the user info box + And I get removed from his follower collection + And I "should" see "Unblock user" from the content menu in the user info box + + Scenario: Posts of blocked users are not filtered from search results + Given "harassing-user" wrote a post "You can still see my posts" + And I block the user "Harassing User" + When I search for "see" + And I wait for 3000 milliseconds + Then I should see the following posts in the select dropdown: + | title | + | You can still see my posts | + + Scenario: Blocked users can still see my posts + When I block the user "Harassing User" + And I am logged in as "harassing-user" + And I navigate to page "/" + And I search for "previously created" + And I wait for 3000 milliseconds + Then I should see the following posts in the select dropdown: + | title | + | previously created post | + + Scenario: Blocked users cannot see they are blocked in their list + Given a user has blocked me + And I navigate to page "/" + And I navigate to my "Blocked users" settings page + Then I should see no users in my blocked users list + + Scenario: Blocked users should not see link or button to unblock, only blocking users + Given a user has blocked me + When I navigate to page "/profile/harassing-user" + And I should see the "Follow" button + And I should not see "Unblock user" button + And I "should not" see "Unblock user" from the content menu in the user info box diff --git a/cypress/e2e/User.Mute.feature.broken b/cypress/e2e/User.Mute.feature.broken new file mode 100644 index 000000000..1390063f7 --- /dev/null +++ b/cypress/e2e/User.Mute.feature.broken @@ -0,0 +1,60 @@ +Feature: Mute a User + As a user + I'd like to have a button to mute another user + To prevent him from seeing and interacting with my contributions + + Background: + Given the following "users" are in the database: + | email | password | id | name | slug | termsAndConditionsAgreedVersion | + | peterpan@example.org | 123 | id-of-peter-pan | Peter Pan | peter-pan | 0.0.4 | + | user@example.org | 123 | annoying-user | Annoying User | annoying-user | 0.0.4 | + Given the following "posts" are in the database: + | id | title | content | authorId | + | im-not-muted | Post that should be seen | cause I'm not muted | id-of-peter-pan | + | bWBjpkTKZp | previously created post | previously-created-post | id-of-peter-pan | + And I am logged in as "peter-pan" + + Scenario: Mute a user + Given I navigate to page "/profile/annoying-user" + When I click on "Mute user" from the content menu in the user info box + And I navigate to my "Muted users" settings page + Then I can see the following table: + | Avatar | Name | + | | Annoying User | + + Scenario: Mute a previously followed user + Given I follow the user "Annoying User" + And "annoying-user" wrote a post "Spam Spam Spam" + When I navigate to page "/profile/annoying-user" + And I click on "Mute user" from the content menu in the user info box + Then the list of posts of this user is empty + And I get removed from his follower collection + + Scenario: Posts of muted users are filtered from search results, users are not + Given "annoying-user" wrote a post "Spam Spam Spam" + When I search for "Spam" + And I wait for 3000 milliseconds + Then I should see the following posts in the select dropdown: + | title | + | Spam Spam Spam | + When I mute the user "Annoying User" + And I refresh the page + And I search for "Anno" + And I wait for 3000 milliseconds + Then the search should not contain posts by the annoying user + But the search should contain the annoying user + But I search for "not muted" + And I wait for 3000 milliseconds + Then I should see the following posts in the select dropdown: + | title | + | Post that should be seen | + + Scenario: Muted users can still see my posts + And I mute the user "Annoying User" + And I am logged in as "annoying-user" + And I navigate to page "/" + And I search for "previously created" + And I wait for 3000 milliseconds + Then I should see the following posts in the select dropdown: + | title | + | previously created post | diff --git a/cypress/e2e/User.SettingNotifications.feature b/cypress/e2e/User.SettingNotifications.feature new file mode 100644 index 000000000..7e4301b81 --- /dev/null +++ b/cypress/e2e/User.SettingNotifications.feature @@ -0,0 +1,20 @@ +Feature: User sets donations info settings + As a user + I want to change my notifications settings + In order to manage the notifications + + Background: + Given the following "users" are in the database: + | email | password | id | name | slug | termsAndConditionsAgreedVersion | + | peterpan@example.org | 123 | id-of-peter-pan | Peter Pan | peter-pan | 0.0.4 | + | user@example.org | 123 | user | User | user | 0.0.4 | + And I am logged in as "peter-pan" + + Scenario: The notifications setting "Send e-mail notifications" is set to true by default and can be set to false + # When I navigate to my "Notifications" settings page + When I navigate to page "/settings/notifications" + Then the checkbox with ID "send-email" should "be.checked" + And I click on element with ID "send-email" + And the checkbox with ID "send-email" should "not.be.checked" + Then I click save + And I see a toaster with "Notifications settings saved!"