diff --git a/cypress/features.md b/cypress/features.md index 345840e39..eb8292c3b 100644 --- a/cypress/features.md +++ b/cypress/features.md @@ -83,6 +83,13 @@ The following features will be implemented. This gets done in three steps: * Editing Comments * Upvote comments of others +### Notifications +[Cucumber features](./integration/notifications) + +* User @-mentionings +* Notify authors for comments +* Administrative notifications to all users + ### Contribution List * Show Posts by Tiles diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 9478d8d4e..6b04e8e4c 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -293,3 +293,23 @@ Then('I can login successfully with password {string}', password => { }) cy.get('.iziToast-wrapper').should('contain', "You are logged in!") }) + +When('I log in with the following credentials:', table => { + const { email, password } = table.hashes()[0] + cy.login({ email, password }) +}) + +When('open the notification menu and click on the first item', () => { + cy.get('.notifications-menu').click() + cy.get('.notifications-menu-popover a').first().click() +}) + +Then('see {int} unread notifications in the top menu', count => { + cy.get('.notifications-menu').should('contain', count) +}) + +Then('I get to the post page of {string}', path => { + path = path.replace('...', '') + cy.location('pathname').should('contain', '/post/') + cy.location('pathname').should('contain', path) +}) diff --git a/cypress/integration/notifications/Mentionings.feature b/cypress/integration/notifications/Mentionings.feature new file mode 100644 index 000000000..7fcb34c77 --- /dev/null +++ b/cypress/integration/notifications/Mentionings.feature @@ -0,0 +1,20 @@ +Feature: Notifications for a mentioning + As a user + I want to be notified if sb. mentions me in a post or comment + In order join conversations about or related to me + + Background: + Given we have the following user accounts: + | name | slug | email | password | + | Wolle aus Hamburg | wolle-aus-hamburg | wolle@example.org | 1234 | + And we have the following posts in our database: + | id | title | content | + | p1 | Hey Wolle | Hey @wolle-aus-hamburg, how do you do? | + + Scenario: + When I log in with the following credentials: + | email | password | + | wolle@example.org | 1234 | + And see 1 unread notifications in the top menu + And open the notification menu and click on the first item + Then I get to the post page of ".../hey-wolle"